User Tools

Site Tools


mr:shadow_lord_mob

Shadow Lord Mob - Code References

Java Classes

  • ShadowLord.java - Main mob implementation
    • Package: com.nyrds.pixeldungeon.mobs.common
    • Extends: Boss
    • Implements: IZapper
    • Author: DeadDie (created 13.02.2016)
  • Boss.java - Base class
  • ShadowLordLevel.java - Dedicated arena level
  • Crystal.java - Spawns crystals via Crystal.makeShadowLordCrystal()
  • MobFactory.java - Mob registration: registerMobClass(ShadowLord.class)

JSON Configuration

{
  "battleMusic": "ost_boss_5_fight",
  "battleMusicFallback": "ost_boss_fight"
}

  • levelsDesc/Bestiary.json - Spawn configuration: “ShadowLordLevelâ€�:{“anyâ€�:{“ShadowLordâ€�:1}}

String Resources

<string name="ShadowLord_Name">shadow lord</string>
<string name="ShadowLord_Name_Objective">Shadow Lord</string>
<string name="ShadowLord_Gender">masculine</string>
<string name="ShadowLord_Intro">Prepare yourself!</string>
<string name="ShadowLord_Death">Nooooo...</string>
<string name="ShadowLord_Desc">This creature is made of pure evil and impenetrable darkness. Many believe that he is the Old God himself, considering how powerful he is. While others assumes that he is but a guardian of the Old God\'s chambers.</string>

Lua Scripts

This entity is implemented in Java, no Lua script exists

Implementation Details

  • HP/HT: 260 (set in constructor: hp(ht(260)))
  • Base Defense Skill: 40
  • Base Attack Skill: 30
  • Damage Range: 30-40 (dmgMin = 30, dmgMax = 40)
  • Damage Reduction (DR): 40 (dr = 40)
  • STR: 15 (STR(15))
  • EXP for Kill: 60 (expForKill = 60)
  • Drops: ScrollOfWeaponUpgrade (guaranteed, collect(new ScrollOfWeaponUpgrade()))
  • Walking Type: WalkingType.ABSOLUTE
  • isHumanoid: true

Special Abilities

  • spawnShadow(): Spawns a Shadow mob next to the Shadow Lord via WandOfBlink.appear()
  • spawnWraith(): Spawns 4 Wraith mobs at empty cells next to the Shadow Lord (Wraith.spawnAt(cell))
  • twistLevel(): Transforms the level:
    • Calls LevelTools.makeEmptyLevel(level, false) once per encounter
    • Builds a maze with LevelTools.buildShadowLordMaze(level, 6)
    • Carves a 3×3 area around hero and boss to avoid soft-lock
    • Spawns a Crystal at a random pedestal (Crystal.makeShadowLordCrystal())
    • Fills 5×5 area around the crystal with Darkness blob via level.fillAreaWith(Darkness.class, x - 2, y - 2, 5, 5, 1)
  • canAttack(): Can attack when level().distance(getPos(), enemy.getPos()) < 4 and Ballistica.cast(…) reaches target
  • fx(): Uses MagicMissile.purpleLight(…) with Assets.SND_ZAP and hides sprite
  • damage(): When damaged by an external source and cooldown < 0:
    • Switches state to Fleeing
    • Blinks away via CharUtils.blinkAway(…) to a cell at distance > 3 from attacker
    • Calls twistLevel()
    • Sets cooldown = 10
  • act(): Per-turn behavior:
    • Decrements cooldown
    • When Fleeing and cooldown < 0: returns to Wandering, then with 70% chance spawns a Wraith, otherwise a Shadow; yells ShadowLord_Intro string
    • Heals 1) / 4) HP when standing on Darkness blob (only when hp() < ht())
    • Takes 1 damage when standing on Foliage blob (with Speck.BONE particle burst)
  • die(): On death:
    • Yells ShadowLord_Death string
    • Calls LevelTools.makeEmptyLevel(level(), false) to reset the arena
    • Unseals the level (level().unseal())
    • Validates Badges.Badge.SHADOW_LORD_SLAIN via Badges.validateBossSlain(…)

Immunities and Resistances

  • Inherits from Boss class
  • Special interaction with Darkness blob (healing source) and Foliage blob (damage source)
  • No additional immunities declared beyond the Boss base class

Code References

1)
ht() - hp(
mr/shadow_lord_mob.txt · Last modified: by 127.0.0.1