Moved potion.c globals to instance_globals.
This commit is contained in:
14
src/apply.c
14
src/apply.c
@@ -5,8 +5,6 @@
|
||||
|
||||
#include "hack.h"
|
||||
|
||||
extern boolean notonhead; /* for long worms */
|
||||
|
||||
STATIC_DCL int FDECL(use_camera, (struct obj *));
|
||||
STATIC_DCL int FDECL(use_towel, (struct obj *));
|
||||
STATIC_DCL boolean FDECL(its_dead, (int, int, int *));
|
||||
@@ -325,7 +323,7 @@ register struct obj *obj;
|
||||
context.stethoscope_movement = youmonst.movement;
|
||||
|
||||
bhitpos.x = u.ux, bhitpos.y = u.uy; /* tentative, reset below */
|
||||
notonhead = u.uswallow;
|
||||
g.notonhead = u.uswallow;
|
||||
if (u.usteed && u.dz > 0) {
|
||||
if (interference) {
|
||||
pline("%s interferes.", Monnam(u.ustuck));
|
||||
@@ -374,7 +372,7 @@ register struct obj *obj;
|
||||
|
||||
/* bhitpos needed by mstatusline() iff mtmp is a long worm */
|
||||
bhitpos.x = rx, bhitpos.y = ry;
|
||||
notonhead = (mtmp->mx != rx || mtmp->my != ry);
|
||||
g.notonhead = (mtmp->mx != rx || mtmp->my != ry);
|
||||
|
||||
if (mtmp->mundetected) {
|
||||
if (!canspotmon(mtmp))
|
||||
@@ -884,7 +882,7 @@ struct obj *obj;
|
||||
mtmp = bhit(u.dx, u.dy, COLNO, INVIS_BEAM,
|
||||
(int FDECL((*), (MONST_P, OBJ_P))) 0,
|
||||
(int FDECL((*), (OBJ_P, OBJ_P))) 0, &obj);
|
||||
if (!mtmp || !haseyes(mtmp->data) || notonhead)
|
||||
if (!mtmp || !haseyes(mtmp->data) || g.notonhead)
|
||||
return 1;
|
||||
|
||||
/* couldsee(mtmp->mx, mtmp->my) is implied by the fact that bhit()
|
||||
@@ -972,7 +970,7 @@ struct obj *obj;
|
||||
;
|
||||
else if ((mtmp->minvis && !perceives(mtmp->data))
|
||||
/* redundant: can't get here if these are true */
|
||||
|| !haseyes(mtmp->data) || notonhead || !mtmp->mcansee)
|
||||
|| !haseyes(mtmp->data) || g.notonhead || !mtmp->mcansee)
|
||||
pline("%s doesn't seem to notice %s reflection.", Monnam(mtmp),
|
||||
mhis(mtmp));
|
||||
else
|
||||
@@ -3034,7 +3032,7 @@ struct obj *obj;
|
||||
return 1; /* burn nutrition; maybe pass out */
|
||||
context.polearm.hitmon = mtmp;
|
||||
check_caitiff(mtmp);
|
||||
notonhead = (bhitpos.x != mtmp->mx || bhitpos.y != mtmp->my);
|
||||
g.notonhead = (bhitpos.x != mtmp->mx || bhitpos.y != mtmp->my);
|
||||
(void) thitmonst(mtmp, uwep);
|
||||
} else if (glyph_is_statue(glyph) /* might be hallucinatory */
|
||||
&& sobj_at(STATUE, bhitpos.x, bhitpos.y)) {
|
||||
@@ -3202,7 +3200,7 @@ struct obj *obj;
|
||||
bhitpos = cc;
|
||||
if ((mtmp = m_at(cc.x, cc.y)) == (struct monst *) 0)
|
||||
break;
|
||||
notonhead = (bhitpos.x != mtmp->mx || bhitpos.y != mtmp->my);
|
||||
g.notonhead = (bhitpos.x != mtmp->mx || bhitpos.y != mtmp->my);
|
||||
save_confirm = flags.confirm;
|
||||
if (verysmall(mtmp->data) && !rn2(4)
|
||||
&& enexto(&cc, u.ux, u.uy, (struct permonst *) 0)) {
|
||||
|
||||
@@ -14,8 +14,6 @@
|
||||
* the contents, just the total size.
|
||||
*/
|
||||
|
||||
extern boolean notonhead; /* for long worms */
|
||||
|
||||
#define get_artifact(o) \
|
||||
(((o) && (o)->oartifact) ? &artilist[(int) (o)->oartifact] : 0)
|
||||
|
||||
@@ -1254,7 +1252,7 @@ int dieroll; /* needed for Magicbane and vorpal blades */
|
||||
}
|
||||
if (!youdefend) {
|
||||
/* allow normal cutworm() call to add extra damage */
|
||||
if (notonhead)
|
||||
if (g.notonhead)
|
||||
return FALSE;
|
||||
|
||||
if (bigmonst(mdef->data)) {
|
||||
@@ -1297,7 +1295,7 @@ int dieroll; /* needed for Magicbane and vorpal blades */
|
||||
return FALSE;
|
||||
wepdesc = artilist[ART_VORPAL_BLADE].name;
|
||||
if (!youdefend) {
|
||||
if (!has_head(mdef->data) || notonhead || u.uswallow) {
|
||||
if (!has_head(mdef->data) || g.notonhead || u.uswallow) {
|
||||
if (youattack)
|
||||
pline("Somehow, you miss %s wildly.", mon_nam(mdef));
|
||||
else if (vis)
|
||||
|
||||
@@ -348,6 +348,11 @@ const struct instance_globals g_init = {
|
||||
/* pickup.c */
|
||||
0, /* oldcap */
|
||||
|
||||
/* potion.c */
|
||||
FALSE, /* notonhead */
|
||||
UNDEFINED_VALUE, /* potion_nothing */
|
||||
UNDEFINED_VALUE, /* potion_unkn */
|
||||
|
||||
/* read.c */
|
||||
UNDEFINED_VALUE, /* known */
|
||||
|
||||
|
||||
@@ -7,8 +7,6 @@
|
||||
|
||||
#include "mfndpos.h"
|
||||
|
||||
extern boolean notonhead;
|
||||
|
||||
STATIC_DCL boolean FDECL(dog_hunger, (struct monst *, struct edog *));
|
||||
STATIC_DCL int FDECL(dog_invent, (struct monst *, struct edog *, int));
|
||||
STATIC_DCL int FDECL(dog_goal, (struct monst *, struct edog *, int, int, int));
|
||||
@@ -1023,7 +1021,7 @@ int after; /* this is extra fast monster movement */
|
||||
if (after)
|
||||
return 0; /* hit only once each move */
|
||||
|
||||
notonhead = 0;
|
||||
g.notonhead = 0;
|
||||
mstatus = mattackm(mtmp, mtmp2);
|
||||
|
||||
/* aggressor (pet) died */
|
||||
|
||||
@@ -14,8 +14,6 @@ static NEARDATA const char *gate_str;
|
||||
|
||||
/* kickedobj (decl.c) tracks a kicked object until placed or destroyed */
|
||||
|
||||
extern boolean notonhead; /* for long worms */
|
||||
|
||||
STATIC_DCL void FDECL(kickdmg, (struct monst *, BOOLEAN_P));
|
||||
STATIC_DCL boolean FDECL(maybe_kick_monster, (struct monst *,
|
||||
XCHAR_P, XCHAR_P));
|
||||
@@ -679,7 +677,7 @@ xchar x, y;
|
||||
if (mon->isshk && kickedobj->where == OBJ_MINVENT
|
||||
&& kickedobj->ocarry == mon)
|
||||
return 1; /* alert shk caught it */
|
||||
notonhead = (mon->mx != bhitpos.x || mon->my != bhitpos.y);
|
||||
g.notonhead = (mon->mx != bhitpos.x || mon->my != bhitpos.y);
|
||||
if (isgold ? ghitm(mon, kickedobj) /* caught? */
|
||||
: thitmonst(mon, kickedobj)) /* hit && used up? */
|
||||
return 1;
|
||||
|
||||
@@ -28,8 +28,6 @@ static NEARDATA const char bullets[] = { ALLOW_COUNT, COIN_CLASS, ALL_CLASSES,
|
||||
|
||||
/* thrownobj (decl.c) tracks an object until it lands */
|
||||
|
||||
extern boolean notonhead; /* for long worms */
|
||||
|
||||
/* Throw the selected object, asking for direction */
|
||||
STATIC_OVL int
|
||||
throw_obj(obj, shotlimit)
|
||||
@@ -1090,7 +1088,7 @@ boolean twoweap; /* used to restore twoweapon mode if wielded weapon returns */
|
||||
|| Hallucination || Fumbling);
|
||||
boolean tethered_weapon = (obj->otyp == AKLYS && (wep_mask & W_WEP) != 0);
|
||||
|
||||
notonhead = FALSE; /* reset potentially stale value */
|
||||
g.notonhead = FALSE; /* reset potentially stale value */
|
||||
if ((obj->cursed || obj->greased) && (u.dx || u.dy) && !rn2(7)) {
|
||||
boolean slipok = TRUE;
|
||||
|
||||
@@ -1263,7 +1261,7 @@ boolean twoweap; /* used to restore twoweapon mode if wielded weapon returns */
|
||||
return; /* alert shk caught it */
|
||||
}
|
||||
(void) snuff_candle(obj);
|
||||
notonhead = (bhitpos.x != mon->mx || bhitpos.y != mon->my);
|
||||
g.notonhead = (bhitpos.x != mon->mx || bhitpos.y != mon->my);
|
||||
obj_gone = thitmonst(mon, obj);
|
||||
/* Monster may have been tamed; this frees old mon */
|
||||
mon = m_at(bhitpos.x, bhitpos.y);
|
||||
|
||||
@@ -6,8 +6,6 @@
|
||||
#include "hack.h"
|
||||
#include "artifact.h"
|
||||
|
||||
extern boolean notonhead;
|
||||
|
||||
static NEARDATA boolean vis, far_noise;
|
||||
static NEARDATA long noisetime;
|
||||
static NEARDATA struct obj *otmp;
|
||||
@@ -161,7 +159,7 @@ register struct monst *mtmp;
|
||||
/* mtmp can be killed */
|
||||
bhitpos.x = mon->mx;
|
||||
bhitpos.y = mon->my;
|
||||
notonhead = 0;
|
||||
g.notonhead = 0;
|
||||
result = mattackm(mtmp, mon);
|
||||
|
||||
if (result & MM_AGR_DIED)
|
||||
@@ -179,7 +177,7 @@ register struct monst *mtmp;
|
||||
if ((result & MM_HIT) && !(result & MM_DEF_DIED) && rn2(4)
|
||||
&& mon->movement >= NORMAL_SPEED) {
|
||||
mon->movement -= NORMAL_SPEED;
|
||||
notonhead = 0;
|
||||
g.notonhead = 0;
|
||||
(void) mattackm(mon, mtmp); /* return attack */
|
||||
}
|
||||
|
||||
@@ -1334,7 +1332,7 @@ register struct attack *mattk;
|
||||
}
|
||||
break;
|
||||
case AD_DRIN:
|
||||
if (notonhead || !has_head(pd)) {
|
||||
if (g.notonhead || !has_head(pd)) {
|
||||
if (vis && canspotmon(mdef))
|
||||
pline("%s doesn't seem harmed.", Monnam(mdef));
|
||||
/* Not clear what to do for green slimes */
|
||||
|
||||
@@ -7,8 +7,6 @@
|
||||
#include "mfndpos.h"
|
||||
#include "artifact.h"
|
||||
|
||||
extern boolean notonhead;
|
||||
|
||||
STATIC_DCL void FDECL(watch_on_duty, (struct monst *));
|
||||
STATIC_DCL int FDECL(disturb, (struct monst *));
|
||||
STATIC_DCL void FDECL(release_hero, (struct monst *));
|
||||
@@ -877,7 +875,7 @@ register int after;
|
||||
*/
|
||||
if ((dist2(mtmp->mx, mtmp->my, tx, ty) < 2) && intruder
|
||||
&& (intruder != mtmp)) {
|
||||
notonhead = (intruder->mx != tx || intruder->my != ty);
|
||||
g.notonhead = (intruder->mx != tx || intruder->my != ty);
|
||||
if (mattackm(mtmp, intruder) == 2)
|
||||
return 2;
|
||||
mmoved = 1;
|
||||
@@ -1222,7 +1220,7 @@ not_special:
|
||||
int mstatus;
|
||||
mtmp2 = m_at(nix, niy);
|
||||
|
||||
notonhead = mtmp2 && (nix != mtmp2->mx || niy != mtmp2->my);
|
||||
g.notonhead = mtmp2 && (nix != mtmp2->mx || niy != mtmp2->my);
|
||||
/* note: mstatus returns 0 if mtmp2 is nonexistent */
|
||||
mstatus = mattackm(mtmp, mtmp2);
|
||||
|
||||
@@ -1232,7 +1230,7 @@ not_special:
|
||||
if ((mstatus & MM_HIT) && !(mstatus & MM_DEF_DIED) && rn2(4)
|
||||
&& mtmp2->movement >= NORMAL_SPEED) {
|
||||
mtmp2->movement -= NORMAL_SPEED;
|
||||
notonhead = 0;
|
||||
g.notonhead = 0;
|
||||
mstatus = mattackm(mtmp2, mtmp); /* return attack */
|
||||
if (mstatus & MM_DEF_DIED)
|
||||
return 2;
|
||||
|
||||
@@ -26,7 +26,6 @@ STATIC_OVL NEARDATA const char *breathwep[] = {
|
||||
"strange breath #9"
|
||||
};
|
||||
|
||||
extern boolean notonhead; /* for long worms */
|
||||
STATIC_VAR int mesg_given; /* for m_throw()/thitu() 'miss' message */
|
||||
|
||||
/* hero is hit by something other than a monster */
|
||||
@@ -312,7 +311,7 @@ boolean verbose; /* give message(s) even when you can't see what happened */
|
||||
int objgone = 1;
|
||||
struct obj *mon_launcher = archer ? MON_WEP(archer) : NULL;
|
||||
|
||||
notonhead = (bhitpos.x != mtmp->mx || bhitpos.y != mtmp->my);
|
||||
g.notonhead = (bhitpos.x != mtmp->mx || bhitpos.y != mtmp->my);
|
||||
ismimic = mtmp->m_ap_type && mtmp->m_ap_type != M_AP_MONSTER;
|
||||
vis = cansee(bhitpos.x, bhitpos.y);
|
||||
|
||||
@@ -477,7 +476,7 @@ struct obj *obj; /* missile (or stack providing it) */
|
||||
|
||||
bhitpos.x = x;
|
||||
bhitpos.y = y;
|
||||
notonhead = FALSE; /* reset potentially stale value */
|
||||
g.notonhead = FALSE; /* reset potentially stale value */
|
||||
|
||||
if (obj->quan == 1L) {
|
||||
/*
|
||||
|
||||
61
src/potion.c
61
src/potion.c
@@ -5,9 +5,6 @@
|
||||
|
||||
#include "hack.h"
|
||||
|
||||
boolean notonhead = FALSE;
|
||||
|
||||
static NEARDATA int nothing, unkn;
|
||||
static NEARDATA const char beverages[] = { POTION_CLASS, 0 };
|
||||
|
||||
STATIC_DCL long FDECL(itimeout, (long));
|
||||
@@ -537,17 +534,17 @@ register struct obj *otmp;
|
||||
int retval;
|
||||
|
||||
otmp->in_use = TRUE;
|
||||
nothing = unkn = 0;
|
||||
g.potion_nothing = g.potion_unkn = 0;
|
||||
if ((retval = peffects(otmp)) >= 0)
|
||||
return retval;
|
||||
|
||||
if (nothing) {
|
||||
unkn++;
|
||||
if (g.potion_nothing) {
|
||||
g.potion_unkn++;
|
||||
You("have a %s feeling for a moment, then it passes.",
|
||||
Hallucination ? "normal" : "peculiar");
|
||||
}
|
||||
if (otmp->dknown && !objects[otmp->otyp].oc_name_known) {
|
||||
if (!unkn) {
|
||||
if (!g.potion_unkn) {
|
||||
makeknown(otmp->otyp);
|
||||
more_experienced(0, 10);
|
||||
} else if (!objects[otmp->otyp].oc_uname)
|
||||
@@ -566,7 +563,7 @@ register struct obj *otmp;
|
||||
switch (otmp->otyp) {
|
||||
case POT_RESTORE_ABILITY:
|
||||
case SPE_RESTORE_ABILITY:
|
||||
unkn++;
|
||||
g.potion_unkn++;
|
||||
if (otmp->cursed) {
|
||||
pline("Ulch! This makes you feel mediocre!");
|
||||
break;
|
||||
@@ -606,7 +603,7 @@ register struct obj *otmp;
|
||||
break;
|
||||
case POT_HALLUCINATION:
|
||||
if (Hallucination || Halluc_resistance)
|
||||
nothing++;
|
||||
g.potion_nothing++;
|
||||
(void) make_hallucinated(itimeout_incr(HHallucination,
|
||||
rn1(200, 600 - 300 * bcsign(otmp))),
|
||||
TRUE, 0L);
|
||||
@@ -618,7 +615,7 @@ register struct obj *otmp;
|
||||
newuhs(FALSE);
|
||||
break;
|
||||
}
|
||||
unkn++;
|
||||
g.potion_unkn++;
|
||||
if (is_undead(youmonst.data) || is_demon(youmonst.data)
|
||||
|| u.ualign.type == A_CHAOTIC) {
|
||||
if (otmp->blessed) {
|
||||
@@ -663,7 +660,7 @@ register struct obj *otmp;
|
||||
}
|
||||
break;
|
||||
case POT_BOOZE:
|
||||
unkn++;
|
||||
g.potion_unkn++;
|
||||
pline("Ooph! This tastes like %s%s!",
|
||||
otmp->odiluted ? "watered down " : "",
|
||||
Hallucination ? "dandelion wine" : "liquid fire");
|
||||
@@ -683,7 +680,7 @@ register struct obj *otmp;
|
||||
break;
|
||||
case POT_ENLIGHTENMENT:
|
||||
if (otmp->cursed) {
|
||||
unkn++;
|
||||
g.potion_unkn++;
|
||||
You("have an uneasy feeling...");
|
||||
exercise(A_WIS, FALSE);
|
||||
} else {
|
||||
@@ -707,7 +704,7 @@ register struct obj *otmp;
|
||||
/* FALLTHRU */
|
||||
case POT_INVISIBILITY:
|
||||
if (Invis || Blind || BInvis) {
|
||||
nothing++;
|
||||
g.potion_nothing++;
|
||||
} else {
|
||||
self_invis_message();
|
||||
}
|
||||
@@ -725,7 +722,7 @@ register struct obj *otmp;
|
||||
case POT_FRUIT_JUICE: {
|
||||
int msg = Invisible && !Blind;
|
||||
|
||||
unkn++;
|
||||
g.potion_unkn++;
|
||||
if (otmp->cursed)
|
||||
pline("Yecch! This tastes %s.",
|
||||
Hallucination ? "overripe" : "rotten");
|
||||
@@ -755,7 +752,7 @@ register struct obj *otmp;
|
||||
newsym(u.ux, u.uy); /* see yourself! */
|
||||
if (msg && !Blind) { /* Blind possible if polymorphed */
|
||||
You("can see through yourself, but you are visible!");
|
||||
unkn--;
|
||||
g.potion_unkn--;
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -790,8 +787,8 @@ register struct obj *otmp;
|
||||
int x, y;
|
||||
|
||||
if (Detect_monsters)
|
||||
nothing++;
|
||||
unkn++;
|
||||
g.potion_nothing++;
|
||||
g.potion_unkn++;
|
||||
/* after a while, repeated uses become less effective */
|
||||
if ((HDetect_monsters & TIMEOUT) >= 300L)
|
||||
i = 1;
|
||||
@@ -805,11 +802,11 @@ register struct obj *otmp;
|
||||
newsym(x, y);
|
||||
}
|
||||
if (MON_AT(x, y))
|
||||
unkn = 0;
|
||||
g.potion_unkn = 0;
|
||||
}
|
||||
}
|
||||
see_monsters();
|
||||
if (unkn)
|
||||
if (g.potion_unkn)
|
||||
You_feel("lonely.");
|
||||
break;
|
||||
}
|
||||
@@ -874,11 +871,11 @@ register struct obj *otmp;
|
||||
if (!Confusion) {
|
||||
if (Hallucination) {
|
||||
pline("What a trippy feeling!");
|
||||
unkn++;
|
||||
g.potion_unkn++;
|
||||
} else
|
||||
pline("Huh, What? Where am I?");
|
||||
} else
|
||||
nothing++;
|
||||
g.potion_nothing++;
|
||||
make_confused(itimeout_incr(HConfusion,
|
||||
rn1(7, 16 - 8 * bcsign(otmp))),
|
||||
FALSE);
|
||||
@@ -886,9 +883,9 @@ register struct obj *otmp;
|
||||
case POT_GAIN_ABILITY:
|
||||
if (otmp->cursed) {
|
||||
pline("Ulch! That potion tasted foul!");
|
||||
unkn++;
|
||||
g.potion_unkn++;
|
||||
} else if (Fixed_abil) {
|
||||
nothing++;
|
||||
g.potion_nothing++;
|
||||
} else { /* If blessed, increase all; if not, try up to */
|
||||
int itmp; /* 6 times to find one which can be increased. */
|
||||
|
||||
@@ -907,7 +904,7 @@ register struct obj *otmp;
|
||||
/* skip when mounted; heal_legs() would heal steed's legs */
|
||||
if (Wounded_legs && !otmp->cursed && !u.usteed) {
|
||||
heal_legs(0);
|
||||
unkn++;
|
||||
g.potion_unkn++;
|
||||
break;
|
||||
}
|
||||
/* FALLTHRU */
|
||||
@@ -916,21 +913,21 @@ register struct obj *otmp;
|
||||
You("are suddenly moving %sfaster.", Fast ? "" : "much ");
|
||||
} else {
|
||||
Your("%s get new energy.", makeplural(body_part(LEG)));
|
||||
unkn++;
|
||||
g.potion_unkn++;
|
||||
}
|
||||
exercise(A_DEX, TRUE);
|
||||
incr_itimeout(&HFast, rn1(10, 100 + 60 * bcsign(otmp)));
|
||||
break;
|
||||
case POT_BLINDNESS:
|
||||
if (Blind)
|
||||
nothing++;
|
||||
g.potion_nothing++;
|
||||
make_blinded(itimeout_incr(Blinded,
|
||||
rn1(200, 250 - 125 * bcsign(otmp))),
|
||||
(boolean) !Blind);
|
||||
break;
|
||||
case POT_GAIN_LEVEL:
|
||||
if (otmp->cursed) {
|
||||
unkn++;
|
||||
g.potion_unkn++;
|
||||
/* they went up a level */
|
||||
if ((ledger_no(&u.uz) == 1 && u.uhave.amulet)
|
||||
|| Can_rise_up(u.ux, u.uy, &u.uz)) {
|
||||
@@ -1008,7 +1005,7 @@ register struct obj *otmp;
|
||||
that cursed effect yields "you float down" on next turn.
|
||||
Blessed and uncursed get one extra turn duration. */
|
||||
} else /* already levitating, or can't levitate */
|
||||
nothing++;
|
||||
g.potion_nothing++;
|
||||
|
||||
if (otmp->cursed) {
|
||||
/* 'already levitating' used to block the cursed effect(s)
|
||||
@@ -1023,7 +1020,7 @@ register struct obj *otmp;
|
||||
(void) doup();
|
||||
/* in case we're already Levitating, which would have
|
||||
resulted in incrementing 'nothing' */
|
||||
nothing = 0; /* not nothing after all */
|
||||
g.potion_nothing = 0; /* not nothing after all */
|
||||
} else if (has_ceiling(&u.uz)) {
|
||||
int dmg = rnd(!uarmh ? 10 : !is_metallic(uarmh) ? 6 : 3);
|
||||
|
||||
@@ -1031,7 +1028,7 @@ register struct obj *otmp;
|
||||
ceiling(u.ux, u.uy));
|
||||
losehp(Maybe_Half_Phys(dmg), "colliding with the ceiling",
|
||||
KILLED_BY);
|
||||
nothing = 0; /* not nothing after all */
|
||||
g.potion_nothing = 0; /* not nothing after all */
|
||||
}
|
||||
} else if (otmp->blessed) {
|
||||
/* at this point, timeout is already at least 1 */
|
||||
@@ -1115,7 +1112,7 @@ register struct obj *otmp;
|
||||
}
|
||||
if (Stoned)
|
||||
fix_petrification();
|
||||
unkn++; /* holy/unholy water can burn like acid too */
|
||||
g.potion_unkn++; /* holy/unholy water can burn like acid too */
|
||||
break;
|
||||
case POT_POLYMORPH:
|
||||
You_feel("a little %s.", Hallucination ? "normal" : "strange");
|
||||
@@ -1314,7 +1311,7 @@ int how;
|
||||
FALSE)));
|
||||
} else if (has_head(mon->data)) {
|
||||
Sprintf(buf, "%s %s", s_suffix(mnam),
|
||||
(notonhead ? "body" : "head"));
|
||||
(g.notonhead ? "body" : "head"));
|
||||
} else {
|
||||
Strcpy(buf, mnam);
|
||||
}
|
||||
|
||||
@@ -769,7 +769,7 @@ const struct Align aligns[] = {
|
||||
static struct {
|
||||
boolean roles[SIZE(roles)];
|
||||
short mask;
|
||||
} rfilter = UNDEFINED_VALUE;
|
||||
} rfilter = UNDEFINED_VALUES;
|
||||
|
||||
STATIC_DCL int NDECL(randrole_filtered);
|
||||
STATIC_DCL char *FDECL(promptsep, (char *, int));
|
||||
|
||||
@@ -24,8 +24,6 @@ STATIC_DCL boolean FDECL(hmonas, (struct monst *));
|
||||
STATIC_DCL void FDECL(nohandglow, (struct monst *));
|
||||
STATIC_DCL boolean FDECL(shade_aware, (struct obj *));
|
||||
|
||||
extern boolean notonhead; /* for long worms */
|
||||
|
||||
#define PROJECTILE(obj) ((obj) && is_ammo(obj))
|
||||
|
||||
void
|
||||
@@ -467,7 +465,7 @@ int dieroll;
|
||||
|
||||
/* we hit the monster; be careful: it might die or
|
||||
be knocked into a different location */
|
||||
notonhead = (mon->mx != x || mon->my != y);
|
||||
g.notonhead = (mon->mx != x || mon->my != y);
|
||||
malive = hmon(mon, weapon, HMON_MELEE, dieroll);
|
||||
if (malive) {
|
||||
/* monster still alive */
|
||||
@@ -1808,7 +1806,7 @@ register struct attack *mattk;
|
||||
case AD_DRIN: {
|
||||
struct obj *helmet;
|
||||
|
||||
if (notonhead || !has_head(pd)) {
|
||||
if (g.notonhead || !has_head(pd)) {
|
||||
pline("%s doesn't seem harmed.", Monnam(mdef));
|
||||
tmp = 0;
|
||||
if (!Unchanging && pd == &mons[PM_GREEN_SLIME]) {
|
||||
|
||||
12
src/zap.c
12
src/zap.c
@@ -12,8 +12,6 @@
|
||||
*/
|
||||
#define MAGIC_COOKIE 1000
|
||||
|
||||
extern boolean notonhead; /* for long worms */
|
||||
|
||||
STATIC_DCL void FDECL(polyuse, (struct obj *, int, int));
|
||||
STATIC_DCL void FDECL(create_polymon, (struct obj *, int));
|
||||
STATIC_DCL int FDECL(stone_to_flesh_obj, (struct obj *));
|
||||
@@ -142,7 +140,7 @@ struct obj *otmp;
|
||||
if (u.uswallow && mtmp == u.ustuck)
|
||||
reveal_invis = FALSE;
|
||||
|
||||
notonhead = (mtmp->mx != bhitpos.x || mtmp->my != bhitpos.y);
|
||||
g.notonhead = (mtmp->mx != bhitpos.x || mtmp->my != bhitpos.y);
|
||||
skilled_spell = (otmp && otmp->oclass == SPBOOK_CLASS && otmp->blessed);
|
||||
|
||||
switch (otyp) {
|
||||
@@ -479,7 +477,7 @@ struct monst *mtmp;
|
||||
struct obj *otmp;
|
||||
|
||||
mstatusline(mtmp);
|
||||
if (notonhead)
|
||||
if (g.notonhead)
|
||||
return; /* don't show minvent for long worm tail */
|
||||
|
||||
if (mtmp->minvent) {
|
||||
@@ -2607,7 +2605,7 @@ struct obj *obj; /* wand or spell */
|
||||
int steedhit = FALSE;
|
||||
|
||||
bhitpos.x = u.usteed->mx, bhitpos.y = u.usteed->my;
|
||||
notonhead = FALSE;
|
||||
g.notonhead = FALSE;
|
||||
switch (obj->otyp) {
|
||||
/*
|
||||
* Wands that are allowed to hit the steed
|
||||
@@ -3290,7 +3288,7 @@ struct obj **pobj; /* object tossed/used, set to NULL
|
||||
}
|
||||
|
||||
if (mtmp && !(in_skip && M_IN_WATER(mtmp->data))) {
|
||||
notonhead = (bhitpos.x != mtmp->mx || bhitpos.y != mtmp->my);
|
||||
g.notonhead = (bhitpos.x != mtmp->mx || bhitpos.y != mtmp->my);
|
||||
if (weapon == FLASHED_LIGHT) {
|
||||
/* FLASHED_LIGHT hitting invisible monster should
|
||||
pass through instead of stop so we call
|
||||
@@ -4038,7 +4036,7 @@ boolean say; /* Announce out of sight hit/miss events if true */
|
||||
if (type >= 0)
|
||||
mon->mstrategy &= ~STRAT_WAITMASK;
|
||||
buzzmonst:
|
||||
notonhead = (mon->mx != bhitpos.x || mon->my != bhitpos.y);
|
||||
g.notonhead = (mon->mx != bhitpos.x || mon->my != bhitpos.y);
|
||||
if (zap_hit(find_mac(mon), spell_type)) {
|
||||
if (mon_reflects(mon, (char *) 0)) {
|
||||
if (cansee(mon->mx, mon->my)) {
|
||||
|
||||
Reference in New Issue
Block a user