Revert "Renamed instance_variables to global_variables and iv to g."
This reverts commit f9a0db6c44.
This commit is contained in:
+5
-5
@@ -438,13 +438,13 @@ struct early_opt {
|
|||||||
boolean valallowed;
|
boolean valallowed;
|
||||||
};
|
};
|
||||||
|
|
||||||
/* instance_globals holds engine state that does not need to be
|
/* instance_variables holds engine state that does not need to be
|
||||||
* persisted upon game exit. The initialization state is well defined
|
* persisted upon game exit. The initialization state is well defined
|
||||||
* an set in decl.c during early early engine initialization.
|
* an set in decl.c during early early engine initialization.
|
||||||
*
|
*
|
||||||
* unlike instance_flags, values in the structure can be of any type. */
|
* unlike instance_flags, variables can be of any type. */
|
||||||
|
|
||||||
struct instance_globals {
|
struct instance_variables {
|
||||||
/* apply.c */
|
/* apply.c */
|
||||||
int jumping_is_magic; /* current jump result of magic */
|
int jumping_is_magic; /* current jump result of magic */
|
||||||
int polearm_range_min;
|
int polearm_range_min;
|
||||||
@@ -485,9 +485,9 @@ struct instance_globals {
|
|||||||
unsigned long magic; /* validate that structure layout is preserved */
|
unsigned long magic; /* validate that structure layout is preserved */
|
||||||
};
|
};
|
||||||
|
|
||||||
E struct instance_globals g;
|
E struct instance_variables iv;
|
||||||
|
|
||||||
E void instance_globals_init();
|
E void instance_variable_init();
|
||||||
|
|
||||||
|
|
||||||
#undef E
|
#undef E
|
||||||
|
|||||||
+1
-1
@@ -9,7 +9,7 @@
|
|||||||
/*
|
/*
|
||||||
* The dungeon presentation graphics code and data structures were rewritten
|
* The dungeon presentation graphics code and data structures were rewritten
|
||||||
* and generalized for NetHack's release 2 by Eric S. Raymond (eric@snark)
|
* and generalized for NetHack's release 2 by Eric S. Raymond (eric@snark)
|
||||||
* building on Don G Kneller's MS-DOS implementation. See drawing.c for
|
* building on Don G. Kneller's MS-DOS implementation. See drawing.c for
|
||||||
* the code that permits the user to set the contents of the symbol structure.
|
* the code that permits the user to set the contents of the symbol structure.
|
||||||
*
|
*
|
||||||
* The door representation was changed by Ari
|
* The door representation was changed by Ari
|
||||||
|
|||||||
+6
-6
@@ -1606,7 +1606,7 @@ int x,y;
|
|||||||
{
|
{
|
||||||
return (isok(x, y)
|
return (isok(x, y)
|
||||||
&& (ACCESSIBLE(levl[x][y].typ) || Passes_walls)
|
&& (ACCESSIBLE(levl[x][y].typ) || Passes_walls)
|
||||||
&& is_valid_jump_pos(x, y, g.jumping_is_magic, FALSE));
|
&& is_valid_jump_pos(x, y, iv.jumping_is_magic, FALSE));
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -1720,7 +1720,7 @@ int magic; /* 0=Physical, otherwise skill level */
|
|||||||
pline("Where do you want to jump?");
|
pline("Where do you want to jump?");
|
||||||
cc.x = u.ux;
|
cc.x = u.ux;
|
||||||
cc.y = u.uy;
|
cc.y = u.uy;
|
||||||
g.jumping_is_magic = magic;
|
iv.jumping_is_magic = magic;
|
||||||
getpos_sethilite(display_jump_positions, get_valid_jump_position);
|
getpos_sethilite(display_jump_positions, get_valid_jump_position);
|
||||||
if (getpos(&cc, TRUE, "the desired position") < 0)
|
if (getpos(&cc, TRUE, "the desired position") < 0)
|
||||||
return 0; /* user pressed ESC */
|
return 0; /* user pressed ESC */
|
||||||
@@ -2917,8 +2917,8 @@ get_valid_polearm_position(x, y)
|
|||||||
int x, y;
|
int x, y;
|
||||||
{
|
{
|
||||||
return (isok(x, y) && ACCESSIBLE(levl[x][y].typ)
|
return (isok(x, y) && ACCESSIBLE(levl[x][y].typ)
|
||||||
&& distu(x, y) >= g.polearm_range_min
|
&& distu(x, y) >= iv.polearm_range_min
|
||||||
&& distu(x, y) <= g.polearm_range_max);
|
&& distu(x, y) <= iv.polearm_range_max);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -2990,8 +2990,8 @@ struct obj *obj;
|
|||||||
else
|
else
|
||||||
max_range = 8; /* (P_SKILL(typ) >= P_EXPERT) */
|
max_range = 8; /* (P_SKILL(typ) >= P_EXPERT) */
|
||||||
|
|
||||||
g.polearm_range_min = min_range;
|
iv.polearm_range_min = min_range;
|
||||||
g.polearm_range_max = max_range;
|
iv.polearm_range_max = max_range;
|
||||||
|
|
||||||
/* Prompt for a location */
|
/* Prompt for a location */
|
||||||
pline(where_to_hit);
|
pline(where_to_hit);
|
||||||
|
|||||||
+16
-16
@@ -844,15 +844,15 @@ int tmp;
|
|||||||
|
|
||||||
if (!weap || (weap->attk.adtyp == AD_PHYS /* check for `NO_ATTK' */
|
if (!weap || (weap->attk.adtyp == AD_PHYS /* check for `NO_ATTK' */
|
||||||
&& weap->attk.damn == 0 && weap->attk.damd == 0))
|
&& weap->attk.damn == 0 && weap->attk.damd == 0))
|
||||||
g.spec_dbon_applies = FALSE;
|
iv.spec_dbon_applies = FALSE;
|
||||||
else if (otmp->oartifact == ART_GRIMTOOTH)
|
else if (otmp->oartifact == ART_GRIMTOOTH)
|
||||||
/* Grimtooth has SPFX settings to warn against elves but we want its
|
/* Grimtooth has SPFX settings to warn against elves but we want its
|
||||||
damage bonus to apply to all targets, so bypass spec_applies() */
|
damage bonus to apply to all targets, so bypass spec_applies() */
|
||||||
g.spec_dbon_applies = TRUE;
|
iv.spec_dbon_applies = TRUE;
|
||||||
else
|
else
|
||||||
g.spec_dbon_applies = spec_applies(weap, mon);
|
iv.spec_dbon_applies = spec_applies(weap, mon);
|
||||||
|
|
||||||
if (g.spec_dbon_applies)
|
if (iv.spec_dbon_applies)
|
||||||
return weap->attk.damd ? rnd((int) weap->attk.damd) : max(tmp, 1);
|
return weap->attk.damd ? rnd((int) weap->attk.damd) : max(tmp, 1);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -976,14 +976,14 @@ char *hittee; /* target's name: "you" or mon_nam(mdef) */
|
|||||||
scare_dieroll /= (1 << (mb->spe / 3));
|
scare_dieroll /= (1 << (mb->spe / 3));
|
||||||
/* if target successfully resisted the artifact damage bonus,
|
/* if target successfully resisted the artifact damage bonus,
|
||||||
reduce overall likelihood of the assorted special effects */
|
reduce overall likelihood of the assorted special effects */
|
||||||
if (!g.spec_dbon_applies)
|
if (!iv.spec_dbon_applies)
|
||||||
dieroll += 1;
|
dieroll += 1;
|
||||||
|
|
||||||
/* might stun even when attempting a more severe effect, but
|
/* might stun even when attempting a more severe effect, but
|
||||||
in that case it will only happen if the other effect fails;
|
in that case it will only happen if the other effect fails;
|
||||||
extra damage will apply regardless; 3.4.1: sometimes might
|
extra damage will apply regardless; 3.4.1: sometimes might
|
||||||
just probe even when it hasn't been enchanted */
|
just probe even when it hasn't been enchanted */
|
||||||
do_stun = (max(mb->spe, 0) < rn2(g.spec_dbon_applies ? 11 : 7));
|
do_stun = (max(mb->spe, 0) < rn2(iv.spec_dbon_applies ? 11 : 7));
|
||||||
|
|
||||||
/* the special effects also boost physical damage; increments are
|
/* the special effects also boost physical damage; increments are
|
||||||
generally cumulative, but since the stun effect is based on a
|
generally cumulative, but since the stun effect is based on a
|
||||||
@@ -1182,12 +1182,12 @@ int dieroll; /* needed for Magicbane and vorpal blades */
|
|||||||
if (attacks(AD_FIRE, otmp)) {
|
if (attacks(AD_FIRE, otmp)) {
|
||||||
if (realizes_damage)
|
if (realizes_damage)
|
||||||
pline_The("fiery blade %s %s%c",
|
pline_The("fiery blade %s %s%c",
|
||||||
!g.spec_dbon_applies
|
!iv.spec_dbon_applies
|
||||||
? "hits"
|
? "hits"
|
||||||
: (mdef->data == &mons[PM_WATER_ELEMENTAL])
|
: (mdef->data == &mons[PM_WATER_ELEMENTAL])
|
||||||
? "vaporizes part of"
|
? "vaporizes part of"
|
||||||
: "burns",
|
: "burns",
|
||||||
hittee, !g.spec_dbon_applies ? '.' : '!');
|
hittee, !iv.spec_dbon_applies ? '.' : '!');
|
||||||
if (!rn2(4))
|
if (!rn2(4))
|
||||||
(void) destroy_mitem(mdef, POTION_CLASS, AD_FIRE);
|
(void) destroy_mitem(mdef, POTION_CLASS, AD_FIRE);
|
||||||
if (!rn2(4))
|
if (!rn2(4))
|
||||||
@@ -1201,8 +1201,8 @@ int dieroll; /* needed for Magicbane and vorpal blades */
|
|||||||
if (attacks(AD_COLD, otmp)) {
|
if (attacks(AD_COLD, otmp)) {
|
||||||
if (realizes_damage)
|
if (realizes_damage)
|
||||||
pline_The("ice-cold blade %s %s%c",
|
pline_The("ice-cold blade %s %s%c",
|
||||||
!g.spec_dbon_applies ? "hits" : "freezes", hittee,
|
!iv.spec_dbon_applies ? "hits" : "freezes", hittee,
|
||||||
!g.spec_dbon_applies ? '.' : '!');
|
!iv.spec_dbon_applies ? '.' : '!');
|
||||||
if (!rn2(4))
|
if (!rn2(4))
|
||||||
(void) destroy_mitem(mdef, POTION_CLASS, AD_COLD);
|
(void) destroy_mitem(mdef, POTION_CLASS, AD_COLD);
|
||||||
return realizes_damage;
|
return realizes_damage;
|
||||||
@@ -1210,9 +1210,9 @@ int dieroll; /* needed for Magicbane and vorpal blades */
|
|||||||
if (attacks(AD_ELEC, otmp)) {
|
if (attacks(AD_ELEC, otmp)) {
|
||||||
if (realizes_damage)
|
if (realizes_damage)
|
||||||
pline_The("massive hammer hits%s %s%c",
|
pline_The("massive hammer hits%s %s%c",
|
||||||
!g.spec_dbon_applies ? "" : "! Lightning strikes",
|
!iv.spec_dbon_applies ? "" : "! Lightning strikes",
|
||||||
hittee, !g.spec_dbon_applies ? '.' : '!');
|
hittee, !iv.spec_dbon_applies ? '.' : '!');
|
||||||
if (g.spec_dbon_applies)
|
if (iv.spec_dbon_applies)
|
||||||
wake_nearto(mdef->mx, mdef->my, 4 * 4);
|
wake_nearto(mdef->mx, mdef->my, 4 * 4);
|
||||||
if (!rn2(5))
|
if (!rn2(5))
|
||||||
(void) destroy_mitem(mdef, RING_CLASS, AD_ELEC);
|
(void) destroy_mitem(mdef, RING_CLASS, AD_ELEC);
|
||||||
@@ -1223,10 +1223,10 @@ int dieroll; /* needed for Magicbane and vorpal blades */
|
|||||||
if (attacks(AD_MAGM, otmp)) {
|
if (attacks(AD_MAGM, otmp)) {
|
||||||
if (realizes_damage)
|
if (realizes_damage)
|
||||||
pline_The("imaginary widget hits%s %s%c",
|
pline_The("imaginary widget hits%s %s%c",
|
||||||
!g.spec_dbon_applies
|
!iv.spec_dbon_applies
|
||||||
? ""
|
? ""
|
||||||
: "! A hail of magic missiles strikes",
|
: "! A hail of magic missiles strikes",
|
||||||
hittee, !g.spec_dbon_applies ? '.' : '!');
|
hittee, !iv.spec_dbon_applies ? '.' : '!');
|
||||||
return realizes_damage;
|
return realizes_damage;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1235,7 +1235,7 @@ int dieroll; /* needed for Magicbane and vorpal blades */
|
|||||||
return Mb_hit(magr, mdef, otmp, dmgptr, dieroll, vis, hittee);
|
return Mb_hit(magr, mdef, otmp, dmgptr, dieroll, vis, hittee);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!g.spec_dbon_applies) {
|
if (!iv.spec_dbon_applies) {
|
||||||
/* since damage bonus didn't apply, nothing more to do;
|
/* since damage bonus didn't apply, nothing more to do;
|
||||||
no further attacks have side-effects on inventory */
|
no further attacks have side-effects on inventory */
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|||||||
+2
-2
@@ -64,7 +64,7 @@ do_statusline1()
|
|||||||
Strcpy(nb = eos(nb), rank());
|
Strcpy(nb = eos(nb), rank());
|
||||||
|
|
||||||
Sprintf(nb = eos(nb), " ");
|
Sprintf(nb = eos(nb), " ");
|
||||||
i = g.mrank_sz + 15;
|
i = iv.mrank_sz + 15;
|
||||||
j = (int) ((nb + 2) - newbot1); /* strlen(newbot1) but less computation */
|
j = (int) ((nb + 2) - newbot1); /* strlen(newbot1) but less computation */
|
||||||
if ((i - j) > 0)
|
if ((i - j) > 0)
|
||||||
Sprintf(nb = eos(nb), "%*s", i - j, " "); /* pad with spaces */
|
Sprintf(nb = eos(nb), "%*s", i - j, " "); /* pad with spaces */
|
||||||
@@ -345,7 +345,7 @@ max_rank_sz()
|
|||||||
if (urole.rank[i].f && (r = strlen(urole.rank[i].f)) > maxr)
|
if (urole.rank[i].f && (r = strlen(urole.rank[i].f)) > maxr)
|
||||||
maxr = r;
|
maxr = r;
|
||||||
}
|
}
|
||||||
g.mrank_sz = maxr;
|
iv.mrank_sz = maxr;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+6
-6
@@ -329,7 +329,7 @@ decl_init()
|
|||||||
#define UNDEFINED_PTR NULL /* move to hack.h if we are keeping */
|
#define UNDEFINED_PTR NULL /* move to hack.h if we are keeping */
|
||||||
#define IVMAGIC 0xdeadbeef
|
#define IVMAGIC 0xdeadbeef
|
||||||
|
|
||||||
const struct instance_globals g_init = {
|
const struct instance_variables iv_init = {
|
||||||
/* apply.c */
|
/* apply.c */
|
||||||
0, /* jumping_is_magic */
|
0, /* jumping_is_magic */
|
||||||
-1, /* polearm_range_min */
|
-1, /* polearm_range_min */
|
||||||
@@ -366,15 +366,15 @@ const struct instance_globals g_init = {
|
|||||||
IVMAGIC /* used to validate that structure layout has been preserved */
|
IVMAGIC /* used to validate that structure layout has been preserved */
|
||||||
};
|
};
|
||||||
|
|
||||||
struct instance_globals g;
|
struct instance_variables iv;
|
||||||
|
|
||||||
void
|
void
|
||||||
instance_globals_init()
|
instance_variable_init()
|
||||||
{
|
{
|
||||||
g = g_init;
|
iv = iv_init;
|
||||||
|
|
||||||
nhassert(g_init.magic == IVMAGIC);
|
nhassert(iv_init.magic == IVMAGIC);
|
||||||
nhassert(g_init.havestate == TRUE);
|
nhassert(iv.havestate == TRUE);
|
||||||
|
|
||||||
sfcap = default_sfinfo;
|
sfcap = default_sfinfo;
|
||||||
sfrestinfo = default_sfinfo;
|
sfrestinfo = default_sfinfo;
|
||||||
|
|||||||
@@ -197,7 +197,7 @@ makedog()
|
|||||||
put_saddle_on_mon(otmp, mtmp);
|
put_saddle_on_mon(otmp, mtmp);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!g.petname_used++ && *petname)
|
if (!iv.petname_used++ && *petname)
|
||||||
mtmp = christen_monst(mtmp, petname);
|
mtmp = christen_monst(mtmp, petname);
|
||||||
|
|
||||||
initedog(mtmp);
|
initedog(mtmp);
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ register struct obj *obj;
|
|||||||
|| (obj->otyp == EGG));
|
|| (obj->otyp == EGG));
|
||||||
|
|
||||||
if (u.umonnum == PM_GELATINOUS_CUBE && is_organic(obj)
|
if (u.umonnum == PM_GELATINOUS_CUBE && is_organic(obj)
|
||||||
/* [g-cubes can eat containers and retain all contents
|
/* [g.cubes can eat containers and retain all contents
|
||||||
as engulfed items, but poly'd player can't do that] */
|
as engulfed items, but poly'd player can't do that] */
|
||||||
&& !Has_contents(obj))
|
&& !Has_contents(obj))
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|||||||
@@ -921,7 +921,7 @@ struct monst *mtmp;
|
|||||||
|
|
||||||
/* eat organic objects, including cloth and wood, if present;
|
/* eat organic objects, including cloth and wood, if present;
|
||||||
engulf others, except huge rocks and metal attached to player
|
engulf others, except huge rocks and metal attached to player
|
||||||
[despite comment at top, doesn't assume that eater is a g-cube] */
|
[despite comment at top, doesn't assume that eater is a g.cube] */
|
||||||
for (otmp = level.objects[mtmp->mx][mtmp->my]; otmp; otmp = otmp2) {
|
for (otmp = level.objects[mtmp->mx][mtmp->my]; otmp; otmp = otmp2) {
|
||||||
otmp2 = otmp->nexthere;
|
otmp2 = otmp->nexthere;
|
||||||
|
|
||||||
@@ -996,7 +996,7 @@ struct monst *mtmp;
|
|||||||
register struct obj *otmp3;
|
register struct obj *otmp3;
|
||||||
|
|
||||||
/* contents of eaten containers become engulfed; this
|
/* contents of eaten containers become engulfed; this
|
||||||
is arbitrary, but otherwise g-cubes are too powerful */
|
is arbitrary, but otherwise g.cubes are too powerful */
|
||||||
while ((otmp3 = otmp->cobj) != 0) {
|
while ((otmp3 = otmp->cobj) != 0) {
|
||||||
obj_extract_self(otmp3);
|
obj_extract_self(otmp3);
|
||||||
if (otmp->otyp == ICE_BOX && otmp3->otyp == CORPSE) {
|
if (otmp->otyp == ICE_BOX && otmp3->otyp == CORPSE) {
|
||||||
|
|||||||
+8
-8
@@ -668,12 +668,12 @@ struct monst *mtmp;
|
|||||||
zap_oseen = oseen;
|
zap_oseen = oseen;
|
||||||
mzapmsg(mtmp, otmp, FALSE);
|
mzapmsg(mtmp, otmp, FALSE);
|
||||||
otmp->spe--;
|
otmp->spe--;
|
||||||
g.m_using = TRUE;
|
iv.m_using = TRUE;
|
||||||
mbhit(mtmp, rn1(8, 6), mbhitm, bhito, otmp);
|
mbhit(mtmp, rn1(8, 6), mbhitm, bhito, otmp);
|
||||||
/* monster learns that teleportation isn't useful here */
|
/* monster learns that teleportation isn't useful here */
|
||||||
if (level.flags.noteleport)
|
if (level.flags.noteleport)
|
||||||
mtmp->mtrapseen |= (1 << (TELEP_TRAP - 1));
|
mtmp->mtrapseen |= (1 << (TELEP_TRAP - 1));
|
||||||
g.m_using = FALSE;
|
iv.m_using = FALSE;
|
||||||
return 2;
|
return 2;
|
||||||
case MUSE_SCR_TELEPORTATION: {
|
case MUSE_SCR_TELEPORTATION: {
|
||||||
int obj_is_cursed = otmp->cursed;
|
int obj_is_cursed = otmp->cursed;
|
||||||
@@ -1397,11 +1397,11 @@ struct monst *mtmp;
|
|||||||
otmp->spe--;
|
otmp->spe--;
|
||||||
if (oseen)
|
if (oseen)
|
||||||
makeknown(otmp->otyp);
|
makeknown(otmp->otyp);
|
||||||
g.m_using = TRUE;
|
iv.m_using = TRUE;
|
||||||
buzz((int) (-30 - (otmp->otyp - WAN_MAGIC_MISSILE)),
|
buzz((int) (-30 - (otmp->otyp - WAN_MAGIC_MISSILE)),
|
||||||
(otmp->otyp == WAN_MAGIC_MISSILE) ? 2 : 6, mtmp->mx, mtmp->my,
|
(otmp->otyp == WAN_MAGIC_MISSILE) ? 2 : 6, mtmp->mx, mtmp->my,
|
||||||
sgn(mtmp->mux - mtmp->mx), sgn(mtmp->muy - mtmp->my));
|
sgn(mtmp->mux - mtmp->mx), sgn(mtmp->muy - mtmp->my));
|
||||||
g.m_using = FALSE;
|
iv.m_using = FALSE;
|
||||||
return (DEADMONSTER(mtmp)) ? 1 : 2;
|
return (DEADMONSTER(mtmp)) ? 1 : 2;
|
||||||
case MUSE_FIRE_HORN:
|
case MUSE_FIRE_HORN:
|
||||||
case MUSE_FROST_HORN:
|
case MUSE_FROST_HORN:
|
||||||
@@ -1411,20 +1411,20 @@ struct monst *mtmp;
|
|||||||
} else
|
} else
|
||||||
You_hear("a horn being played.");
|
You_hear("a horn being played.");
|
||||||
otmp->spe--;
|
otmp->spe--;
|
||||||
g.m_using = TRUE;
|
iv.m_using = TRUE;
|
||||||
buzz(-30 - ((otmp->otyp == FROST_HORN) ? AD_COLD - 1 : AD_FIRE - 1),
|
buzz(-30 - ((otmp->otyp == FROST_HORN) ? AD_COLD - 1 : AD_FIRE - 1),
|
||||||
rn1(6, 6), mtmp->mx, mtmp->my, sgn(mtmp->mux - mtmp->mx),
|
rn1(6, 6), mtmp->mx, mtmp->my, sgn(mtmp->mux - mtmp->mx),
|
||||||
sgn(mtmp->muy - mtmp->my));
|
sgn(mtmp->muy - mtmp->my));
|
||||||
g.m_using = FALSE;
|
iv.m_using = FALSE;
|
||||||
return (DEADMONSTER(mtmp)) ? 1 : 2;
|
return (DEADMONSTER(mtmp)) ? 1 : 2;
|
||||||
case MUSE_WAN_TELEPORTATION:
|
case MUSE_WAN_TELEPORTATION:
|
||||||
case MUSE_WAN_STRIKING:
|
case MUSE_WAN_STRIKING:
|
||||||
zap_oseen = oseen;
|
zap_oseen = oseen;
|
||||||
mzapmsg(mtmp, otmp, FALSE);
|
mzapmsg(mtmp, otmp, FALSE);
|
||||||
otmp->spe--;
|
otmp->spe--;
|
||||||
g.m_using = TRUE;
|
iv.m_using = TRUE;
|
||||||
mbhit(mtmp, rn1(8, 6), mbhitm, bhito, otmp);
|
mbhit(mtmp, rn1(8, 6), mbhitm, bhito, otmp);
|
||||||
g.m_using = FALSE;
|
iv.m_using = FALSE;
|
||||||
return 2;
|
return 2;
|
||||||
case MUSE_SCR_EARTH: {
|
case MUSE_SCR_EARTH: {
|
||||||
/* TODO: handle steeds */
|
/* TODO: handle steeds */
|
||||||
|
|||||||
+3
-3
@@ -1558,7 +1558,7 @@ encumber_msg()
|
|||||||
{
|
{
|
||||||
int newcap = near_capacity();
|
int newcap = near_capacity();
|
||||||
|
|
||||||
if (g.oldcap < newcap) {
|
if (iv.oldcap < newcap) {
|
||||||
switch (newcap) {
|
switch (newcap) {
|
||||||
case 1:
|
case 1:
|
||||||
Your("movements are slowed slightly because of your load.");
|
Your("movements are slowed slightly because of your load.");
|
||||||
@@ -1576,7 +1576,7 @@ encumber_msg()
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
context.botl = 1;
|
context.botl = 1;
|
||||||
} else if (g.oldcap > newcap) {
|
} else if (iv.oldcap > newcap) {
|
||||||
switch (newcap) {
|
switch (newcap) {
|
||||||
case 0:
|
case 0:
|
||||||
Your("movements are now unencumbered.");
|
Your("movements are now unencumbered.");
|
||||||
@@ -1595,7 +1595,7 @@ encumber_msg()
|
|||||||
context.botl = 1;
|
context.botl = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
g.oldcap = newcap;
|
iv.oldcap = newcap;
|
||||||
return newcap;
|
return newcap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -899,7 +899,7 @@ register int fd;
|
|||||||
#ifdef MFLOPPY
|
#ifdef MFLOPPY
|
||||||
gameDiskPrompt();
|
gameDiskPrompt();
|
||||||
#endif
|
#endif
|
||||||
max_rank_sz(); /* to recompute g.mrank_sz (botl.c) */
|
max_rank_sz(); /* to recompute iv.mrank_sz (botl.c) */
|
||||||
/* take care of iron ball & chain */
|
/* take care of iron ball & chain */
|
||||||
for (otmp = fobj; otmp; otmp = otmp->nobj)
|
for (otmp = fobj; otmp; otmp = otmp->nobj)
|
||||||
if (otmp->owornmask)
|
if (otmp->owornmask)
|
||||||
|
|||||||
+10
-10
@@ -210,8 +210,8 @@ dosave0()
|
|||||||
store_version(fd);
|
store_version(fd);
|
||||||
store_savefileinfo(fd);
|
store_savefileinfo(fd);
|
||||||
store_plname_in_file(fd);
|
store_plname_in_file(fd);
|
||||||
g.ustuck_id = (u.ustuck ? u.ustuck->m_id : 0);
|
iv.ustuck_id = (u.ustuck ? u.ustuck->m_id : 0);
|
||||||
g.usteed_id = (u.usteed ? u.usteed->m_id : 0);
|
iv.usteed_id = (u.usteed ? u.usteed->m_id : 0);
|
||||||
savelev(fd, ledger_no(&u.uz), WRITE_SAVE | FREE_SAVE);
|
savelev(fd, ledger_no(&u.uz), WRITE_SAVE | FREE_SAVE);
|
||||||
savegamestate(fd, WRITE_SAVE | FREE_SAVE);
|
savegamestate(fd, WRITE_SAVE | FREE_SAVE);
|
||||||
|
|
||||||
@@ -333,10 +333,10 @@ register int fd, mode;
|
|||||||
sizeof(struct spell) * (MAXSPELL + 1));
|
sizeof(struct spell) * (MAXSPELL + 1));
|
||||||
save_artifacts(fd);
|
save_artifacts(fd);
|
||||||
save_oracles(fd, mode);
|
save_oracles(fd, mode);
|
||||||
if (g.ustuck_id)
|
if (iv.ustuck_id)
|
||||||
bwrite(fd, (genericptr_t) &g.ustuck_id, sizeof g.ustuck_id);
|
bwrite(fd, (genericptr_t) &iv.ustuck_id, sizeof iv.ustuck_id);
|
||||||
if (g.usteed_id)
|
if (iv.usteed_id)
|
||||||
bwrite(fd, (genericptr_t) &g.usteed_id, sizeof g.usteed_id);
|
bwrite(fd, (genericptr_t) &iv.usteed_id, sizeof iv.usteed_id);
|
||||||
bwrite(fd, (genericptr_t) pl_character, sizeof pl_character);
|
bwrite(fd, (genericptr_t) pl_character, sizeof pl_character);
|
||||||
bwrite(fd, (genericptr_t) pl_fruit, sizeof pl_fruit);
|
bwrite(fd, (genericptr_t) pl_fruit, sizeof pl_fruit);
|
||||||
savefruitchn(fd, mode);
|
savefruitchn(fd, mode);
|
||||||
@@ -379,7 +379,7 @@ savestateinlock()
|
|||||||
* noop pid rewriting will take place on the first "checkpoint" after
|
* noop pid rewriting will take place on the first "checkpoint" after
|
||||||
* the game is started or restored, if checkpointing is off.
|
* the game is started or restored, if checkpointing is off.
|
||||||
*/
|
*/
|
||||||
if (flags.ins_chkpt || g.havestate) {
|
if (flags.ins_chkpt || iv.havestate) {
|
||||||
/* save the rest of the current game state in the lock file,
|
/* save the rest of the current game state in the lock file,
|
||||||
* following the original int pid, the current level number,
|
* following the original int pid, the current level number,
|
||||||
* and the current savefile name, which should not be subject
|
* and the current savefile name, which should not be subject
|
||||||
@@ -417,13 +417,13 @@ savestateinlock()
|
|||||||
store_savefileinfo(fd);
|
store_savefileinfo(fd);
|
||||||
store_plname_in_file(fd);
|
store_plname_in_file(fd);
|
||||||
|
|
||||||
g.ustuck_id = (u.ustuck ? u.ustuck->m_id : 0);
|
iv.ustuck_id = (u.ustuck ? u.ustuck->m_id : 0);
|
||||||
g.usteed_id = (u.usteed ? u.usteed->m_id : 0);
|
iv.usteed_id = (u.usteed ? u.usteed->m_id : 0);
|
||||||
savegamestate(fd, WRITE_SAVE);
|
savegamestate(fd, WRITE_SAVE);
|
||||||
}
|
}
|
||||||
bclose(fd);
|
bclose(fd);
|
||||||
}
|
}
|
||||||
g.havestate = flags.ins_chkpt;
|
iv.havestate = flags.ins_chkpt;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
+11
-11
@@ -2160,7 +2160,7 @@ register struct monst *mtmp;
|
|||||||
} else {
|
} else {
|
||||||
register int tt = trap->ttyp;
|
register int tt = trap->ttyp;
|
||||||
boolean in_sight, tear_web, see_it,
|
boolean in_sight, tear_web, see_it,
|
||||||
inescapable = g.force_mintrap || ((tt == HOLE || tt == PIT)
|
inescapable = iv.force_mintrap || ((tt == HOLE || tt == PIT)
|
||||||
&& Sokoban && !trap->madeby_u);
|
&& Sokoban && !trap->madeby_u);
|
||||||
const char *fallverb;
|
const char *fallverb;
|
||||||
|
|
||||||
@@ -2276,7 +2276,7 @@ register struct monst *mtmp;
|
|||||||
|| mptr == &mons[PM_BUGBEAR])
|
|| mptr == &mons[PM_BUGBEAR])
|
||||||
You_hear("the roaring of an angry bear!");
|
You_hear("the roaring of an angry bear!");
|
||||||
}
|
}
|
||||||
} else if (g.force_mintrap) {
|
} else if (iv.force_mintrap) {
|
||||||
if (in_sight) {
|
if (in_sight) {
|
||||||
pline("%s evades %s bear trap!", Monnam(mtmp),
|
pline("%s evades %s bear trap!", Monnam(mtmp),
|
||||||
a_your[trap->madeby_u]);
|
a_your[trap->madeby_u]);
|
||||||
@@ -2425,7 +2425,7 @@ register struct monst *mtmp;
|
|||||||
if (is_flyer(mptr) || is_floater(mptr)
|
if (is_flyer(mptr) || is_floater(mptr)
|
||||||
|| (mtmp->wormno && count_wsegs(mtmp) > 5)
|
|| (mtmp->wormno && count_wsegs(mtmp) > 5)
|
||||||
|| is_clinger(mptr)) {
|
|| is_clinger(mptr)) {
|
||||||
if (g.force_mintrap && !Sokoban) {
|
if (iv.force_mintrap && !Sokoban) {
|
||||||
/* openfallingtrap; not inescapable here */
|
/* openfallingtrap; not inescapable here */
|
||||||
if (in_sight) {
|
if (in_sight) {
|
||||||
seetrap(trap);
|
seetrap(trap);
|
||||||
@@ -2462,7 +2462,7 @@ register struct monst *mtmp;
|
|||||||
if (is_flyer(mptr) || is_floater(mptr) || mptr == &mons[PM_WUMPUS]
|
if (is_flyer(mptr) || is_floater(mptr) || mptr == &mons[PM_WUMPUS]
|
||||||
|| (mtmp->wormno && count_wsegs(mtmp) > 5)
|
|| (mtmp->wormno && count_wsegs(mtmp) > 5)
|
||||||
|| mptr->msize >= MZ_HUGE) {
|
|| mptr->msize >= MZ_HUGE) {
|
||||||
if (g.force_mintrap && !Sokoban) {
|
if (iv.force_mintrap && !Sokoban) {
|
||||||
/* openfallingtrap; not inescapable here */
|
/* openfallingtrap; not inescapable here */
|
||||||
if (in_sight) {
|
if (in_sight) {
|
||||||
seetrap(trap);
|
seetrap(trap);
|
||||||
@@ -2551,7 +2551,7 @@ register struct monst *mtmp;
|
|||||||
a_your[trap->madeby_u]);
|
a_your[trap->madeby_u]);
|
||||||
deltrap(trap);
|
deltrap(trap);
|
||||||
newsym(mtmp->mx, mtmp->my);
|
newsym(mtmp->mx, mtmp->my);
|
||||||
} else if (g.force_mintrap && !mtmp->mtrapped) {
|
} else if (iv.force_mintrap && !mtmp->mtrapped) {
|
||||||
if (in_sight) {
|
if (in_sight) {
|
||||||
pline("%s avoids %s spider web!", Monnam(mtmp),
|
pline("%s avoids %s spider web!", Monnam(mtmp),
|
||||||
a_your[trap->madeby_u]);
|
a_your[trap->madeby_u]);
|
||||||
@@ -4686,9 +4686,9 @@ boolean *noticed; /* set to true iff hero notices the effect; */
|
|||||||
/* dotrap calls mintrap when mounted hero encounters a web */
|
/* dotrap calls mintrap when mounted hero encounters a web */
|
||||||
if (u.usteed)
|
if (u.usteed)
|
||||||
dotrapflags |= NOWEBMSG;
|
dotrapflags |= NOWEBMSG;
|
||||||
++g.force_mintrap;
|
++iv.force_mintrap;
|
||||||
dotrap(t, dotrapflags);
|
dotrap(t, dotrapflags);
|
||||||
--g.force_mintrap;
|
--iv.force_mintrap;
|
||||||
result = (u.utrap != 0);
|
result = (u.utrap != 0);
|
||||||
} else {
|
} else {
|
||||||
if (mon->mtrapped)
|
if (mon->mtrapped)
|
||||||
@@ -4696,9 +4696,9 @@ boolean *noticed; /* set to true iff hero notices the effect; */
|
|||||||
/* you notice it if you see the trap close/tremble/whatever
|
/* you notice it if you see the trap close/tremble/whatever
|
||||||
or if you sense the monster who becomes trapped */
|
or if you sense the monster who becomes trapped */
|
||||||
*noticed = cansee(t->tx, t->ty) || canspotmon(mon);
|
*noticed = cansee(t->tx, t->ty) || canspotmon(mon);
|
||||||
++g.force_mintrap;
|
++iv.force_mintrap;
|
||||||
result = (mintrap(mon) != 0);
|
result = (mintrap(mon) != 0);
|
||||||
--g.force_mintrap;
|
--iv.force_mintrap;
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@@ -4739,9 +4739,9 @@ boolean *noticed; /* set to true iff hero notices the effect; */
|
|||||||
*noticed = cansee(t->tx, t->ty) || canspotmon(mon);
|
*noticed = cansee(t->tx, t->ty) || canspotmon(mon);
|
||||||
/* monster will be angered; mintrap doesn't handle that */
|
/* monster will be angered; mintrap doesn't handle that */
|
||||||
wakeup(mon, TRUE);
|
wakeup(mon, TRUE);
|
||||||
++g.force_mintrap;
|
++iv.force_mintrap;
|
||||||
result = (mintrap(mon) != 0);
|
result = (mintrap(mon) != 0);
|
||||||
--g.force_mintrap;
|
--iv.force_mintrap;
|
||||||
/* mon might now be on the migrating monsters list */
|
/* mon might now be on the migrating monsters list */
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
|
|||||||
+8
-8
@@ -991,9 +991,9 @@ register struct trobj *trop;
|
|||||||
*/
|
*/
|
||||||
obj = mkobj(trop->trclass, FALSE);
|
obj = mkobj(trop->trclass, FALSE);
|
||||||
otyp = obj->otyp;
|
otyp = obj->otyp;
|
||||||
while (otyp == WAN_WISHING || otyp == g.nocreate
|
while (otyp == WAN_WISHING || otyp == iv.nocreate
|
||||||
|| otyp == g.nocreate2 || otyp == g.nocreate3
|
|| otyp == iv.nocreate2 || otyp == iv.nocreate3
|
||||||
|| otyp == g.nocreate4 || otyp == RIN_LEVITATION
|
|| otyp == iv.nocreate4 || otyp == RIN_LEVITATION
|
||||||
/* 'useless' items */
|
/* 'useless' items */
|
||||||
|| otyp == POT_HALLUCINATION
|
|| otyp == POT_HALLUCINATION
|
||||||
|| otyp == POT_ACID
|
|| otyp == POT_ACID
|
||||||
@@ -1035,16 +1035,16 @@ register struct trobj *trop;
|
|||||||
case WAN_POLYMORPH:
|
case WAN_POLYMORPH:
|
||||||
case RIN_POLYMORPH:
|
case RIN_POLYMORPH:
|
||||||
case POT_POLYMORPH:
|
case POT_POLYMORPH:
|
||||||
g.nocreate = RIN_POLYMORPH_CONTROL;
|
iv.nocreate = RIN_POLYMORPH_CONTROL;
|
||||||
break;
|
break;
|
||||||
case RIN_POLYMORPH_CONTROL:
|
case RIN_POLYMORPH_CONTROL:
|
||||||
g.nocreate = RIN_POLYMORPH;
|
iv.nocreate = RIN_POLYMORPH;
|
||||||
g.nocreate2 = SPE_POLYMORPH;
|
iv.nocreate2 = SPE_POLYMORPH;
|
||||||
g.nocreate3 = POT_POLYMORPH;
|
iv.nocreate3 = POT_POLYMORPH;
|
||||||
}
|
}
|
||||||
/* Don't have 2 of the same ring or spellbook */
|
/* Don't have 2 of the same ring or spellbook */
|
||||||
if (obj->oclass == RING_CLASS || obj->oclass == SPBOOK_CLASS)
|
if (obj->oclass == RING_CLASS || obj->oclass == SPBOOK_CLASS)
|
||||||
g.nocreate4 = otyp;
|
iv.nocreate4 = otyp;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (urace.malenum != PM_HUMAN) {
|
if (urace.malenum != PM_HUMAN) {
|
||||||
|
|||||||
+4
-4
@@ -198,7 +198,7 @@ struct obj *wep; /* uwep for attack(), null for kick_monster() */
|
|||||||
&& !Stunned) {
|
&& !Stunned) {
|
||||||
/* Intelligent chaotic weapons (Stormbringer) want blood */
|
/* Intelligent chaotic weapons (Stormbringer) want blood */
|
||||||
if (wep && wep->oartifact == ART_STORMBRINGER) {
|
if (wep && wep->oartifact == ART_STORMBRINGER) {
|
||||||
g.override_confirmation = TRUE;
|
iv.override_confirmation = TRUE;
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
if (canspotmon(mtmp)) {
|
if (canspotmon(mtmp)) {
|
||||||
@@ -367,7 +367,7 @@ register struct monst *mtmp;
|
|||||||
|
|
||||||
/* possibly set in attack_checks;
|
/* possibly set in attack_checks;
|
||||||
examined in known_hitum, called via hitum or hmonas below */
|
examined in known_hitum, called via hitum or hmonas below */
|
||||||
g.override_confirmation = FALSE;
|
iv.override_confirmation = FALSE;
|
||||||
/* attack_checks() used to use <u.ux+u.dx,u.uy+u.dy> directly, now
|
/* 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 */
|
it uses bhitpos instead; it might map an invisible monster there */
|
||||||
bhitpos.x = u.ux + u.dx;
|
bhitpos.x = u.ux + u.dx;
|
||||||
@@ -448,7 +448,7 @@ int dieroll;
|
|||||||
{
|
{
|
||||||
register boolean malive = TRUE;
|
register boolean malive = TRUE;
|
||||||
|
|
||||||
if (g.override_confirmation) {
|
if (iv.override_confirmation) {
|
||||||
/* this may need to be generalized if weapons other than
|
/* this may need to be generalized if weapons other than
|
||||||
Stormbringer acquire similar anti-social behavior... */
|
Stormbringer acquire similar anti-social behavior... */
|
||||||
if (flags.verbose)
|
if (flags.verbose)
|
||||||
@@ -601,7 +601,7 @@ struct attack *uattk;
|
|||||||
/* second attack for two-weapon combat; won't occur if Stormbringer
|
/* second attack for two-weapon combat; won't occur if Stormbringer
|
||||||
overrode confirmation (assumes Stormbringer is primary weapon)
|
overrode confirmation (assumes Stormbringer is primary weapon)
|
||||||
or if the monster was killed or knocked to different location */
|
or if the monster was killed or knocked to different location */
|
||||||
if (u.twoweap && !g.override_confirmation && malive && m_at(x, y) == mon) {
|
if (u.twoweap && !iv.override_confirmation && malive && m_at(x, y) == mon) {
|
||||||
tmp = find_roll_to_hit(mon, uattk->aatyp, uswapwep, &attknum,
|
tmp = find_roll_to_hit(mon, uattk->aatyp, uswapwep, &attknum,
|
||||||
&armorpenalty);
|
&armorpenalty);
|
||||||
dieroll = rnd(20);
|
dieroll = rnd(20);
|
||||||
|
|||||||
+17
-17
@@ -399,7 +399,7 @@ register struct monst *mtmp;
|
|||||||
|
|
||||||
char mlet = mtmp->data->mlet;
|
char mlet = mtmp->data->mlet;
|
||||||
|
|
||||||
g.propellor = &zeroobj;
|
iv.propellor = &zeroobj;
|
||||||
Oselect(EGG); /* cockatrice egg */
|
Oselect(EGG); /* cockatrice egg */
|
||||||
if (mlet == S_KOP) /* pies are first choice for Kops */
|
if (mlet == S_KOP) /* pies are first choice for Kops */
|
||||||
Oselect(CREAM_PIE);
|
Oselect(CREAM_PIE);
|
||||||
@@ -431,7 +431,7 @@ register struct monst *mtmp;
|
|||||||
|| !mon_hates_silver(mtmp))) {
|
|| !mon_hates_silver(mtmp))) {
|
||||||
if ((otmp = oselect(mtmp, pwep[i])) != 0
|
if ((otmp = oselect(mtmp, pwep[i])) != 0
|
||||||
&& (otmp == mwep || !mweponly)) {
|
&& (otmp == mwep || !mweponly)) {
|
||||||
g.propellor = otmp; /* force the monster to wield it */
|
iv.propellor = otmp; /* force the monster to wield it */
|
||||||
return otmp;
|
return otmp;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -452,41 +452,41 @@ register struct monst *mtmp;
|
|||||||
for (otmp = mtmp->minvent; otmp; otmp = otmp->nobj)
|
for (otmp = mtmp->minvent; otmp; otmp = otmp->nobj)
|
||||||
if (otmp->oclass == GEM_CLASS
|
if (otmp->oclass == GEM_CLASS
|
||||||
&& (otmp->otyp != LOADSTONE || !otmp->cursed)) {
|
&& (otmp->otyp != LOADSTONE || !otmp->cursed)) {
|
||||||
g.propellor = m_carrying(mtmp, SLING);
|
iv.propellor = m_carrying(mtmp, SLING);
|
||||||
return otmp;
|
return otmp;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* KMH -- This belongs here so darts will work */
|
/* KMH -- This belongs here so darts will work */
|
||||||
g.propellor = &zeroobj;
|
iv.propellor = &zeroobj;
|
||||||
|
|
||||||
prop = (objects[rwep[i]]).oc_skill;
|
prop = (objects[rwep[i]]).oc_skill;
|
||||||
if (prop < 0) {
|
if (prop < 0) {
|
||||||
switch (-prop) {
|
switch (-prop) {
|
||||||
case P_BOW:
|
case P_BOW:
|
||||||
g.propellor = (oselect(mtmp, YUMI));
|
iv.propellor = (oselect(mtmp, YUMI));
|
||||||
if (!g.propellor)
|
if (!iv.propellor)
|
||||||
g.propellor = (oselect(mtmp, ELVEN_BOW));
|
iv.propellor = (oselect(mtmp, ELVEN_BOW));
|
||||||
if (!g.propellor)
|
if (!iv.propellor)
|
||||||
g.propellor = (oselect(mtmp, BOW));
|
iv.propellor = (oselect(mtmp, BOW));
|
||||||
if (!g.propellor)
|
if (!iv.propellor)
|
||||||
g.propellor = (oselect(mtmp, ORCISH_BOW));
|
iv.propellor = (oselect(mtmp, ORCISH_BOW));
|
||||||
break;
|
break;
|
||||||
case P_SLING:
|
case P_SLING:
|
||||||
g.propellor = (oselect(mtmp, SLING));
|
iv.propellor = (oselect(mtmp, SLING));
|
||||||
break;
|
break;
|
||||||
case P_CROSSBOW:
|
case P_CROSSBOW:
|
||||||
g.propellor = (oselect(mtmp, CROSSBOW));
|
iv.propellor = (oselect(mtmp, CROSSBOW));
|
||||||
}
|
}
|
||||||
if ((otmp = MON_WEP(mtmp)) && mwelded(otmp) && otmp != g.propellor
|
if ((otmp = MON_WEP(mtmp)) && mwelded(otmp) && otmp != iv.propellor
|
||||||
&& mtmp->weapon_check == NO_WEAPON_WANTED)
|
&& mtmp->weapon_check == NO_WEAPON_WANTED)
|
||||||
g.propellor = 0;
|
iv.propellor = 0;
|
||||||
}
|
}
|
||||||
/* propellor = obj, propellor to use
|
/* propellor = obj, propellor to use
|
||||||
* propellor = &zeroobj, doesn't need a propellor
|
* propellor = &zeroobj, doesn't need a propellor
|
||||||
* propellor = 0, needed one and didn't have one
|
* propellor = 0, needed one and didn't have one
|
||||||
*/
|
*/
|
||||||
if (g.propellor != 0) {
|
if (iv.propellor != 0) {
|
||||||
/* Note: cannot use m_carrying for loadstones, since it will
|
/* Note: cannot use m_carrying for loadstones, since it will
|
||||||
* always select the first object of a type, and maybe the
|
* always select the first object of a type, and maybe the
|
||||||
* monster is carrying two but only the first is unthrowable.
|
* monster is carrying two but only the first is unthrowable.
|
||||||
@@ -633,7 +633,7 @@ register struct monst *mon;
|
|||||||
break;
|
break;
|
||||||
case NEED_RANGED_WEAPON:
|
case NEED_RANGED_WEAPON:
|
||||||
(void) select_rwep(mon);
|
(void) select_rwep(mon);
|
||||||
obj = g.propellor;
|
obj = iv.propellor;
|
||||||
break;
|
break;
|
||||||
case NEED_PICK_AXE:
|
case NEED_PICK_AXE:
|
||||||
obj = m_carrying(mon, PICK_AXE);
|
obj = m_carrying(mon, PICK_AXE);
|
||||||
|
|||||||
@@ -1360,13 +1360,13 @@ struct obj *obj;
|
|||||||
if (obj->otyp == SCR_MAIL)
|
if (obj->otyp == SCR_MAIL)
|
||||||
return;
|
return;
|
||||||
#endif
|
#endif
|
||||||
g.obj_zapped = TRUE;
|
iv.obj_zapped = TRUE;
|
||||||
|
|
||||||
if (g.poly_zapped < 0) {
|
if (iv.poly_zapped < 0) {
|
||||||
/* some may metamorphosize */
|
/* some may metamorphosize */
|
||||||
for (i = obj->quan; i; i--)
|
for (i = obj->quan; i; i--)
|
||||||
if (!rn2(Luck + 45)) {
|
if (!rn2(Luck + 45)) {
|
||||||
g.poly_zapped = objects[obj->otyp].oc_material;
|
iv.poly_zapped = objects[obj->otyp].oc_material;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2065,7 +2065,7 @@ schar zz;
|
|||||||
learnwand(obj);
|
learnwand(obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
g.poly_zapped = -1;
|
iv.poly_zapped = -1;
|
||||||
for (otmp = level.objects[tx][ty]; otmp; otmp = next_obj) {
|
for (otmp = level.objects[tx][ty]; otmp; otmp = next_obj) {
|
||||||
next_obj = otmp->nexthere;
|
next_obj = otmp->nexthere;
|
||||||
/* for zap downwards, don't hit object poly'd hero is hiding under */
|
/* for zap downwards, don't hit object poly'd hero is hiding under */
|
||||||
@@ -2075,8 +2075,8 @@ schar zz;
|
|||||||
|
|
||||||
hitanything += (*fhito)(otmp, obj);
|
hitanything += (*fhito)(otmp, obj);
|
||||||
}
|
}
|
||||||
if (g.poly_zapped >= 0)
|
if (iv.poly_zapped >= 0)
|
||||||
create_polymon(level.objects[tx][ty], g.poly_zapped);
|
create_polymon(level.objects[tx][ty], iv.poly_zapped);
|
||||||
|
|
||||||
return hitanything;
|
return hitanything;
|
||||||
}
|
}
|
||||||
@@ -2950,16 +2950,16 @@ struct obj *obj; /* wand or spell */
|
|||||||
void
|
void
|
||||||
zapsetup()
|
zapsetup()
|
||||||
{
|
{
|
||||||
g.obj_zapped = FALSE;
|
iv.obj_zapped = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
zapwrapup()
|
zapwrapup()
|
||||||
{
|
{
|
||||||
/* if do_osshock() set obj_zapped while polying, give a message now */
|
/* if do_osshock() set obj_zapped while polying, give a message now */
|
||||||
if (g.obj_zapped)
|
if (iv.obj_zapped)
|
||||||
You_feel("shuddering vibrations.");
|
You_feel("shuddering vibrations.");
|
||||||
g.obj_zapped = FALSE;
|
iv.obj_zapped = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* called for various wand and spell effects - M. Stephenson */
|
/* called for various wand and spell effects - M. Stephenson */
|
||||||
@@ -5035,7 +5035,7 @@ int damage, tell;
|
|||||||
if (damage) {
|
if (damage) {
|
||||||
mtmp->mhp -= damage;
|
mtmp->mhp -= damage;
|
||||||
if (DEADMONSTER(mtmp)) {
|
if (DEADMONSTER(mtmp)) {
|
||||||
if (g.m_using)
|
if (iv.m_using)
|
||||||
monkilled(mtmp, "", AD_RBRE);
|
monkilled(mtmp, "", AD_RBRE);
|
||||||
else
|
else
|
||||||
killed(mtmp);
|
killed(mtmp);
|
||||||
|
|||||||
+1
-1
@@ -97,7 +97,7 @@ char *argv[];
|
|||||||
|
|
||||||
nethack_enter(argc, argv);
|
nethack_enter(argc, argv);
|
||||||
|
|
||||||
instance_globals_init();
|
instance_variable_init();
|
||||||
sys_early_init();
|
sys_early_init();
|
||||||
|
|
||||||
#if defined(WIN32) && defined(TTY_GRAPHICS)
|
#if defined(WIN32) && defined(TTY_GRAPHICS)
|
||||||
|
|||||||
+1
-1
@@ -238,7 +238,7 @@ unsigned x;
|
|||||||
char *
|
char *
|
||||||
initstate(seed, arg_state, n)
|
initstate(seed, arg_state, n)
|
||||||
|
|
||||||
unsigned seed; /* seed for RNG */
|
unsigned seed; /* seed for R. N. G. */
|
||||||
char *arg_state; /* pointer to state array */
|
char *arg_state; /* pointer to state array */
|
||||||
int n; /* # bytes of state info */
|
int n; /* # bytes of state info */
|
||||||
{
|
{
|
||||||
|
|||||||
+1
-1
@@ -97,7 +97,7 @@ WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine,
|
|||||||
|
|
||||||
win10_init();
|
win10_init();
|
||||||
|
|
||||||
instance_globals_init();
|
instance_variable_init();
|
||||||
sys_early_init();
|
sys_early_init();
|
||||||
|
|
||||||
/* init applicatio structure */
|
/* init applicatio structure */
|
||||||
|
|||||||
Reference in New Issue
Block a user