====== Bishop NPC - Code References ====== ===== Java Classes ===== This entity is implemented in Lua/JSON, no Java class exists. See: * [[https://github.com/NYRDS/remixed-dungeon/blob/master/RemixedDungeon/src/main/assets/mobsDesc/BishopNPC.json|BishopNPC.json]] (mob config) * [[https://github.com/NYRDS/remixed-dungeon/blob/master/RemixedDungeon/src/main/assets/scripts/npc/Bishop.lua|Bishop.lua]] (NPC behavior) * [[https://github.com/NYRDS/remixed-dungeon/blob/master/RemixedDungeon/src/main/assets/spritesDesc/BishopNPC.json|BishopNPC spriteDesc.json]] (sprite) ===== 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`, 16x18, 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 ===== * [[https://github.com/NYRDS/remixed-dungeon/blob/master/RemixedDungeon/src/main/assets/levelsDesc/Church.json|Church.json]] — level placement (`"kind": "BishopNPC"`) * [[https://github.com/NYRDS/remixed-dungeon/blob/master/RemixedDungeon/src/main/assets/levelsDesc/Church_2021_03.json|Church_2021_03.json]] — alternative level placement * [[https://github.com/NYRDS/remixed-dungeon/blob/master/RemixedDungeon/src/main/assets/levelsDesc/TownChurch.json|TownChurch.json]] — additional church variant ===== String Resources ===== Bishop Bishop masculine Bishop of the Holy Church of Santa the Depth Lord Bishop Days and nights I pray for you my child. Lesser bless - %d g Great bless - %d g Remove curse - %d g Leave You can\'t pay for it. I will pray for you my child. * `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 ===== * [[https://github.com/NYRDS/remixed-dungeon/blob/master/RemixedDungeon/src/main/assets/scripts/npc/Bishop.lua|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`