User Tools

Site Tools


mr:earth_elemental_mob

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

mr:earth_elemental_mob [2025/12/19 01:23] – docs: Update crystal_mob.txt with source references and mr: link mikemr: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:RemixedDungeon/src/main/java/com/nyrds/pixeldungeon/mobs/elementals/EarthElemental.java|EarthElemental.java]]
 +* **Parent Class:** [[code:RemixedDungeon/src/main/java/com/nyrds/pixeldungeon/mobs/elementals/Elemental.java|Elemental]]
 +* **Interfaces:** IDepthAdjustable
 +
 +==== Code Fragments ====
 +**Constructor:**
 +<code java>
 +public EarthElemental() {
 + adjustStats(Dungeon.depth);
 +}
 +</code>
 +
 +**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);
 +}
 +</code>
 +
 +**Speed modification:**
 +<code java>
 +@Override
 +public float speed() {
 + return level().getWater(pos) ? super.speed() * 0.5f : super.speed();
 +}
 +</code>
 +
 +**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, 15, Regrowth.class).setStrength(Math.max(depth + 1, 10)));
 + }
 + }
 + return super.attackProc(enemy, damage);
 +}
 +</code>
 +
 +**Kind calculation:**
 +<code java>
 +@Override
 +public int getKind() {
 + return Math.min(depth / 5, 4);
 +}
 +</code>
 +
 +==== Drop Information ====
 +<code java>
 +@Override
 +protected Loot droppedLoot() {
 + return Random.Float() < 0.1f ? new Earthroot.Seed() : null;
 +}
 +</code>
 +
 +==== Configuration ====
 +* **Spawn location:** GRASS areas, defined in [[code:RemixedDungeon/src/main/assets/levelsDesc/Bestiary.json|Bestiary.json]] as "GRASS":{"EarthElemental":1}
 +* **Entity Kind:** EarthElemental
 +
 +==== String Resources ====
 +* **EarthElemental_Name:** earth elemental
 +* **EarthElemental_Desc:** A humanoid mass of living earth and stone, animated by primitive forces.
 +</content>