This page contains raw code references and configuration excerpts for the Crystal mob entity.
Constructor:
public Crystal() { adjustStats(Dungeon.depth); ensureWand(false); } static public Crystal makeShadowLordCrystal() { Crystal crystal = new Crystal(); crystal.kind = 2; crystal.ensureWand(true); return crystal; }
Stats adjustment:
public void adjustStats(int depth) { kind = (ctr++) % 2; hp(ht(depth * 4 + 1)); baseDefenseSkill = depth * 2 + 1; baseAttackSkill = 35; expForKill = depth + 1; maxLvl = depth + 2; dr = expForKill /3; addImmunity(ScrollOfPsionicBlast.class); addImmunity(ToxicGas.class); addImmunity(Paralysis.class); addImmunity(Stun.class); addImmunity(ConfusionGas.class); }
Wand handling:
private Wand ensureWand(boolean regen) { Wand wand = getBelongings().getItem(Wand.class); if (wand != null && !regen) { return wand; } var item = SimpleWand.createRandomSimpleWand().upgrade(Dungeon.depth/3); if(kind == 2 && Random.Float(1) < 0.25f) { item = new WandOfShadowbolt().upgrade(Dungeon.depth/2); } item.collect(this); //no treasury check, we want to keep the wand in the crystal return ensureWand(false); }
</content>