Skip to content

Commit

Permalink
Fix: Yeenoghu wand of wishing weirdnesses
Browse files Browse the repository at this point in the history
Yeenoghu was the only archfiend who carried a wand of wishing upon
generation rather than having the wand somewhere on his level. The
consequence of this was that if he were summoned early by another
archfiend or by same-race sacrifice, he wouldn't have that wand (because
the wand was only given to him when he generated in his level in Lua)
and loading his level would not generate him.

There was probably a way around this by checking to see if a monster
indeed existed at his space after creating him, or making des.monster()
capable of returning a value if the monster were actually created, but
the simpler fix for right now was to put a chest which is always on his
level, which maybe contains the wand and maybe doesn't, like all the
other archfiends.

Also, there was still a debug pline left in the lua file which printed
when Yeenoghu generated with a wand, so removed that.
  • Loading branch information
copperwater committed Apr 20, 2024
1 parent 8ba4fd0 commit 91d5281
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
20 changes: 10 additions & 10 deletions dat/yeenoghu.lua
Original file line number Diff line number Diff line change
Expand Up @@ -45,19 +45,19 @@ local Yx = 63 + nh.rn2(8)
local Yy = 6 + nh.rn2(6)
des.monster({ id='Yeenoghu', coord={Yx,Yy}, waiting=1, inventory=function()
des.object({ id='flail', spe=9, name='Butcher', material='iron', eroded=1 })
-- the sack is necessary to prevent players from using object detection to
-- figure out if he has a wand or not
des.object({ id='sack', contents=function()
if nh.is_wish_dlord('Yeenoghu') then
nh.pline('got a wish')
des.object({ class='/', id='wishing', spe=1 })
else
des.object({ class='/', id='magic missile' })
end
end })
-- he is specially coded not to flee or retreat so compensate for this
des.object({ class='!', id='full healing', quan=2 })
end })
des.object({ id='chest', locked=true, coord={Yx,Yy}, buried=true, material='iron',
contents=function()
if nh.is_wish_dlord('Yeenoghu') then
des.object({ class='/', id='wishing', spe=1 })
else
des.object({ class='/', id='magic missile' })
des.object({ class='?', id='enchant weapon' })
des.object({ class='?', id='enchant weapon' })
end
end })

-- Corpses... a lot of corpses
for i = 1, 100 do
Expand Down
2 changes: 2 additions & 0 deletions doc/xnh-changelog-9.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ changes:
- Orcs, barbarians, and cavemen have a Wisdom-dependent chance of avoiding the
urge to take a bath in a fountain.
- Scrolls of earth work again in all levels besides the non-Earth Planes.
- Yeenoghu no longer carries a wand of wishing; instead there is a buried chest
on his level that may contain it.

### Interface changes

Expand Down

0 comments on commit 91d5281

Please sign in to comment.