mr:crystal_mob
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revision | |||
| mr:crystal_mob [2025/12/19 23:54] – Update various pages with enhanced source code references and documentation mike | mr:crystal_mob [2025/12/19 23:55] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====== Crystal Mob - Code References ====== | ||
| + | This page contains raw code references and configuration excerpts for the Crystal mob entity. | ||
| + | |||
| + | ==== Entity Kind ==== | ||
| + | * **getEntityKind() value:** Crystal | ||
| + | |||
| + | ==== Java Implementation ==== | ||
| + | * **Class location:** [[https:// | ||
| + | * **Parent Class:** [[https:// | ||
| + | * **Interfaces: | ||
| + | |||
| + | ==== Code Fragments ==== | ||
| + | **Constructor: | ||
| + | <code java> | ||
| + | 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: | ||
| + | <code java> | ||
| + | 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:** | ||
| + | <code java> | ||
| + | private Wand ensureWand(boolean regen) { | ||
| + | Wand wand = getBelongings().getItem(Wand.class); | ||
| + | if (wand != null && !regen) { | ||
| + | return wand; | ||
| + | } | ||
| + | |||
| + | var item = SimpleWand.createRandomSimpleWand().upgrade(Dungeon.depth/ | ||
| + | if(kind == 2 && Random.Float(1) < 0.25f) { | ||
| + | item = new WandOfShadowbolt().upgrade(Dungeon.depth/ | ||
| + | } | ||
| + | |||
| + | item.collect(this); | ||
| + | |||
| + | return ensureWand(false); | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | ==== Properties ==== | ||
| + | * **movable: | ||
| + | * **carcassChance: | ||
| + | * **immunities: | ||
| + | * **attackSkill: | ||
| + | * **damageRoll: | ||
| + | * **canBePet: | ||
| + | |||
| + | ==== String Resources ==== | ||
| + | * **Crystal_Name: | ||
| + | * **Crystal_Desc: | ||
| + | </ | ||
mr/crystal_mob.txt · Last modified: by 127.0.0.1
