Moved more globals to instance_globals.
This commit is contained in:
193
src/mhitm.c
193
src/mhitm.c
@@ -6,10 +6,6 @@
|
||||
#include "hack.h"
|
||||
#include "artifact.h"
|
||||
|
||||
static NEARDATA boolean vis, far_noise;
|
||||
static NEARDATA long noisetime;
|
||||
static NEARDATA struct obj *otmp;
|
||||
|
||||
static const char brief_feeling[] =
|
||||
"have a %s feeling for a moment, then it passes.";
|
||||
|
||||
@@ -32,11 +28,6 @@ STATIC_DCL void FDECL(missmm, (struct monst *, struct monst *,
|
||||
STATIC_DCL int FDECL(passivemm, (struct monst *, struct monst *,
|
||||
BOOLEAN_P, int));
|
||||
|
||||
/* Needed for the special case of monsters wielding vorpal blades (rare).
|
||||
* If we use this a lot it should probably be a parameter to mdamagem()
|
||||
* instead of a global variable.
|
||||
*/
|
||||
static int dieroll;
|
||||
|
||||
/* returns mon_nam(mon) relative to other_mon; normal name unless they're
|
||||
the same, in which case the reference is to {him|her|it} self */
|
||||
@@ -69,9 +60,9 @@ register struct attack *mattk;
|
||||
{
|
||||
boolean farq = (distu(magr->mx, magr->my) > 15);
|
||||
|
||||
if (!Deaf && (farq != far_noise || moves - noisetime > 10)) {
|
||||
far_noise = farq;
|
||||
noisetime = moves;
|
||||
if (!Deaf && (farq != g.far_noise || moves - g.noisetime > 10)) {
|
||||
g.far_noise = farq;
|
||||
g.noisetime = moves;
|
||||
You_hear("%s%s.",
|
||||
(mattk->aatyp == AT_EXPL) ? "an explosion" : "some noises",
|
||||
farq ? " in the distance" : "");
|
||||
@@ -87,7 +78,7 @@ struct attack *mattk;
|
||||
const char *fmt;
|
||||
char buf[BUFSZ], mdef_name[BUFSZ];
|
||||
|
||||
if (vis) {
|
||||
if (g.vis) {
|
||||
if (!canspotmon(magr))
|
||||
map_invisible(magr->mx, magr->my);
|
||||
if (!canspotmon(mdef))
|
||||
@@ -235,7 +226,7 @@ boolean quietly;
|
||||
* You can observe monster displacement if you can see both of
|
||||
* the monsters involved.
|
||||
*/
|
||||
vis = (canspotmon(magr) && canspotmon(mdef));
|
||||
g.vis = (canspotmon(magr) && canspotmon(mdef));
|
||||
|
||||
if (touch_petrifies(pd) && !resists_ston(magr)) {
|
||||
if (which_armor(magr, W_ARMG) != 0) {
|
||||
@@ -248,7 +239,7 @@ boolean quietly;
|
||||
monstone(magr);
|
||||
if (!DEADMONSTER(magr))
|
||||
return MM_HIT; /* lifesaved */
|
||||
else if (magr->mtame && !vis)
|
||||
else if (magr->mtame && !g.vis)
|
||||
You(brief_feeling, "peculiarly sad");
|
||||
return MM_AGR_DIED;
|
||||
}
|
||||
@@ -258,7 +249,7 @@ boolean quietly;
|
||||
remove_monster(tx, ty);
|
||||
place_monster(magr, tx, ty); /* put down at target spot */
|
||||
place_monster(mdef, fx, fy);
|
||||
if (vis && !quietly)
|
||||
if (g.vis && !quietly)
|
||||
pline("%s moves %s out of %s way!", Monnam(magr), mon_nam(mdef),
|
||||
is_rider(pa) ? "the" : mhis(magr));
|
||||
newsym(fx, fy); /* see it */
|
||||
@@ -343,7 +334,7 @@ register struct monst *magr, *mdef;
|
||||
tmp++;
|
||||
|
||||
/* Set up the visibility of action */
|
||||
vis = (cansee(magr->mx, magr->my) && cansee(mdef->mx, mdef->my)
|
||||
g.vis = (cansee(magr->mx, magr->my) && cansee(mdef->mx, mdef->my)
|
||||
&& (canspotmon(magr) || canspotmon(mdef)));
|
||||
|
||||
/* Set flag indicating monster has moved this turn. Necessary since a
|
||||
@@ -357,7 +348,7 @@ register struct monst *magr, *mdef;
|
||||
for (i = 0; i < NATTK; i++) {
|
||||
res[i] = MM_MISS;
|
||||
mattk = getmattk(magr, mdef, i, res, &alt_attk);
|
||||
otmp = (struct obj *) 0;
|
||||
g.otmp = (struct obj *) 0;
|
||||
attk = 1;
|
||||
switch (mattk->aatyp) {
|
||||
case AT_WEAP: /* "hand to hand" attacks */
|
||||
@@ -376,12 +367,12 @@ register struct monst *magr, *mdef;
|
||||
return 0;
|
||||
}
|
||||
possibly_unwield(magr, FALSE);
|
||||
otmp = MON_WEP(magr);
|
||||
g.otmp = MON_WEP(magr);
|
||||
|
||||
if (otmp) {
|
||||
if (vis)
|
||||
mswingsm(magr, mdef, otmp);
|
||||
tmp += hitval(otmp, mdef);
|
||||
if (g.otmp) {
|
||||
if (g.vis)
|
||||
mswingsm(magr, mdef, g.otmp);
|
||||
tmp += hitval(g.otmp, mdef);
|
||||
}
|
||||
/*FALLTHRU*/
|
||||
case AT_CLAW:
|
||||
@@ -399,26 +390,26 @@ register struct monst *magr, *mdef;
|
||||
* have a weapon instead. This instinct doesn't work for
|
||||
* players, or under conflict or confusion.
|
||||
*/
|
||||
if (!magr->mconf && !Conflict && otmp && mattk->aatyp != AT_WEAP
|
||||
if (!magr->mconf && !Conflict && g.otmp && mattk->aatyp != AT_WEAP
|
||||
&& touch_petrifies(mdef->data)) {
|
||||
strike = 0;
|
||||
break;
|
||||
}
|
||||
dieroll = rnd(20 + i);
|
||||
strike = (tmp > dieroll);
|
||||
g.dieroll = rnd(20 + i);
|
||||
strike = (tmp > g.dieroll);
|
||||
/* KMH -- don't accumulate to-hit bonuses */
|
||||
if (otmp)
|
||||
tmp -= hitval(otmp, mdef);
|
||||
if (g.otmp)
|
||||
tmp -= hitval(g.otmp, mdef);
|
||||
if (strike) {
|
||||
res[i] = hitmm(magr, mdef, mattk);
|
||||
if ((mdef->data == &mons[PM_BLACK_PUDDING]
|
||||
|| mdef->data == &mons[PM_BROWN_PUDDING])
|
||||
&& (otmp && (objects[otmp->otyp].oc_material == IRON
|
||||
|| objects[otmp->otyp].oc_material == METAL))
|
||||
&& (g.otmp && (objects[g.otmp->otyp].oc_material == IRON
|
||||
|| objects[g.otmp->otyp].oc_material == METAL))
|
||||
&& mdef->mhp > 1
|
||||
&& !mdef->mcan) {
|
||||
if (clone_mon(mdef, 0, 0)) {
|
||||
if (vis && canspotmon(mdef)) {
|
||||
if (g.vis && canspotmon(mdef)) {
|
||||
char buf[BUFSZ];
|
||||
|
||||
Strcpy(buf, Monnam(mdef));
|
||||
@@ -533,7 +524,7 @@ hitmm(magr, mdef, mattk)
|
||||
register struct monst *magr, *mdef;
|
||||
struct attack *mattk;
|
||||
{
|
||||
if (vis) {
|
||||
if (g.vis) {
|
||||
int compat;
|
||||
char buf[BUFSZ], mdef_name[BUFSZ];
|
||||
|
||||
@@ -595,7 +586,7 @@ struct attack *mattk;
|
||||
{
|
||||
char buf[BUFSZ];
|
||||
|
||||
if (vis) {
|
||||
if (g.vis) {
|
||||
if (mdef->data->mlet == S_MIMIC
|
||||
&& mdef->m_ap_type != M_AP_NOTHING)
|
||||
seemimic(mdef);
|
||||
@@ -606,7 +597,7 @@ struct attack *mattk;
|
||||
|
||||
if (magr->mcan || !magr->mcansee || !mdef->mcansee
|
||||
|| (magr->minvis && !perceives(mdef->data)) || mdef->msleeping) {
|
||||
if (vis && canspotmon(mdef))
|
||||
if (g.vis && canspotmon(mdef))
|
||||
pline("but nothing happens.");
|
||||
return MM_MISS;
|
||||
}
|
||||
@@ -687,7 +678,7 @@ register struct attack *mattk;
|
||||
if (!engulf_target(magr, mdef))
|
||||
return MM_MISS;
|
||||
|
||||
if (vis) {
|
||||
if (g.vis) {
|
||||
/* [this two-part formatting dates back to when only one x_monnam
|
||||
result could be included in an expression because the next one
|
||||
would overwrite first's result -- that's no longer the case] */
|
||||
@@ -699,7 +690,7 @@ register struct attack *mattk;
|
||||
|
||||
if (is_vampshifter(mdef)
|
||||
&& newcham(mdef, &mons[mdef->cham], FALSE, FALSE)) {
|
||||
if (vis) {
|
||||
if (g.vis) {
|
||||
/* 'it' -- previous form is no longer available and
|
||||
using that would be excessively verbose */
|
||||
pline("%s expels %s.", Monnam(magr),
|
||||
@@ -821,7 +812,7 @@ register struct attack *mattk;
|
||||
wornitems = magr->misc_worn_check;
|
||||
|
||||
/* wielded weapon gives same protection as gloves here */
|
||||
if (otmp != 0)
|
||||
if (g.otmp != 0)
|
||||
wornitems |= W_ARMG;
|
||||
|
||||
if (protector == 0L
|
||||
@@ -830,12 +821,12 @@ register struct attack *mattk;
|
||||
mon_to_stone(magr);
|
||||
return MM_HIT; /* no damage during the polymorph */
|
||||
}
|
||||
if (vis && canspotmon(magr))
|
||||
if (g.vis && canspotmon(magr))
|
||||
pline("%s turns to stone!", Monnam(magr));
|
||||
monstone(magr);
|
||||
if (!DEADMONSTER(magr))
|
||||
return MM_HIT; /* lifesaved */
|
||||
else if (magr->mtame && !vis)
|
||||
else if (magr->mtame && !g.vis)
|
||||
You(brief_feeling, "peculiarly sad");
|
||||
return MM_AGR_DIED;
|
||||
}
|
||||
@@ -849,7 +840,7 @@ register struct attack *mattk;
|
||||
case AD_DGST:
|
||||
/* eating a Rider or its corpse is fatal */
|
||||
if (is_rider(pd)) {
|
||||
if (vis && canseemon(magr))
|
||||
if (g.vis && canseemon(magr))
|
||||
pline("%s %s!", Monnam(magr),
|
||||
(pd == &mons[PM_FAMINE])
|
||||
? "belches feebly, shrivels up and dies"
|
||||
@@ -859,7 +850,7 @@ register struct attack *mattk;
|
||||
mondied(magr);
|
||||
if (!DEADMONSTER(magr))
|
||||
return 0; /* lifesaved */
|
||||
else if (magr->mtame && !vis)
|
||||
else if (magr->mtame && !g.vis)
|
||||
You(brief_feeling, "queasy");
|
||||
return MM_AGR_DIED;
|
||||
}
|
||||
@@ -917,26 +908,26 @@ register struct attack *mattk;
|
||||
if (mattk->aatyp == AT_KICK && thick_skinned(pd)) {
|
||||
tmp = 0;
|
||||
} else if (mattk->aatyp == AT_WEAP) {
|
||||
if (otmp) {
|
||||
if (g.otmp) {
|
||||
struct obj *marmg;
|
||||
|
||||
if (otmp->otyp == CORPSE
|
||||
&& touch_petrifies(&mons[otmp->corpsenm]))
|
||||
if (g.otmp->otyp == CORPSE
|
||||
&& touch_petrifies(&mons[g.otmp->corpsenm]))
|
||||
goto do_stone;
|
||||
tmp += dmgval(otmp, mdef);
|
||||
tmp += dmgval(g.otmp, mdef);
|
||||
if ((marmg = which_armor(magr, W_ARMG)) != 0
|
||||
&& marmg->otyp == GAUNTLETS_OF_POWER)
|
||||
tmp += rn1(4, 3); /* 3..6 */
|
||||
if (tmp < 1) /* is this necessary? mhitu.c has it... */
|
||||
tmp = 1;
|
||||
if (otmp->oartifact) {
|
||||
(void) artifact_hit(magr, mdef, otmp, &tmp, dieroll);
|
||||
if (g.otmp->oartifact) {
|
||||
(void) artifact_hit(magr, mdef, g.otmp, &tmp, g.dieroll);
|
||||
if (DEADMONSTER(mdef))
|
||||
return (MM_DEF_DIED
|
||||
| (grow_up(magr, mdef) ? 0 : MM_AGR_DIED));
|
||||
}
|
||||
if (tmp)
|
||||
rustm(mdef, otmp);
|
||||
rustm(mdef, g.otmp);
|
||||
}
|
||||
} else if (pa == &mons[PM_PURPLE_WORM] && pd == &mons[PM_SHRIEKER]) {
|
||||
/* hack to enhance mm_aggression(); we don't want purple
|
||||
@@ -952,22 +943,22 @@ register struct attack *mattk;
|
||||
tmp = 0;
|
||||
break;
|
||||
}
|
||||
if (vis && canseemon(mdef))
|
||||
if (g.vis && canseemon(mdef))
|
||||
pline("%s is %s!", Monnam(mdef), on_fire(pd, mattk));
|
||||
if (completelyburns(pd)) { /* paper golem or straw golem */
|
||||
if (vis && canseemon(mdef))
|
||||
if (g.vis && canseemon(mdef))
|
||||
pline("%s burns completely!", Monnam(mdef));
|
||||
mondead(mdef); /* was mondied() but that dropped paper scrolls */
|
||||
if (!DEADMONSTER(mdef))
|
||||
return 0;
|
||||
else if (mdef->mtame && !vis)
|
||||
else if (mdef->mtame && !g.vis)
|
||||
pline("May %s roast in peace.", mon_nam(mdef));
|
||||
return (MM_DEF_DIED | (grow_up(magr, mdef) ? 0 : MM_AGR_DIED));
|
||||
}
|
||||
tmp += destroy_mitem(mdef, SCROLL_CLASS, AD_FIRE);
|
||||
tmp += destroy_mitem(mdef, SPBOOK_CLASS, AD_FIRE);
|
||||
if (resists_fire(mdef)) {
|
||||
if (vis && canseemon(mdef))
|
||||
if (g.vis && canseemon(mdef))
|
||||
pline_The("fire doesn't seem to burn %s!", mon_nam(mdef));
|
||||
shieldeff(mdef->mx, mdef->my);
|
||||
golemeffects(mdef, AD_FIRE, tmp);
|
||||
@@ -981,10 +972,10 @@ register struct attack *mattk;
|
||||
tmp = 0;
|
||||
break;
|
||||
}
|
||||
if (vis && canseemon(mdef))
|
||||
if (g.vis && canseemon(mdef))
|
||||
pline("%s is covered in frost!", Monnam(mdef));
|
||||
if (resists_cold(mdef)) {
|
||||
if (vis && canseemon(mdef))
|
||||
if (g.vis && canseemon(mdef))
|
||||
pline_The("frost doesn't seem to chill %s!", mon_nam(mdef));
|
||||
shieldeff(mdef->mx, mdef->my);
|
||||
golemeffects(mdef, AD_COLD, tmp);
|
||||
@@ -997,11 +988,11 @@ register struct attack *mattk;
|
||||
tmp = 0;
|
||||
break;
|
||||
}
|
||||
if (vis && canseemon(mdef))
|
||||
if (g.vis && canseemon(mdef))
|
||||
pline("%s gets zapped!", Monnam(mdef));
|
||||
tmp += destroy_mitem(mdef, WAND_CLASS, AD_ELEC);
|
||||
if (resists_elec(mdef)) {
|
||||
if (vis && canseemon(mdef))
|
||||
if (g.vis && canseemon(mdef))
|
||||
pline_The("zap doesn't shock %s!", mon_nam(mdef));
|
||||
shieldeff(mdef->mx, mdef->my);
|
||||
golemeffects(mdef, AD_ELEC, tmp);
|
||||
@@ -1016,11 +1007,11 @@ register struct attack *mattk;
|
||||
break;
|
||||
}
|
||||
if (resists_acid(mdef)) {
|
||||
if (vis && canseemon(mdef))
|
||||
if (g.vis && canseemon(mdef))
|
||||
pline("%s is covered in %s, but it seems harmless.",
|
||||
Monnam(mdef), hliquid("acid"));
|
||||
tmp = 0;
|
||||
} else if (vis && canseemon(mdef)) {
|
||||
} else if (g.vis && canseemon(mdef)) {
|
||||
pline("%s is covered in %s!", Monnam(mdef), hliquid("acid"));
|
||||
pline("It burns %s!", mon_nam(mdef));
|
||||
}
|
||||
@@ -1033,12 +1024,12 @@ register struct attack *mattk;
|
||||
if (magr->mcan)
|
||||
break;
|
||||
if (pd == &mons[PM_IRON_GOLEM]) {
|
||||
if (vis && canseemon(mdef))
|
||||
if (g.vis && canseemon(mdef))
|
||||
pline("%s falls to pieces!", Monnam(mdef));
|
||||
mondied(mdef);
|
||||
if (!DEADMONSTER(mdef))
|
||||
return 0;
|
||||
else if (mdef->mtame && !vis)
|
||||
else if (mdef->mtame && !g.vis)
|
||||
pline("May %s rust in peace.", mon_nam(mdef));
|
||||
return (MM_DEF_DIED | (grow_up(magr, mdef) ? 0 : MM_AGR_DIED));
|
||||
}
|
||||
@@ -1057,12 +1048,12 @@ register struct attack *mattk;
|
||||
if (magr->mcan)
|
||||
break;
|
||||
if (pd == &mons[PM_WOOD_GOLEM] || pd == &mons[PM_LEATHER_GOLEM]) {
|
||||
if (vis && canseemon(mdef))
|
||||
if (g.vis && canseemon(mdef))
|
||||
pline("%s falls to pieces!", Monnam(mdef));
|
||||
mondied(mdef);
|
||||
if (!DEADMONSTER(mdef))
|
||||
return 0;
|
||||
else if (mdef->mtame && !vis)
|
||||
else if (mdef->mtame && !g.vis)
|
||||
pline("May %s rot in peace.", mon_nam(mdef));
|
||||
return (MM_DEF_DIED | (grow_up(magr, mdef) ? 0 : MM_AGR_DIED));
|
||||
}
|
||||
@@ -1083,13 +1074,13 @@ register struct attack *mattk;
|
||||
break;
|
||||
}
|
||||
if (!resists_ston(mdef)) {
|
||||
if (vis && canseemon(mdef))
|
||||
if (g.vis && canseemon(mdef))
|
||||
pline("%s turns to stone!", Monnam(mdef));
|
||||
monstone(mdef);
|
||||
post_stone:
|
||||
if (!DEADMONSTER(mdef))
|
||||
return 0;
|
||||
else if (mdef->mtame && !vis)
|
||||
else if (mdef->mtame && !g.vis)
|
||||
You(brief_feeling, "peculiarly sad");
|
||||
return (MM_DEF_DIED | (grow_up(magr, mdef) ? 0 : MM_AGR_DIED));
|
||||
}
|
||||
@@ -1101,18 +1092,18 @@ register struct attack *mattk;
|
||||
boolean wasseen = canspotmon(mdef);
|
||||
/* save the name before monster teleports, otherwise
|
||||
we'll get "it" in the suddenly disappears message */
|
||||
if (vis && wasseen)
|
||||
if (g.vis && wasseen)
|
||||
Strcpy(mdef_Monnam, Monnam(mdef));
|
||||
mdef->mstrategy &= ~STRAT_WAITFORU;
|
||||
(void) rloc(mdef, TRUE);
|
||||
if (vis && wasseen && !canspotmon(mdef) && mdef != u.usteed)
|
||||
if (g.vis && wasseen && !canspotmon(mdef) && mdef != u.usteed)
|
||||
pline("%s suddenly disappears!", mdef_Monnam);
|
||||
}
|
||||
break;
|
||||
case AD_SLEE:
|
||||
if (!cancelled && !mdef->msleeping
|
||||
&& sleep_monst(mdef, rnd(10), -1)) {
|
||||
if (vis && canspotmon(mdef)) {
|
||||
if (g.vis && canspotmon(mdef)) {
|
||||
Strcpy(buf, Monnam(mdef));
|
||||
pline("%s is put to sleep by %s.", buf, mon_nam(magr));
|
||||
}
|
||||
@@ -1122,7 +1113,7 @@ register struct attack *mattk;
|
||||
break;
|
||||
case AD_PLYS:
|
||||
if (!cancelled && mdef->mcanmove) {
|
||||
if (vis && canspotmon(mdef)) {
|
||||
if (g.vis && canspotmon(mdef)) {
|
||||
Strcpy(buf, Monnam(mdef));
|
||||
pline("%s is frozen by %s.", buf, mon_nam(magr));
|
||||
}
|
||||
@@ -1135,7 +1126,7 @@ register struct attack *mattk;
|
||||
|
||||
mon_adjust_speed(mdef, -1, (struct obj *) 0);
|
||||
mdef->mstrategy &= ~STRAT_WAITFORU;
|
||||
if (mdef->mspeed != oldspeed && vis && canspotmon(mdef))
|
||||
if (mdef->mspeed != oldspeed && g.vis && canspotmon(mdef))
|
||||
pline("%s slows down.", Monnam(mdef));
|
||||
}
|
||||
break;
|
||||
@@ -1145,7 +1136,7 @@ register struct attack *mattk;
|
||||
* we still should check for it).
|
||||
*/
|
||||
if (!magr->mcan && !mdef->mconf && !magr->mspec_used) {
|
||||
if (vis && canseemon(mdef))
|
||||
if (g.vis && canseemon(mdef))
|
||||
pline("%s looks confused.", Monnam(mdef));
|
||||
mdef->mconf = 1;
|
||||
mdef->mstrategy &= ~STRAT_WAITFORU;
|
||||
@@ -1155,7 +1146,7 @@ register struct attack *mattk;
|
||||
if (can_blnd(magr, mdef, mattk->aatyp, (struct obj *) 0)) {
|
||||
register unsigned rnd_tmp;
|
||||
|
||||
if (vis && mdef->mcansee && canspotmon(mdef))
|
||||
if (g.vis && mdef->mcansee && canspotmon(mdef))
|
||||
pline("%s is blinded.", Monnam(mdef));
|
||||
rnd_tmp = d((int) mattk->damn, (int) mattk->damd);
|
||||
if ((rnd_tmp += mdef->mblinded) > 127)
|
||||
@@ -1168,7 +1159,7 @@ register struct attack *mattk;
|
||||
break;
|
||||
case AD_HALU:
|
||||
if (!magr->mcan && haseyes(pd) && mdef->mcansee) {
|
||||
if (vis && canseemon(mdef))
|
||||
if (g.vis && canseemon(mdef))
|
||||
pline("%s looks %sconfused.", Monnam(mdef),
|
||||
mdef->mconf ? "more " : "");
|
||||
mdef->mconf = 1;
|
||||
@@ -1185,7 +1176,7 @@ register struct attack *mattk;
|
||||
if (is_were(pd) && pd->mlet != S_HUMAN)
|
||||
were_change(mdef);
|
||||
if (pd == &mons[PM_CLAY_GOLEM]) {
|
||||
if (vis && canseemon(mdef)) {
|
||||
if (g.vis && canseemon(mdef)) {
|
||||
pline("Some writing vanishes from %s head!",
|
||||
s_suffix(mon_nam(mdef)));
|
||||
pline("%s is destroyed!", Monnam(mdef));
|
||||
@@ -1193,13 +1184,13 @@ register struct attack *mattk;
|
||||
mondied(mdef);
|
||||
if (!DEADMONSTER(mdef))
|
||||
return 0;
|
||||
else if (mdef->mtame && !vis)
|
||||
else if (mdef->mtame && !g.vis)
|
||||
You(brief_feeling, "strangely sad");
|
||||
return (MM_DEF_DIED
|
||||
| (grow_up(magr, mdef) ? 0 : MM_AGR_DIED));
|
||||
}
|
||||
if (!Deaf) {
|
||||
if (!vis)
|
||||
if (!g.vis)
|
||||
You_hear("laughter.");
|
||||
else if (canseemon(magr))
|
||||
pline("%s chuckles.", Monnam(magr));
|
||||
@@ -1222,21 +1213,21 @@ register struct attack *mattk;
|
||||
add_to_minv(magr, gold);
|
||||
}
|
||||
mdef->mstrategy &= ~STRAT_WAITFORU;
|
||||
if (vis && canseemon(mdef)) {
|
||||
if (g.vis && canseemon(mdef)) {
|
||||
Strcpy(buf, Monnam(magr));
|
||||
pline("%s steals some gold from %s.", buf, mon_nam(mdef));
|
||||
}
|
||||
if (!tele_restrict(magr)) {
|
||||
boolean couldspot = canspotmon(magr);
|
||||
(void) rloc(magr, TRUE);
|
||||
if (vis && couldspot && !canspotmon(magr))
|
||||
if (g.vis && couldspot && !canspotmon(magr))
|
||||
pline("%s suddenly disappears!", buf);
|
||||
}
|
||||
break;
|
||||
case AD_DRLI:
|
||||
if (!cancelled && !rn2(3) && !resists_drli(mdef)) {
|
||||
tmp = d(2, 6);
|
||||
if (vis && canspotmon(mdef))
|
||||
if (g.vis && canspotmon(mdef))
|
||||
pline("%s suddenly seems weaker!", Monnam(mdef));
|
||||
mdef->mhpmax -= tmp;
|
||||
if (mdef->m_lev == 0)
|
||||
@@ -1264,26 +1255,26 @@ register struct attack *mattk;
|
||||
Strcpy(mdefnambuf,
|
||||
x_monnam(mdef, ARTICLE_THE, (char *) 0, 0, FALSE));
|
||||
|
||||
otmp = obj;
|
||||
if (u.usteed == mdef && otmp == which_armor(mdef, W_SADDLE))
|
||||
g.otmp = obj;
|
||||
if (u.usteed == mdef && g.otmp == which_armor(mdef, W_SADDLE))
|
||||
/* "You can no longer ride <steed>." */
|
||||
dismount_steed(DISMOUNT_POLY);
|
||||
obj_extract_self(otmp);
|
||||
if (otmp->owornmask) {
|
||||
mdef->misc_worn_check &= ~otmp->owornmask;
|
||||
if (otmp->owornmask & W_WEP)
|
||||
obj_extract_self(g.otmp);
|
||||
if (g.otmp->owornmask) {
|
||||
mdef->misc_worn_check &= ~g.otmp->owornmask;
|
||||
if (g.otmp->owornmask & W_WEP)
|
||||
mwepgone(mdef);
|
||||
otmp->owornmask = 0L;
|
||||
update_mon_intrinsics(mdef, otmp, FALSE, FALSE);
|
||||
g.otmp->owornmask = 0L;
|
||||
update_mon_intrinsics(mdef, g.otmp, FALSE, FALSE);
|
||||
/* give monster a chance to wear other equipment on its next
|
||||
move instead of waiting until it picks something up */
|
||||
mdef->misc_worn_check |= I_SPECIAL;
|
||||
}
|
||||
/* add_to_minv() might free otmp [if it merges] */
|
||||
if (vis)
|
||||
Strcpy(onambuf, doname(otmp));
|
||||
(void) add_to_minv(magr, otmp);
|
||||
if (vis && canseemon(mdef)) {
|
||||
if (g.vis)
|
||||
Strcpy(onambuf, doname(g.otmp));
|
||||
(void) add_to_minv(magr, g.otmp);
|
||||
if (g.vis && canseemon(mdef)) {
|
||||
Strcpy(buf, Monnam(magr));
|
||||
pline("%s steals %s from %s!", buf, onambuf, mdefnambuf);
|
||||
}
|
||||
@@ -1297,7 +1288,7 @@ register struct attack *mattk;
|
||||
boolean couldspot = canspotmon(magr);
|
||||
|
||||
(void) rloc(magr, TRUE);
|
||||
if (vis && couldspot && !canspotmon(magr))
|
||||
if (g.vis && couldspot && !canspotmon(magr))
|
||||
pline("%s suddenly disappears!", buf);
|
||||
}
|
||||
}
|
||||
@@ -1305,7 +1296,7 @@ register struct attack *mattk;
|
||||
break;
|
||||
case AD_DREN:
|
||||
if (!cancelled && !rn2(4))
|
||||
xdrainenergym(mdef, (boolean) (vis && canspotmon(mdef)
|
||||
xdrainenergym(mdef, (boolean) (g.vis && canspotmon(mdef)
|
||||
&& mattk->aatyp != AT_ENGL));
|
||||
tmp = 0;
|
||||
break;
|
||||
@@ -1313,18 +1304,18 @@ register struct attack *mattk;
|
||||
case AD_DRDX:
|
||||
case AD_DRCO:
|
||||
if (!cancelled && !rn2(8)) {
|
||||
if (vis && canspotmon(magr))
|
||||
if (g.vis && canspotmon(magr))
|
||||
pline("%s %s was poisoned!", s_suffix(Monnam(magr)),
|
||||
mpoisons_subj(magr, mattk));
|
||||
if (resists_poison(mdef)) {
|
||||
if (vis && canspotmon(mdef) && canspotmon(magr))
|
||||
if (g.vis && canspotmon(mdef) && canspotmon(magr))
|
||||
pline_The("poison doesn't seem to affect %s.",
|
||||
mon_nam(mdef));
|
||||
} else {
|
||||
if (rn2(10))
|
||||
tmp += rn1(10, 6);
|
||||
else {
|
||||
if (vis && canspotmon(mdef))
|
||||
if (g.vis && canspotmon(mdef))
|
||||
pline_The("poison was deadly...");
|
||||
tmp = mdef->mhp;
|
||||
}
|
||||
@@ -1333,28 +1324,28 @@ register struct attack *mattk;
|
||||
break;
|
||||
case AD_DRIN:
|
||||
if (g.notonhead || !has_head(pd)) {
|
||||
if (vis && canspotmon(mdef))
|
||||
if (g.vis && canspotmon(mdef))
|
||||
pline("%s doesn't seem harmed.", Monnam(mdef));
|
||||
/* Not clear what to do for green slimes */
|
||||
tmp = 0;
|
||||
break;
|
||||
}
|
||||
if ((mdef->misc_worn_check & W_ARMH) && rn2(8)) {
|
||||
if (vis && canspotmon(magr) && canseemon(mdef)) {
|
||||
if (g.vis && canspotmon(magr) && canseemon(mdef)) {
|
||||
Strcpy(buf, s_suffix(Monnam(mdef)));
|
||||
pline("%s helmet blocks %s attack to %s head.", buf,
|
||||
s_suffix(mon_nam(magr)), mhis(mdef));
|
||||
}
|
||||
break;
|
||||
}
|
||||
res = eat_brains(magr, mdef, vis, &tmp);
|
||||
res = eat_brains(magr, mdef, g.vis, &tmp);
|
||||
break;
|
||||
case AD_SLIM:
|
||||
if (cancelled)
|
||||
break; /* physical damage only */
|
||||
if (!rn2(4) && !slimeproof(pd)) {
|
||||
if (!munslime(mdef, FALSE) && !DEADMONSTER(mdef)) {
|
||||
if (newcham(mdef, &mons[PM_GREEN_SLIME], FALSE, vis && canseemon(mdef)))
|
||||
if (newcham(mdef, &mons[PM_GREEN_SLIME], FALSE, g.vis && canseemon(mdef)))
|
||||
pd = mdef->data;
|
||||
mdef->mstrategy &= ~STRAT_WAITFORU;
|
||||
res = MM_HIT;
|
||||
@@ -1558,8 +1549,8 @@ int mdead;
|
||||
acid_damage(MON_WEP(magr));
|
||||
goto assess_dmg;
|
||||
case AD_ENCH: /* KMH -- remove enchantment (disenchanter) */
|
||||
if (mhit && !mdef->mcan && otmp) {
|
||||
(void) drain_item(otmp, FALSE);
|
||||
if (mhit && !mdef->mcan && g.otmp) {
|
||||
(void) drain_item(g.otmp, FALSE);
|
||||
/* No message */
|
||||
}
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user