User Tools

Site Tools


mr:bishop_npc

Bishop NPC - Code References

Java Classes

This entity is implemented in Lua/JSON, no Java class exists. See:

JSON Configuration

{
   "baseSpeed"     : 0,
   "spriteDesc"    : "spritesDesc/BishopNPC.json",
   "scriptFile"    : "scripts/npc/Bishop",
   "friendly"      : true,
   "movable"       : false,
   "aiState"       : "Passive",
   "fraction"      : "NEUTRAL",
   "immortal"      : true,
   "isHumanoid"    : true
}

  • `baseSpeed: 0` — Cannot move
  • `spriteDesc: spritesDesc/BishopNPC.json` — Sprite configuration (texture `mobs/town_bishop3.png`, 16×18, idle/run/attack/die frames)
  • `scriptFile: scripts/npc/Bishop` — Lua script reference
  • `friendly: true` — Friendly to player
  • `movable: false` — Cannot be moved by other actors
  • `aiState: Passive` — Passive AI state (replaced by `NpcDefault` in `spawn` of the Lua script)
  • `fraction: NEUTRAL` — Neutral faction
  • `immortal: true` — Cannot be killed through normal means; `die` handler in Lua still runs if the NPC is somehow destroyed, which kills the hero and reduces hero max HP
  • `isHumanoid: true` — Humanoid mob type

Level Placement

String Resources

<string name="BishopNPC_Name">Bishop</string>
<string name="BishopNPC_Name_Objective">Bishop</string>
<string name="BishopNPC_Gender">masculine</string>
<string name="BishopNPC_Desc">Bishop of the Holy Church of Santa the Depth Lord</string>
<string name="Bishop_title">Bishop</string>
<string name="Bishop_text">Days and nights I pray for you my child.</string>
<string name="Bishop_lesser_bless">Lesser bless - %d g</string>
<string name="Bishop_great_bless">Great bless - %d g</string>
<string name="Bishop_remove_curse">Remove curse - %d g</string>
<string name="Bishop_not_interested">Leave</string>
<string name="Bishop_no_money">You can\'t pay for it.</string>
<string name="Bishop_bye">I will pray for you my child.</string>

  • `Bishop_lesser_bless` / `Bishop_great_bless` / `Bishop_remove_curse` are formatted with the dynamic price (see Lua `interact`)
  • `WndPriest_Instruction2` (in `strings_all.xml`) is the text that refers the player to the Bishop for blessings and curse removal

Lua Scripts

  • Bishop.lua — NPC behavior script
  • Key functions:
    • `interact(self, chr)` — Opens `RPD.chooseOption` with title `Bishop_title`, prompt `Bishop_text`, and four service options
    • `die(self, cause)` — Halves the hero's max HP and kills the hero; plays the cursed sound and emits `ShadowParticle.CURSE`
    • `spawn(me, level)` — Sets AI to `“NpcDefaultâ€�`
  • Services offered (prices scale with `RPD.RemixedDungeon:getDifficultyFactor() * 1.05^(client:lvl()-1)`):
    • Lesser Blessing: base `100 * priceFactor` gold — applies `RPD.Buffs.Blessed` for 100 turns
    • Greater Blessing: base `500 * priceFactor` gold — applies `RPD.Buffs.Blessed` for 500 turns, then again for 500 turns
    • Remove Curse: base `200 * priceFactor` gold — uses `ScrollOfRemoveCurse:uncurse()` on the client's belongings and emits `ShadowParticle.UP`
  • Failure path: any service that the client cannot afford causes the NPC to say `Bishop_no_money`; choosing “not interestedâ€� makes the NPC say `Bishop_bye`
mr/bishop_npc.txt · Last modified: by 127.0.0.1