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:
43
src/mhitu.c
43
src/mhitu.c
@@ -232,14 +232,17 @@ wildmiss(struct monst *mtmp, struct attack *mattk)
|
||||
}
|
||||
|
||||
void
|
||||
expels(struct monst *mtmp,
|
||||
struct permonst *mdat, /* if mtmp is polymorphed, mdat != mtmp->data */
|
||||
boolean message)
|
||||
expels(
|
||||
struct monst *mtmp,
|
||||
struct permonst *mdat, /* if mtmp is polymorphed, mdat != mtmp->data */
|
||||
boolean message)
|
||||
{
|
||||
g.context.botl = 1;
|
||||
if (message) {
|
||||
if (is_animal(mdat)) {
|
||||
if (digests(mdat)) {
|
||||
You("get regurgitated!");
|
||||
} else if (enfolds(mdat)) {
|
||||
pline("%s unfolds and you are released!", Monnam(mtmp));
|
||||
} else {
|
||||
char blast[40];
|
||||
struct attack *attk = attacktype_fordmg(mdat, AT_ENGL, AD_ANY);
|
||||
@@ -717,7 +720,7 @@ mattacku(register struct monst *mtmp)
|
||||
} else {
|
||||
missmu(mtmp, (tmp == j), mattk);
|
||||
}
|
||||
} else if (is_animal(mtmp->data)) {
|
||||
} else if (digests(mtmp->data)) {
|
||||
pline("%s gulps some air!", Monnam(mtmp));
|
||||
} else {
|
||||
if (youseeit)
|
||||
@@ -897,8 +900,13 @@ diseasemu(struct permonst *mdat)
|
||||
boolean
|
||||
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)
|
||||
obj = uarmu;
|
||||
if (mattk->adtyp == AD_DRIN)
|
||||
@@ -1165,8 +1173,8 @@ gulpmu(struct monst *mtmp, struct attack *mattk)
|
||||
dismount_steed(DISMOUNT_ENGULFED);
|
||||
} else {
|
||||
urgent_pline("%s %s!", Monnam(mtmp),
|
||||
is_animal(mtmp->data) ? "swallows you whole"
|
||||
: "engulfs you");
|
||||
digests(mtmp->data) ? "swallows you whole"
|
||||
: "engulfs you");
|
||||
}
|
||||
stop_occupation();
|
||||
reset_occupations(); /* behave as if you had moved */
|
||||
@@ -1278,7 +1286,8 @@ gulpmu(struct monst *mtmp, struct attack *mattk)
|
||||
if (Amphibious && !flaming(g.youmonst.data))
|
||||
tmp = 0;
|
||||
} else {
|
||||
You("are pummeled with debris!");
|
||||
You("are %s!", enfolds(mtmp->data) ? "being squashed"
|
||||
: "pummeled with debris");
|
||||
exercise(A_STR, FALSE);
|
||||
}
|
||||
break;
|
||||
@@ -1378,17 +1387,20 @@ gulpmu(struct monst *mtmp, struct attack *mattk)
|
||||
; /* life-saving has already expelled swallowed hero */
|
||||
} else if (touch_petrifies(g.youmonst.data) && !resists_ston(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);
|
||||
} 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
|
||||
expels now so the !u.uswldtim case is no longer possible;
|
||||
however, polymorphing into a huge form while already
|
||||
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)
|
||||
&& (is_animal(mtmp->data)
|
||||
|| (dmgtype(mtmp->data, AD_DGST) && Slow_digestion)))
|
||||
&& (digests(mtmp->data) && Slow_digestion))
|
||||
pline("Obviously %s doesn't like your taste.", mon_nam(mtmp));
|
||||
expels(mtmp, mtmp->data, FALSE);
|
||||
}
|
||||
@@ -1712,8 +1724,9 @@ mdamageu(struct monst *mtmp, int n)
|
||||
* 2 if wrong gender for nymph
|
||||
*/
|
||||
int
|
||||
could_seduce(struct monst *magr, struct monst *mdef,
|
||||
struct attack *mattk) /* non-Null: current attack; Null: general capability */
|
||||
could_seduce(
|
||||
struct monst *magr, struct monst *mdef,
|
||||
struct attack *mattk) /* non-Null: current atk; Null: general capability */
|
||||
{
|
||||
struct permonst *pagr;
|
||||
boolean agrinvis, defperc;
|
||||
|
||||
Reference in New Issue
Block a user