Skip to content

Commit dbb2863

Browse files
committed
Fix: double Bell of Opening in Val and Arc quests
This is the result of the fix in 2d4f989 that makes a nemesis who's about to receive lua-specified inventory drop any special items they may have already received. In the commit note there I even noted two Bells could generate if a level developer specified the nemesis gets the Bell and fails to specify keep_default_invent = true, but also noted that "two Bells is better than none", which it is - the player who reported this wasn't facing an unwinnable situation. Specifying keep_default_invent = true as I did here was not necessary to fix the two-Bells issue, but does address another problem: that the default behavior when keep_default_invent is false is to *drop* special items, meaning the nemesis would either abandon the Bell on the floor or waste turns warping back to pick it up once they moved off. I considered doing a more comprehensive fix that would keep the special items in the nemesis's inventory, but decided not to since it would duplicate code from mdrop_special_objs.
1 parent fc80a50 commit dbb2863

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

dat/Arc-goal.lua

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,10 @@ des.monster({ id="Schliemann", x=53, y=09, inventory = function()
9090
-- nethack doesn't have explosives; this is the closest substitute...
9191
des.object({ id="oil", cursed=0, quantity=7+d(5) })
9292
des.object({ id="shield of reflection",buc="blessed",material="gold",spe=1,name="Itlachiayaque" })
93-
des.object({ id="Bell of Opening", buc="uncursed" })
94-
end })
93+
-- bell of opening has hardcoded safeguards so specifying it here would
94+
-- result in two bells; specify keep_default_invent=true so he is carrying it
95+
-- rather than has dropped it
96+
end, keep_default_invent = true })
9597

9698
-- His crew of archeologists
9799
function henchman_inventory()

dat/Val-goal.lua

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,10 @@ end
9696
des.monster({ id='Lord Surtur', x=66, y=13, waiting=true, inventory=function()
9797
des.object({ id='two-handed sword', name='Sol Valtiva' })
9898
des.object({ class='/', id='fire', buc='not-cursed' })
99-
des.object({ id='Bell of Opening', buc='uncursed' })
100-
end })
99+
-- bell of opening has hardcoded safeguards so specifying it here would
100+
-- result in two bells; specify keep_default_invent=true so he is carrying it
101+
-- rather than has dropped it
102+
end, keep_default_invent = true })
101103

102104
-- Other monsters
103105
for i = 1, 6 + d(4) do

0 commit comments

Comments
 (0)