opening magic vs holding monster

Zapping wand of opening or spell of knock at engulfer while swallowed
would make the engulfer expel the hero; this change makes zapping
other holders release their hold.  Zapping self now achieves the same
effect, as does breaking a non-empty wand of opening.  When poly'd
hero is holding a monster rather than being held, that monster will
be released.

Engulfers can't re-engulf for 1 or 2 turns after releasing the hero
in order to prevent hero from being immediately re-engulfed.  Impose
the same limitation on other holders.
This commit is contained in:
PatR
2021-04-13 13:51:57 -07:00
parent 8bd08ebb71
commit 5d6ab55372
7 changed files with 88 additions and 21 deletions

View File

@@ -3480,12 +3480,19 @@ do_break_wand(struct obj *obj)
affects_objects = FALSE;
switch (obj->otyp) {
case WAN_OPENING:
if (u.ustuck) {
release_hold();
if (obj->dknown)
makeknown(WAN_OPENING);
goto discard_broken_wand;
}
/*FALLTHRU*/
case WAN_WISHING:
case WAN_NOTHING:
case WAN_LOCKING:
case WAN_PROBING:
case WAN_ENLIGHTENMENT:
case WAN_OPENING:
case WAN_SECRET_DOOR_DETECTION:
pline(nothing_else_happens);
goto discard_broken_wand;
@@ -3502,7 +3509,7 @@ do_break_wand(struct obj *obj)
dmg *= 2;
/*FALLTHRU*/
case WAN_MAGIC_MISSILE:
wanexpl:
wanexpl:
explode(u.ux, u.uy, -(obj->otyp), dmg, WAND_CLASS, expltype);
makeknown(obj->otyp); /* explode describes the effect */
goto discard_broken_wand;
@@ -3633,7 +3640,7 @@ do_break_wand(struct obj *obj)
if (obj->otyp == WAN_LIGHT)
litroom(TRUE, obj); /* only needs to be done once */
discard_broken_wand:
discard_broken_wand:
obj = g.current_wand; /* [see dozap() and destroy_item()] */
g.current_wand = 0;
if (obj)