mr:earth_elemental_mob
Differences
This shows you the differences between two versions of the page.
| mr:earth_elemental_mob [2025/12/19 01:23] – docs: Update crystal_mob.txt with source references and mr: link mike | mr:earth_elemental_mob [2025/12/19 01:23] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====== Earth Elemental Mob - Code References ====== | ||
| + | This page contains raw code references and configuration excerpts for the Earth Elemental mob entity. | ||
| + | |||
| + | ==== Entity Kind ==== | ||
| + | * **getEntityKind() value:** EarthElemental | ||
| + | |||
| + | ==== Java Implementation ==== | ||
| + | * **Class location:** [[code: | ||
| + | * **Parent Class:** [[code: | ||
| + | * **Interfaces: | ||
| + | |||
| + | ==== Code Fragments ==== | ||
| + | **Constructor: | ||
| + | <code java> | ||
| + | public EarthElemental() { | ||
| + | adjustStats(Dungeon.depth); | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | **Stats adjustment: | ||
| + | <code java> | ||
| + | @Override | ||
| + | public void adjustStats(int depth) { | ||
| + | super.adjustStats(depth); | ||
| + | |||
| + | hp(ht(depth * 10 + 1)); | ||
| + | |||
| + | baseDefenseSkill = depth / 2 + 1; | ||
| + | baseAttackSkill = (baseDefenseSkill) / 2 + 1; | ||
| + | dmgMin = ht() / 5; | ||
| + | dmgMax = ht() / 5; | ||
| + | |||
| + | dr = depth + 1; | ||
| + | expForKill = depth + 1; | ||
| + | maxLvl = depth + 2; | ||
| + | |||
| + | // Add immunities | ||
| + | addImmunity(Burning.class); | ||
| + | addImmunity(ToxicGas.class); | ||
| + | addImmunity(Stun.class); | ||
| + | addImmunity(Paralysis.class); | ||
| + | addImmunity(Roots.class); | ||
| + | addImmunity(Bleeding.class); | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | **Speed modification: | ||
| + | <code java> | ||
| + | @Override | ||
| + | public float speed() { | ||
| + | return level().getWater(pos) ? super.speed() * 0.5f : super.speed(); | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | **Attack processing with regrowth:** | ||
| + | <code java> | ||
| + | @Override | ||
| + | public int attackProc(Char enemy, int damage) { | ||
| + | if (Random.Float() < 0.5f) { | ||
| + | int cell = pos; | ||
| + | var terrain = level().getTerrain(cell); | ||
| + | if (terrain == Terrain.EMPTY || | ||
| + | terrain == Terrain.EMBERS || | ||
| + | terrain == Terrain.EMPTY_DECO || | ||
| + | terrain == Terrain.GRASS || | ||
| + | terrain == Terrain.HIGH_GRASS) { | ||
| + | |||
| + | GameScene.add(Blob.seed(cell, | ||
| + | } | ||
| + | } | ||
| + | return super.attackProc(enemy, | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | **Kind calculation: | ||
| + | <code java> | ||
| + | @Override | ||
| + | public int getKind() { | ||
| + | return Math.min(depth / 5, 4); | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | ==== Drop Information ==== | ||
| + | <code java> | ||
| + | @Override | ||
| + | protected Loot droppedLoot() { | ||
| + | return Random.Float() < 0.1f ? new Earthroot.Seed() : null; | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | ==== Configuration ==== | ||
| + | * **Spawn location:** GRASS areas, defined in [[code: | ||
| + | * **Entity Kind:** EarthElemental | ||
| + | |||
| + | ==== String Resources ==== | ||
| + | * **EarthElemental_Name: | ||
| + | * **EarthElemental_Desc: | ||
| + | </ | ||
