attack/damage by trapper and lurker above

Change trappers and lurkers above to remove digestion damage.  They
fold themselves around rather than swallow the victim.  There were
are lot of places that assumed that an engulfer which is an animal
would swallow and digest the victim.  In hindsight, it might have
been simpler to take the M1_ANIMAL flag off of trappers and lurkers
above.

This adds a new digests() predicate for creatures with AT_ENGL+AD_DGST
(purple worm) and also enfolds() for AT_ENGL+AD_WRAP (both 't'-class
critters).

There are several minor fixes mixed in with this.  I didn't record
them as I went along but the two I remember are
1) if poly'd into a holder and holding on to a monster, the '<' and
   '>' commands refursed to work; release the held creature first
   and then treat those commands as normal;
2) throwing a non-weapon while engulfed by an ochre jelly reported
   "the <item> vanishes into the ochre jelly's /currents/".

This needs a lot more testing.  I found and fixed multiple minor
details before my own testing burned out.
This commit is contained in:
PatR
2022-08-15 04:14:36 -07:00
parent d0b11fd2c0
commit b07fe59b3c
25 changed files with 179 additions and 100 deletions
+6
View File
@@ -1001,6 +1001,12 @@ blind hero was notified when brass lantern burned out even though it isn't
on or off can be determined that way so still gives on/off message on or off can be determined that way so still gives on/off message
turn on statushilites automatically if any are defined turn on statushilites automatically if any are defined
change poison instakill to damage with attribute and max hp loss change poison instakill to damage with attribute and max hp loss
trappers and lurkers above enfold themselves around and crush their victims,
not swallow and digest
attempting to move up or down when poly'd into a holder and holding a monster
rejected the move; release the monster instead
thowing a non-weapon while engulfed by an ochre jelly reported that the item
vanished into the jelly's "currents"
Fixes to 3.7.0-x Problems that Were Exposed Via git Repository Fixes to 3.7.0-x Problems that Were Exposed Via git Repository
+2
View File
@@ -86,6 +86,8 @@
#define is_wooden(ptr) ((ptr) == &mons[PM_WOOD_GOLEM]) #define is_wooden(ptr) ((ptr) == &mons[PM_WOOD_GOLEM])
#define thick_skinned(ptr) (((ptr)->mflags1 & M1_THICK_HIDE) != 0L) #define thick_skinned(ptr) (((ptr)->mflags1 & M1_THICK_HIDE) != 0L)
#define hug_throttles(ptr) ((ptr) == &mons[PM_ROPE_GOLEM]) #define hug_throttles(ptr) ((ptr) == &mons[PM_ROPE_GOLEM])
#define digests(ptr) dmgtype_fromattack((ptr), AD_DGST, AT_ENGL) /* purple w*/
#define enfolds(ptr) dmgtype_fromattack((ptr), AD_WRAP, AT_ENGL) /* 't' */
#define slimeproof(ptr) \ #define slimeproof(ptr) \
((ptr) == &mons[PM_GREEN_SLIME] || flaming(ptr) || noncorporeal(ptr)) ((ptr) == &mons[PM_GREEN_SLIME] || flaming(ptr) || noncorporeal(ptr))
#define lays_eggs(ptr) (((ptr)->mflags1 & M1_OVIPAROUS) != 0L) #define lays_eggs(ptr) (((ptr)->mflags1 & M1_OVIPAROUS) != 0L)
+14 -8
View File
@@ -821,17 +821,22 @@
M2_HOSTILE, 0, 8, CLR_RED, SCORPION), M2_HOSTILE, 0, 8, CLR_RED, SCORPION),
/* /*
* trappers, lurkers, &c * trappers, lurkers, &c
* Note: prior to 3.7, these were defined to do AD_DGST damage,
* but they don't swallow their victims into their stomachs and
* digest, they enfold and crush or suffocate.
* The Monster Manual states that someone engulfed by a trapper
* can't use weapons but we do not enforce that.
*/ */
MON("lurker above", S_TRAPPER, LVL(10, 3, 3, 0, 0), (G_GENO | 2), MON("lurker above", S_TRAPPER, LVL(10, 3, 3, 0, 0), (G_GENO | 2),
A(ATTK(AT_ENGL, AD_DGST, 1, 8), NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK, A(ATTK(AT_ENGL, AD_WRAP, 1, 6), ATTK(AT_ENGL, AD_PHYS, 2, 6),
NO_ATTK), NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK),
SIZ(800, 350, MS_SILENT, MZ_HUGE), 0, 0, SIZ(800, 350, MS_SILENT, MZ_HUGE), 0, 0,
M1_HIDE | M1_FLY | M1_ANIMAL | M1_NOEYES | M1_NOLIMBS | M1_NOHEAD M1_HIDE | M1_FLY | M1_ANIMAL | M1_NOEYES | M1_NOLIMBS | M1_NOHEAD
| M1_CARNIVORE, | M1_CARNIVORE,
M2_HOSTILE | M2_STALK | M2_STRONG, 0, 12, CLR_GRAY, LURKER_ABOVE), M2_HOSTILE | M2_STALK | M2_STRONG, 0, 12, CLR_GRAY, LURKER_ABOVE),
MON("trapper", S_TRAPPER, LVL(12, 3, 3, 0, 0), (G_GENO | 2), MON("trapper", S_TRAPPER, LVL(12, 3, 3, 0, 0), (G_GENO | 2),
A(ATTK(AT_ENGL, AD_DGST, 1, 10), NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK, A(ATTK(AT_ENGL, AD_WRAP, 1, 8), ATTK(AT_ENGL, AD_PHYS, 2, 8),
NO_ATTK), NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK),
SIZ(800, 350, MS_SILENT, MZ_HUGE), 0, 0, SIZ(800, 350, MS_SILENT, MZ_HUGE), 0, 0,
M1_HIDE | M1_ANIMAL | M1_NOEYES | M1_NOLIMBS | M1_NOHEAD M1_HIDE | M1_ANIMAL | M1_NOEYES | M1_NOLIMBS | M1_NOHEAD
| M1_CARNIVORE, | M1_CARNIVORE,
@@ -882,15 +887,16 @@
* vortices * vortices
*/ */
MON("fog cloud", S_VORTEX, LVL(3, 1, 0, 0, 0), (G_GENO | G_NOCORPSE | 2), MON("fog cloud", S_VORTEX, LVL(3, 1, 0, 0, 0), (G_GENO | G_NOCORPSE | 2),
A(ATTK(AT_ENGL, AD_PHYS, 1, 6), NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK, A(ATTK(AT_ENGL, AD_PHYS, 1, 6),
NO_ATTK), NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK),
SIZ(0, 0, MS_SILENT, MZ_HUGE), MR_SLEEP | MR_POISON | MR_STONE, 0, SIZ(0, 0, MS_SILENT, MZ_HUGE), MR_SLEEP | MR_POISON | MR_STONE, 0,
M1_FLY | M1_BREATHLESS | M1_NOEYES | M1_NOLIMBS | M1_NOHEAD M1_FLY | M1_BREATHLESS | M1_NOEYES | M1_NOLIMBS | M1_NOHEAD
| M1_MINDLESS | M1_AMORPHOUS | M1_UNSOLID, | M1_MINDLESS | M1_AMORPHOUS | M1_UNSOLID,
M2_HOSTILE | M2_NEUTER, 0, 4, CLR_GRAY, FOG_CLOUD), M2_HOSTILE | M2_NEUTER, 0, 4, CLR_GRAY, FOG_CLOUD),
MON("dust vortex", S_VORTEX, LVL(4, 20, 2, 30, 0), MON("dust vortex", S_VORTEX, LVL(4, 20, 2, 30, 0),
(G_GENO | G_NOCORPSE | 2), A(ATTK(AT_ENGL, AD_BLND, 2, 8), NO_ATTK, (G_GENO | G_NOCORPSE | 2),
NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK), A(ATTK(AT_ENGL, AD_BLND, 2, 8),
NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK, NO_ATTK),
SIZ(0, 0, MS_SILENT, MZ_HUGE), MR_SLEEP | MR_POISON | MR_STONE, 0, SIZ(0, 0, MS_SILENT, MZ_HUGE), MR_SLEEP | MR_POISON | MR_STONE, 0,
M1_FLY | M1_BREATHLESS | M1_NOEYES | M1_NOLIMBS | M1_NOHEAD M1_FLY | M1_BREATHLESS | M1_NOEYES | M1_NOLIMBS | M1_NOHEAD
| M1_MINDLESS, | M1_MINDLESS,
+1 -2
View File
@@ -2722,8 +2722,7 @@ use_trap(struct obj *otmp)
else if (Stunned) else if (Stunned)
what = "while stunned"; what = "while stunned";
else if (u.uswallow) else if (u.uswallow)
what = what = digests(u.ustuck->data) ? "while swallowed" : "while engulfed";
is_animal(u.ustuck->data) ? "while swallowed" : "while engulfed";
else if (Underwater) else if (Underwater)
what = "underwater"; what = "underwater";
else if (Levitation) else if (Levitation)
+7 -1
View File
@@ -1676,11 +1676,17 @@ openit(void)
int num = 0; int num = 0;
if (u.uswallow) { if (u.uswallow) {
if (is_animal(u.ustuck->data)) { if (digests(u.ustuck->data)) {
/* purple worm */
if (Blind) if (Blind)
pline("Its mouth opens!"); pline("Its mouth opens!");
else else
pline("%s opens its mouth!", Monnam(u.ustuck)); pline("%s opens its mouth!", Monnam(u.ustuck));
#if 0 /* expels() will take care of this */
} else if (enfolds(u.ustuck->data)) {
/* trapper or lurker above */
pline("%s unfolds!", Monnam(u.ustuck));
#endif
} }
expels(u.ustuck, u.ustuck->data, TRUE); expels(u.ustuck, u.ustuck->data, TRUE);
return -1; return -1;
+2 -2
View File
@@ -1411,14 +1411,14 @@ zap_dig(void)
mtmp = u.ustuck; mtmp = u.ustuck;
if (!is_whirly(mtmp->data)) { if (!is_whirly(mtmp->data)) {
if (is_animal(mtmp->data)) if (digests(mtmp->data))
You("pierce %s %s wall!", s_suffix(mon_nam(mtmp)), You("pierce %s %s wall!", s_suffix(mon_nam(mtmp)),
mbodypart(mtmp, STOMACH)); mbodypart(mtmp, STOMACH));
if (unique_corpstat(mtmp->data)) if (unique_corpstat(mtmp->data))
mtmp->mhp = (mtmp->mhp + 1) / 2; mtmp->mhp = (mtmp->mhp + 1) / 2;
else else
mtmp->mhp = 1; /* almost dead */ mtmp->mhp = 1; /* almost dead */
expels(mtmp, mtmp->data, !is_animal(mtmp->data)); expels(mtmp, mtmp->data, !digests(mtmp->data));
} }
return; return;
} /* swallowed */ } /* swallowed */
+29 -10
View File
@@ -647,13 +647,18 @@ drop(struct obj *obj)
if (u.uswallow) { if (u.uswallow) {
/* barrier between you and the floor */ /* barrier between you and the floor */
if (Verbose(0, drop1)) { if (Verbose(0, drop1)) {
char *onam_p, monbuf[BUFSZ]; char *onam_p, *mnam_p, monbuf[BUFSZ];
mnam_p = mon_nam(u.ustuck);
/* doname can call s_suffix, reusing its buffer */ /* doname can call s_suffix, reusing its buffer */
Strcpy(monbuf, s_suffix(mon_nam(u.ustuck))); if (digests(u.ustuck->data)) {
onam_p = is_unpaid(obj) ? yobjnam(obj, (char *) 0) : doname(obj); Sprintf(monbuf, "%s %s", s_suffix(mnam_p),
You("drop %s into %s %s.", onam_p, monbuf,
mbodypart(u.ustuck, STOMACH)); mbodypart(u.ustuck, STOMACH));
mnam_p = monbuf;
}
onam_p = is_unpaid(obj) ? yobjnam(obj, (char *) 0) : doname(obj);
You("drop %s into %s.", onam_p, mnam_p);
} }
} else { } else {
if ((obj->oclass == RING_CLASS || obj->otyp == MEAT_RING) if ((obj->oclass == RING_CLASS || obj->otyp == MEAT_RING)
@@ -752,9 +757,9 @@ dropz(struct obj *obj, boolean with_impact)
static boolean static boolean
engulfer_digests_food(struct obj *obj) engulfer_digests_food(struct obj *obj)
{ {
/* animal swallower (purple worn, trapper, lurker above) eats any /* animal swallower (purple worn) eats any
corpse, glob, or meat <item> but not other types of food */ corpse, glob, or meat <item> but not other types of food */
if (is_animal(u.ustuck->data) if (digests(u.ustuck->data)
&& (obj->otyp == CORPSE || obj->globby && (obj->otyp == CORPSE || obj->globby
|| obj->otyp == MEATBALL || obj->otyp == HUGE_CHUNK_OF_MEAT || obj->otyp == MEATBALL || obj->otyp == HUGE_CHUNK_OF_MEAT
|| obj->otyp == MEAT_RING || obj->otyp == MEAT_STICK)) { || obj->otyp == MEAT_RING || obj->otyp == MEAT_STICK)) {
@@ -1070,11 +1075,18 @@ dodown(void)
} }
if (u.ustuck) { if (u.ustuck) {
if (u.uswallow || !sticks(g.youmonst.data)) {
You("are %s, and cannot go down.", You("are %s, and cannot go down.",
!u.uswallow ? "being held" : is_animal(u.ustuck->data) !u.uswallow ? "being held"
? "swallowed" : digests(u.ustuck->data) ? "swallowed"
: "engulfed"); : "engulfed");
return ECMD_TIME; return ECMD_TIME;
} else {
struct monst *mtmp = u.ustuck;
set_ustuck((struct monst *) 0);
You("release %s.", mon_nam(mtmp));
}
} }
if (!stairs_down && !ladder_down) { if (!stairs_down && !ladder_down) {
@@ -1168,11 +1180,18 @@ doup(void)
return ECMD_OK; return ECMD_OK;
} }
if (u.ustuck) { if (u.ustuck) {
if (u.uswallow || !sticks(g.youmonst.data)) {
You("are %s, and cannot go up.", You("are %s, and cannot go up.",
!u.uswallow ? "being held" : is_animal(u.ustuck->data) !u.uswallow ? "being held"
? "swallowed" : digests(u.ustuck->data) ? "swallowed"
: "engulfed"); : "engulfed");
return ECMD_TIME; return ECMD_TIME;
} else {
struct monst *mtmp = u.ustuck;
set_ustuck((struct monst *) 0);
You("release %s.", mon_nam(mtmp));
}
} }
if (near_capacity() > SLT_ENCUMBER) { if (near_capacity() > SLT_ENCUMBER) {
/* No levitation check; inv_weight() already allows for it */ /* No levitation check; inv_weight() already allows for it */
+1 -1
View File
@@ -933,7 +933,7 @@ dokick(void)
You_cant("move your %s!", body_part(LEG)); You_cant("move your %s!", body_part(LEG));
break; break;
case 1: case 1:
if (is_animal(u.ustuck->data)) { if (digests(u.ustuck->data)) {
pline("%s burps loudly.", Monnam(u.ustuck)); pline("%s burps loudly.", Monnam(u.ustuck));
break; break;
} }
+16 -8
View File
@@ -2068,10 +2068,14 @@ thitmonst(
mon->mstrategy &= ~STRAT_WAITMASK; mon->mstrategy &= ~STRAT_WAITMASK;
} }
} else if (guaranteed_hit) { } else if (guaranteed_hit) {
char trail[BUFSZ];
char *monname;
struct permonst *md = u.ustuck->data;
/* this assumes that guaranteed_hit is due to swallowing */ /* this assumes that guaranteed_hit is due to swallowing */
wakeup(mon, TRUE); wakeup(mon, TRUE);
if (obj->otyp == CORPSE && touch_petrifies(&mons[obj->corpsenm])) { if (obj->otyp == CORPSE && touch_petrifies(&mons[obj->corpsenm])) {
if (is_animal(u.ustuck->data)) { if (is_animal(md)) {
minstapetrify(u.ustuck, TRUE); minstapetrify(u.ustuck, TRUE);
/* Don't leave a cockatrice corpse available in a statue */ /* Don't leave a cockatrice corpse available in a statue */
if (!u.uswallow) { if (!u.uswallow) {
@@ -2080,9 +2084,12 @@ thitmonst(
} }
} }
} }
pline("%s into %s %s.", Tobjnam(obj, "vanish"), Strcpy(trail,
s_suffix(mon_nam(mon)), digests(md) ? " entrails" : is_whirly(md) ? " currents" : "");
is_animal(u.ustuck->data) ? "entrails" : "currents"); monname = mon_nam(mon);
if (*trail)
monname = s_suffix(monname);
pline("%s into %s%s.", Tobjnam(obj, "vanish"), monname, trail);
} else { } else {
tmiss(obj, mon, TRUE); tmiss(obj, mon, TRUE);
} }
@@ -2429,10 +2436,11 @@ throw_gold(struct obj *obj)
freeinv(obj); freeinv(obj);
if (u.uswallow) { if (u.uswallow) {
const char *swallower = mon_nam(u.ustuck); const char *swallower = mon_nam(u.ustuck);
if (is_animal(u.ustuck->data))
swallower = s_suffix(swallower); if (digests(u.ustuck->data))
pline_The("gold disappears into %s%s.", swallower, /* note: s_suffix() returns a modifiable buffer */
is_animal(u.ustuck->data) ? " entrails" : ""); swallower = strcat(s_suffix(swallower), " entrails");
pline_The("gold disappears into %s.", swallower);
add_to_minv(u.ustuck, obj); add_to_minv(u.ustuck, obj);
return ECMD_TIME; return ECMD_TIME;
} }
+6 -1
View File
@@ -192,7 +192,10 @@ surface(coordxy x, coordxy y)
struct rm *lev = &levl[x][y]; struct rm *lev = &levl[x][y];
if (u_at(x, y) && u.uswallow && is_animal(u.ustuck->data)) if (u_at(x, y) && u.uswallow && is_animal(u.ustuck->data))
return "maw"; /* 'husk' is iffy but maw is wrong for 't' class */
return digests(u.ustuck->data) ? "maw"
: enfolds(u.ustuck->data) ? "husk"
: "nonesuch"; /* can't happen (fingers crossed...) */
else if (IS_AIR(lev->typ) && Is_airlevel(&u.uz)) else if (IS_AIR(lev->typ) && Is_airlevel(&u.uz))
return "air"; return "air";
else if (is_pool(x, y)) else if (is_pool(x, y))
@@ -461,6 +464,8 @@ u_can_engrave(void)
cant_reach_floor(u.ux, u.uy, FALSE, FALSE); cant_reach_floor(u.ux, u.uy, FALSE, FALSE);
return FALSE; return FALSE;
} }
/* Note: for amorphous engulfers, writing attempt is allowed here
but yields the 'jello' result in doengrave() */
} else if (is_lava(u.ux, u.uy)) { } else if (is_lava(u.ux, u.uy)) {
You_cant("write on the %s!", surface(u.ux, u.uy)); You_cant("write on the %s!", surface(u.ux, u.uy));
return FALSE; return FALSE;
+1 -1
View File
@@ -372,7 +372,7 @@ explode(
if (engulfing_u(mtmp)) { if (engulfing_u(mtmp)) {
const char *adj = (char *) 0; const char *adj = (char *) 0;
if (is_animal(u.ustuck->data)) { if (digests(u.ustuck->data)) {
switch (adtyp) { switch (adtyp) {
case AD_FIRE: case AD_FIRE:
adj = "heartburn"; adj = "heartburn";
+1 -1
View File
@@ -3204,7 +3204,7 @@ pickup_checks(void)
/* uswallow case added by GAN 01/29/87 */ /* uswallow case added by GAN 01/29/87 */
if (u.uswallow) { if (u.uswallow) {
if (!u.ustuck->minvent) { if (!u.ustuck->minvent) {
if (is_animal(u.ustuck->data)) { if (digests(u.ustuck->data)) {
You("pick up %s tongue.", s_suffix(mon_nam(u.ustuck))); You("pick up %s tongue.", s_suffix(mon_nam(u.ustuck)));
pline("But it's kind of slimy, so you drop it."); pline("But it's kind of slimy, so you drop it.");
} else } else
+20 -7
View File
@@ -1036,7 +1036,7 @@ status_enlightenment(int mode, int final)
} }
if (u.uswallow) { /* implies u.ustuck is non-Null */ if (u.uswallow) { /* implies u.ustuck is non-Null */
Snprintf(buf, sizeof buf, "%s by %s", Snprintf(buf, sizeof buf, "%s by %s",
is_animal(u.ustuck->data) ? "swallowed" : "engulfed", digests(u.ustuck->data) ? "swallowed" : "engulfed",
heldmon); heldmon);
if (dmgtype(u.ustuck->data, AD_DGST)) { if (dmgtype(u.ustuck->data, AD_DGST)) {
/* if final, death via digestion can be deduced by u.uswallow /* if final, death via digestion can be deduced by u.uswallow
@@ -3023,13 +3023,26 @@ mstatusline(struct monst *mtmp)
: ", [? speed]"); : ", [? speed]");
if (mtmp->minvis) if (mtmp->minvis)
Strcat(info, ", invisible"); Strcat(info, ", invisible");
if (mtmp == u.ustuck) if (mtmp == u.ustuck) {
Strcat(info, sticks(g.youmonst.data) ? ", held by you" struct permonst *pm = u.ustuck->data;
: !u.uswallow ? ", holding you"
: attacktype_fordmg(u.ustuck->data, AT_ENGL, AD_DGST) /* being swallowed/engulfed takes priority over sticks(youmonst);
this used to have that backwards and checked sticks() first */
Strcat(info, u.uswallow ? (digests(pm)
? ", digesting you" ? ", digesting you"
: is_animal(u.ustuck->data) ? ", swallowing you" /* note: the "swallowing you" case won't
: ", engulfing you"); happen because all animal engulfers
either digest their victims (purple
worm) or enfold them (trappers and
lurkers above) */
: (is_animal(pm) && !enfolds(pm))
? ", swallowing you"
: ", engulfing you")
/* !u.uswallow; if both youmonst and ustuck are holders,
youmonst wins */
: (!sticks(g.youmonst.data) ? ", holding you"
: ", held by you"));
}
if (mtmp == u.usteed) { if (mtmp == u.usteed) {
Strcat(info, ", carrying you"); Strcat(info, ", carrying you");
if (Wounded_legs) { if (Wounded_legs) {
+2 -1
View File
@@ -766,7 +766,8 @@ gulpmm(
/* [this two-part formatting dates back to when only one x_monnam /* [this two-part formatting dates back to when only one x_monnam
result could be included in an expression because the next one result could be included in an expression because the next one
would overwrite first's result -- that's no longer the case] */ would overwrite first's result -- that's no longer the case] */
Sprintf(buf, "%s swallows", Monnam(magr)); Sprintf(buf, "%s %s", Monnam(magr),
digests(magr->data) ? "swallows" : "engulfs");
pline("%s %s.", buf, mon_nam(mdef)); pline("%s %s.", buf, mon_nam(mdef));
} }
if (!flaming(magr->data)) { if (!flaming(magr->data)) {
+25 -12
View File
@@ -232,14 +232,17 @@ wildmiss(struct monst *mtmp, struct attack *mattk)
} }
void void
expels(struct monst *mtmp, expels(
struct monst *mtmp,
struct permonst *mdat, /* if mtmp is polymorphed, mdat != mtmp->data */ struct permonst *mdat, /* if mtmp is polymorphed, mdat != mtmp->data */
boolean message) boolean message)
{ {
g.context.botl = 1; g.context.botl = 1;
if (message) { if (message) {
if (is_animal(mdat)) { if (digests(mdat)) {
You("get regurgitated!"); You("get regurgitated!");
} else if (enfolds(mdat)) {
pline("%s unfolds and you are released!", Monnam(mtmp));
} else { } else {
char blast[40]; char blast[40];
struct attack *attk = attacktype_fordmg(mdat, AT_ENGL, AD_ANY); struct attack *attk = attacktype_fordmg(mdat, AT_ENGL, AD_ANY);
@@ -717,7 +720,7 @@ mattacku(register struct monst *mtmp)
} else { } else {
missmu(mtmp, (tmp == j), mattk); missmu(mtmp, (tmp == j), mattk);
} }
} else if (is_animal(mtmp->data)) { } else if (digests(mtmp->data)) {
pline("%s gulps some air!", Monnam(mtmp)); pline("%s gulps some air!", Monnam(mtmp));
} else { } else {
if (youseeit) if (youseeit)
@@ -897,8 +900,13 @@ diseasemu(struct permonst *mdat)
boolean boolean
u_slip_free(struct monst *mtmp, struct attack *mattk) u_slip_free(struct monst *mtmp, struct attack *mattk)
{ {
struct obj *obj = (uarmc ? uarmc : uarm); struct obj *obj;
/* greased armor does not protect against AT_ENGL+AD_WRAP */
if (mattk->aatyp == AT_ENGL)
return FALSE;
obj = (uarmc ? uarmc : uarm);
if (!obj) if (!obj)
obj = uarmu; obj = uarmu;
if (mattk->adtyp == AD_DRIN) if (mattk->adtyp == AD_DRIN)
@@ -1165,7 +1173,7 @@ gulpmu(struct monst *mtmp, struct attack *mattk)
dismount_steed(DISMOUNT_ENGULFED); dismount_steed(DISMOUNT_ENGULFED);
} else { } else {
urgent_pline("%s %s!", Monnam(mtmp), urgent_pline("%s %s!", Monnam(mtmp),
is_animal(mtmp->data) ? "swallows you whole" digests(mtmp->data) ? "swallows you whole"
: "engulfs you"); : "engulfs you");
} }
stop_occupation(); stop_occupation();
@@ -1278,7 +1286,8 @@ gulpmu(struct monst *mtmp, struct attack *mattk)
if (Amphibious && !flaming(g.youmonst.data)) if (Amphibious && !flaming(g.youmonst.data))
tmp = 0; tmp = 0;
} else { } else {
You("are pummeled with debris!"); You("are %s!", enfolds(mtmp->data) ? "being squashed"
: "pummeled with debris");
exercise(A_STR, FALSE); exercise(A_STR, FALSE);
} }
break; break;
@@ -1378,17 +1387,20 @@ gulpmu(struct monst *mtmp, struct attack *mattk)
; /* life-saving has already expelled swallowed hero */ ; /* life-saving has already expelled swallowed hero */
} else if (touch_petrifies(g.youmonst.data) && !resists_ston(mtmp)) { } else if (touch_petrifies(g.youmonst.data) && !resists_ston(mtmp)) {
pline("%s very hurriedly %s you!", Monnam(mtmp), pline("%s very hurriedly %s you!", Monnam(mtmp),
is_animal(mtmp->data) ? "regurgitates" : "expels"); digests(mtmp->data) ? "regurgitates"
: enfolds(mtmp->data) ? "releases"
: "expels");
expels(mtmp, mtmp->data, FALSE); expels(mtmp, mtmp->data, FALSE);
} else if (!u.uswldtim || g.youmonst.data->msize >= MZ_HUGE) { } else if (!u.uswldtim || g.youmonst.data->msize >= MZ_HUGE) {
/* As of 3.6.2: u.uswldtim used to be set to 0 by life-saving but it /* As of 3.6.2: u.uswldtim used to be set to 0 by life-saving but it
expels now so the !u.uswldtim case is no longer possible; expels now so the !u.uswldtim case is no longer possible;
however, polymorphing into a huge form while already however, polymorphing into a huge form while already
swallowed is still possible */ swallowed is still possible */
You("get %s!", is_animal(mtmp->data) ? "regurgitated" : "expelled"); You("get %s!", digests(mtmp->data) ? "regurgitated"
: enfolds(mtmp->data) ? "released"
: "expelled");
if (Verbose(1, gulpmu) if (Verbose(1, gulpmu)
&& (is_animal(mtmp->data) && (digests(mtmp->data) && Slow_digestion))
|| (dmgtype(mtmp->data, AD_DGST) && Slow_digestion)))
pline("Obviously %s doesn't like your taste.", mon_nam(mtmp)); pline("Obviously %s doesn't like your taste.", mon_nam(mtmp));
expels(mtmp, mtmp->data, FALSE); expels(mtmp, mtmp->data, FALSE);
} }
@@ -1712,8 +1724,9 @@ mdamageu(struct monst *mtmp, int n)
* 2 if wrong gender for nymph * 2 if wrong gender for nymph
*/ */
int int
could_seduce(struct monst *magr, struct monst *mdef, could_seduce(
struct attack *mattk) /* non-Null: current attack; Null: general capability */ struct monst *magr, struct monst *mdef,
struct attack *mattk) /* non-Null: current atk; Null: general capability */
{ {
struct permonst *pagr; struct permonst *pagr;
boolean agrinvis, defperc; boolean agrinvis, defperc;
+4 -4
View File
@@ -2893,13 +2893,13 @@ monstone(struct monst* mdef)
unmap_object(x, y); unmap_object(x, y);
if (cansee(x, y)) if (cansee(x, y))
newsym(x, y); newsym(x, y);
/* We don't currently trap the hero in the statue in this case but we /* we don't currently trap the hero in the statue in this case but we
* could */ could */
if (engulfing_u(mdef)) if (engulfing_u(mdef))
wasinside = TRUE; wasinside = TRUE;
mondead(mdef); mondead(mdef);
if (wasinside) { if (wasinside) {
if (is_animal(mdef->data)) if (digests(mdef->data))
You("%s through an opening in the new %s.", You("%s through an opening in the new %s.",
u_locomotion("jump"), xname(otmp)); u_locomotion("jump"), xname(otmp));
} }
@@ -4675,7 +4675,7 @@ newcham(
if (is_vampshifter(mtmp)) { if (is_vampshifter(mtmp)) {
Sprintf(msgtrail, " which was a shapeshifted %s", Sprintf(msgtrail, " which was a shapeshifted %s",
noname_monnam(mtmp, ARTICLE_NONE)); noname_monnam(mtmp, ARTICLE_NONE));
} else if (is_animal(mdat)) { } else if (digests(mdat)) {
Strcpy(msgtrail, "'s stomach"); Strcpy(msgtrail, "'s stomach");
} else { } else {
msgtrail[0] = '\0'; msgtrail[0] = '\0';
+2 -1
View File
@@ -456,7 +456,8 @@ breakarm(register struct permonst* ptr)
boolean boolean
sticks(register struct permonst* ptr) sticks(register struct permonst* ptr)
{ {
return (boolean) (dmgtype(ptr, AD_STCK) || dmgtype(ptr, AD_WRAP) return (boolean) (dmgtype(ptr, AD_STCK)
|| (dmgtype(ptr, AD_WRAP) && !attacktype(ptr, AT_ENGL))
|| attacktype(ptr, AT_HUGS)); || attacktype(ptr, AT_HUGS));
} }
+2 -2
View File
@@ -352,8 +352,8 @@ look_at_monster(char *buf,
name); name);
if (u.ustuck == mtmp) { if (u.ustuck == mtmp) {
if (u.uswallow || iflags.save_uswallow) /* monster detection */ if (u.uswallow || iflags.save_uswallow) /* monster detection */
Strcat(buf, is_animal(mtmp->data) Strcat(buf, digests(mtmp->data) ? ", swallowing you"
? ", swallowing you" : ", engulfing you"); : ", engulfing you");
else else
Strcat(buf, (Upolyd && sticks(g.youmonst.data)) Strcat(buf, (Upolyd && sticks(g.youmonst.data))
? ", being held" : ", holding you"); ? ", being held" : ", holding you");
+1 -1
View File
@@ -1064,7 +1064,7 @@ query_objlist(const char *qstr, /* query string */
any = cg.zeroany; any = cg.zeroany;
if (sorted && n > 1) { if (sorted && n > 1) {
Sprintf(buf, "%s Creatures", Sprintf(buf, "%s Creatures",
is_animal(u.ustuck->data) ? "Swallowed" : "Engulfed"); digests(u.ustuck->data) ? "Swallowed" : "Engulfed");
add_menu(win, &nul_glyphinfo, &any, 0, 0, iflags.menu_headings, add_menu(win, &nul_glyphinfo, &any, 0, 0, iflags.menu_headings,
clr, buf, MENU_ITEMFLAGS_NONE); clr, buf, MENU_ITEMFLAGS_NONE);
} }
+1 -1
View File
@@ -1590,7 +1590,7 @@ dohide(void)
if (u.ustuck || (u.utrap && (u.utraptype != TT_PIT || on_ceiling))) { if (u.ustuck || (u.utrap && (u.utraptype != TT_PIT || on_ceiling))) {
You_cant("hide while you're %s.", You_cant("hide while you're %s.",
!u.ustuck ? "trapped" !u.ustuck ? "trapped"
: u.uswallow ? (is_animal(u.ustuck->data) ? "swallowed" : u.uswallow ? (digests(u.ustuck->data) ? "swallowed"
: "engulfed") : "engulfed")
: !sticks(g.youmonst.data) ? "being held" : !sticks(g.youmonst.data) ? "being held"
: (humanoid(u.ustuck->data) ? "holding someone" : (humanoid(u.ustuck->data) ? "holding someone"
+1 -1
View File
@@ -2385,7 +2385,7 @@ litroom(
if (u.uswallow) { if (u.uswallow) {
if (Blind) if (Blind)
; /* no feedback */ ; /* no feedback */
else if (is_animal(u.ustuck->data)) else if (digests(u.ustuck->data))
pline("%s %s is lit.", s_suffix(Monnam(u.ustuck)), pline("%s %s is lit.", s_suffix(Monnam(u.ustuck)),
mbodypart(u.ustuck, STOMACH)); mbodypart(u.ustuck, STOMACH));
else if (is_whirly(u.ustuck->data)) else if (is_whirly(u.ustuck->data))
+10 -14
View File
@@ -822,23 +822,19 @@ cast_protection(void)
if (u.uspellprot) { if (u.uspellprot) {
pline_The("%s haze around you becomes more dense.", hgolden); pline_The("%s haze around you becomes more dense.", hgolden);
} else { } else {
struct permonst *pm = u.ustuck ? u.ustuck->data : 0;
rmtyp = levl[u.ux][u.uy].typ; rmtyp = levl[u.ux][u.uy].typ;
atmosphere = u.uswallow atmosphere = u.uswallow
? ((u.ustuck->data == &mons[PM_FOG_CLOUD]) ? ((pm == &mons[PM_FOG_CLOUD]) ? "mist"
? "mist" : is_whirly(u.ustuck->data) ? "maelstrom"
: is_whirly(u.ustuck->data) : enfolds(pm) ? "folds"
? "maelstrom" : is_animal(u.ustuck->data) ? "maw"
: is_animal(u.ustuck->data)
? "maw"
: "ooze") : "ooze")
: (u.uinwater : (u.uinwater ? hliquid("water")
? hliquid("water") : (rmtyp == CLOUD) ? "cloud"
: (rmtyp == CLOUD) : IS_TREE(rmtyp) ? "vegetation"
? "cloud" : IS_STWALL(rmtyp) ? "stone"
: IS_TREE(rmtyp)
? "vegetation"
: IS_STWALL(rmtyp)
? "stone"
: "air"); : "air");
pline_The("%s around you begins to shimmer with %s haze.", pline_The("%s around you begins to shimmer with %s haze.",
atmosphere, an(hgolden)); atmosphere, an(hgolden));
+6 -5
View File
@@ -3419,10 +3419,11 @@ float_up(void)
} else if (u.uinwater) { } else if (u.uinwater) {
spoteffects(TRUE); spoteffects(TRUE);
} else if (u.uswallow) { } else if (u.uswallow) {
You(is_animal(u.ustuck->data) ? "float away from the %s." /* FIXME: this isn't correct for trapper/lurker above */
: "spiral up into %s.", if (is_animal(u.ustuck->data))
is_animal(u.ustuck->data) ? surface(u.ux, u.uy) You("float away from the %s.", surface(u.ux, u.uy));
: mon_nam(u.ustuck)); else
You("spiral up into %s.", mon_nam(u.ustuck));
} else if (Hallucination) { } else if (Hallucination) {
pline("Up, up, and awaaaay! You're walking on air!"); pline("Up, up, and awaaaay! You're walking on air!");
} else if (Is_airlevel(&u.uz)) { } else if (Is_airlevel(&u.uz)) {
@@ -3506,7 +3507,7 @@ float_down(
} }
if (u.uswallow) { if (u.uswallow) {
You("float down, but you are still %s.", You("float down, but you are still %s.",
is_animal(u.ustuck->data) ? "swallowed" : "engulfed"); digests(u.ustuck->data) ? "swallowed" : "engulfed");
(void) encumber_msg(); (void) encumber_msg();
return 1; return 1;
} }
+5 -2
View File
@@ -4547,7 +4547,7 @@ gulpum(struct monst *mdef, struct attack *mattk)
if (DEADMONSTER(mdef)) /* not lifesaved */ if (DEADMONSTER(mdef)) /* not lifesaved */
return MM_DEF_DIED; return MM_DEF_DIED;
} }
You("%s %s!", is_animal(g.youmonst.data) ? "regurgitate" : "expel", You("%s %s!", digests(g.youmonst.data) ? "regurgitate" : "expel",
mon_nam(mdef)); mon_nam(mdef));
if (Slow_digestion || is_animal(g.youmonst.data)) { if (Slow_digestion || is_animal(g.youmonst.data)) {
pline("Obviously, you didn't like %s taste.", pline("Obviously, you didn't like %s taste.",
@@ -4559,7 +4559,10 @@ gulpum(struct monst *mdef, struct attack *mattk)
} }
void void
missum(struct monst *mdef, struct attack *mattk, boolean wouldhavehit) missum(
struct monst *mdef,
struct attack *mattk,
boolean wouldhavehit)
{ {
if (wouldhavehit) /* monk is missing due to penalty for wearing suit */ if (wouldhavehit) /* monk is missing due to penalty for wearing suit */
Your("armor is rather cumbersome..."); Your("armor is rather cumbersome...");
+1 -1
View File
@@ -490,7 +490,7 @@ release_hold(void)
if (!mtmp) { if (!mtmp) {
impossible("release_hold when not held?"); impossible("release_hold when not held?");
} else if (u.uswallow) { /* possible for sticky hero to be swallowed */ } else if (u.uswallow) { /* possible for sticky hero to be swallowed */
if (is_animal(mtmp->data)) { if (digests(mtmp->data)) {
if (!Blind) if (!Blind)
pline("%s opens its mouth!", Monnam(mtmp)); pline("%s opens its mouth!", Monnam(mtmp));
else else