First set of changes to move globals to instance_globals.
This commit is contained in:
17
src/uhitm.c
17
src/uhitm.c
@@ -24,11 +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 */
|
||||
|
||||
/* Used to flag attacks caused by Stormbringer's maliciousness. */
|
||||
static boolean override_confirmation = FALSE;
|
||||
|
||||
#define PROJECTILE(obj) ((obj) && is_ammo(obj))
|
||||
|
||||
void
|
||||
@@ -213,7 +208,7 @@ struct obj *wep; /* uwep for attack(), null for kick_monster() */
|
||||
&& !Confusion && !Hallucination && !Stunned) {
|
||||
/* Intelligent chaotic weapons (Stormbringer) want blood */
|
||||
if (wep && wep->oartifact == ART_STORMBRINGER) {
|
||||
override_confirmation = TRUE;
|
||||
g.override_confirmation = TRUE;
|
||||
return FALSE;
|
||||
}
|
||||
if (canspotmon(mtmp)) {
|
||||
@@ -387,7 +382,7 @@ register struct monst *mtmp;
|
||||
|
||||
/* possibly set in attack_checks;
|
||||
examined in known_hitum, called via hitum or hmonas below */
|
||||
override_confirmation = FALSE;
|
||||
g.override_confirmation = FALSE;
|
||||
/* attack_checks() used to use <u.ux+u.dx,u.uy+u.dy> directly, now
|
||||
it uses bhitpos instead; it might map an invisible monster there */
|
||||
bhitpos.x = u.ux + u.dx;
|
||||
@@ -470,7 +465,7 @@ int dieroll;
|
||||
/* hmon() might destroy weapon; remember aspect for cutworm */
|
||||
slice_or_chop = (weapon && (is_blade(weapon) || is_axe(weapon)));
|
||||
|
||||
if (override_confirmation) {
|
||||
if (g.override_confirmation) {
|
||||
/* this may need to be generalized if weapons other than
|
||||
Stormbringer acquire similar anti-social behavior... */
|
||||
if (flags.verbose)
|
||||
@@ -489,7 +484,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 */
|
||||
@@ -623,7 +618,7 @@ struct attack *uattk;
|
||||
/* second attack for two-weapon combat; won't occur if Stormbringer
|
||||
overrode confirmation (assumes Stormbringer is primary weapon)
|
||||
or if the monster was killed or knocked to different location */
|
||||
if (u.twoweap && !override_confirmation && malive && m_at(x, y) == mon) {
|
||||
if (u.twoweap && !g.override_confirmation && malive && m_at(x, y) == mon) {
|
||||
tmp = find_roll_to_hit(mon, uattk->aatyp, uswapwep, &attknum,
|
||||
&armorpenalty);
|
||||
dieroll = rnd(20);
|
||||
@@ -1830,7 +1825,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]) {
|
||||
|
||||
Reference in New Issue
Block a user