moves, monstermoves, wailmsg, migrating_objs and billobjs moved to g.
This commit is contained in:
+1
-1
@@ -13,7 +13,7 @@ typedef struct align { /* alignment & record */
|
|||||||
} align;
|
} align;
|
||||||
|
|
||||||
/* bounds for "record" -- respect initial alignments of 10 */
|
/* bounds for "record" -- respect initial alignments of 10 */
|
||||||
#define ALIGNLIM (10L + (moves / 200L))
|
#define ALIGNLIM (10L + (g.moves / 200L))
|
||||||
|
|
||||||
#define A_NONE (-128) /* the value range of type */
|
#define A_NONE (-128) /* the value range of type */
|
||||||
|
|
||||||
|
|||||||
+5
-5
@@ -154,9 +154,6 @@ struct multishot {
|
|||||||
boolean s;
|
boolean s;
|
||||||
};
|
};
|
||||||
|
|
||||||
E NEARDATA long moves, monstermoves;
|
|
||||||
E NEARDATA long wailmsg;
|
|
||||||
|
|
||||||
E const int shield_static[];
|
E const int shield_static[];
|
||||||
|
|
||||||
#include "spell.h"
|
#include "spell.h"
|
||||||
@@ -178,8 +175,6 @@ E NEARDATA struct obj *invent, *uarm, *uarmc, *uarmh, *uarms, *uarmg, *uarmf,
|
|||||||
|
|
||||||
E NEARDATA struct obj *uchain; /* defined only when punished */
|
E NEARDATA struct obj *uchain; /* defined only when punished */
|
||||||
E NEARDATA struct obj *uball;
|
E NEARDATA struct obj *uball;
|
||||||
E NEARDATA struct obj *migrating_objs;
|
|
||||||
E NEARDATA struct obj *billobjs;
|
|
||||||
|
|
||||||
E NEARDATA struct obj zeroobj; /* for init; &zeroobj used as special value */
|
E NEARDATA struct obj zeroobj; /* for init; &zeroobj used as special value */
|
||||||
|
|
||||||
@@ -694,6 +689,11 @@ struct instance_globals {
|
|||||||
struct mkroom rooms[(MAXNROFROOMS + 1) * 2];
|
struct mkroom rooms[(MAXNROFROOMS + 1) * 2];
|
||||||
struct mkroom *subrooms;
|
struct mkroom *subrooms;
|
||||||
dlevel_t level; /* level map */
|
dlevel_t level; /* level map */
|
||||||
|
long moves;
|
||||||
|
long monstermoves; /* moves and monstermoves diverge when player is Fast */
|
||||||
|
long wailmsg;
|
||||||
|
struct obj *migrating_objs; /* objects moving to another dungeon level */
|
||||||
|
struct obj *billobjs; /* objects not yet paid for */
|
||||||
|
|
||||||
/* dig.c */
|
/* dig.c */
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -244,7 +244,7 @@ struct obj {
|
|||||||
/* Eggs and other food */
|
/* Eggs and other food */
|
||||||
#define MAX_EGG_HATCH_TIME 200 /* longest an egg can remain unhatched */
|
#define MAX_EGG_HATCH_TIME 200 /* longest an egg can remain unhatched */
|
||||||
#define stale_egg(egg) \
|
#define stale_egg(egg) \
|
||||||
((monstermoves - (egg)->age) > (2 * MAX_EGG_HATCH_TIME))
|
((g.monstermoves - (egg)->age) > (2 * MAX_EGG_HATCH_TIME))
|
||||||
#define ofood(o) ((o)->otyp == CORPSE || (o)->otyp == EGG || (o)->otyp == TIN)
|
#define ofood(o) ((o)->otyp == CORPSE || (o)->otyp == EGG || (o)->otyp == TIN)
|
||||||
#define polyfodder(obj) (ofood(obj) && pm_to_cham((obj)->corpsenm) != NON_PM)
|
#define polyfodder(obj) (ofood(obj) && pm_to_cham((obj)->corpsenm) != NON_PM)
|
||||||
#define mlevelgain(obj) (ofood(obj) && (obj)->corpsenm == PM_WRAITH)
|
#define mlevelgain(obj) (ofood(obj) && (obj)->corpsenm == PM_WRAITH)
|
||||||
|
|||||||
+11
-11
@@ -159,8 +159,8 @@ boolean resuming;
|
|||||||
youmonst.movement = 0;
|
youmonst.movement = 0;
|
||||||
settrack();
|
settrack();
|
||||||
|
|
||||||
monstermoves++;
|
g.monstermoves++;
|
||||||
moves++;
|
g.moves++;
|
||||||
|
|
||||||
/********************************/
|
/********************************/
|
||||||
/* once-per-turn things go here */
|
/* once-per-turn things go here */
|
||||||
@@ -196,8 +196,8 @@ boolean resuming;
|
|||||||
|
|
||||||
/* moving around while encumbered is hard work */
|
/* moving around while encumbered is hard work */
|
||||||
if (wtcap > MOD_ENCUMBER && u.umoved) {
|
if (wtcap > MOD_ENCUMBER && u.umoved) {
|
||||||
if (!(wtcap < EXT_ENCUMBER ? moves % 30
|
if (!(wtcap < EXT_ENCUMBER ? g.moves % 30
|
||||||
: moves % 10)) {
|
: g.moves % 10)) {
|
||||||
if (Upolyd && u.mh > 1) {
|
if (Upolyd && u.mh > 1) {
|
||||||
u.mh--;
|
u.mh--;
|
||||||
} else if (!Upolyd && u.uhp > 1) {
|
} else if (!Upolyd && u.uhp > 1) {
|
||||||
@@ -212,7 +212,7 @@ boolean resuming;
|
|||||||
|
|
||||||
if (u.uen < u.uenmax
|
if (u.uen < u.uenmax
|
||||||
&& ((wtcap < MOD_ENCUMBER
|
&& ((wtcap < MOD_ENCUMBER
|
||||||
&& (!(moves % ((MAXULEV + 8 - u.ulevel)
|
&& (!(g.moves % ((MAXULEV + 8 - u.ulevel)
|
||||||
* (Role_if(PM_WIZARD) ? 3 : 4)
|
* (Role_if(PM_WIZARD) ? 3 : 4)
|
||||||
/ 6)))) || Energy_regeneration)) {
|
/ 6)))) || Energy_regeneration)) {
|
||||||
u.uen += rn1(
|
u.uen += rn1(
|
||||||
@@ -317,7 +317,7 @@ boolean resuming;
|
|||||||
if (context.bypasses)
|
if (context.bypasses)
|
||||||
clear_bypasses();
|
clear_bypasses();
|
||||||
if ((u.uhave.amulet || Clairvoyant) && !In_endgame(&u.uz)
|
if ((u.uhave.amulet || Clairvoyant) && !In_endgame(&u.uz)
|
||||||
&& !BClairvoyant && !(moves % 15) && !rn2(2))
|
&& !BClairvoyant && !(g.moves % 15) && !rn2(2))
|
||||||
do_vicinity_map((struct obj *) 0);
|
do_vicinity_map((struct obj *) 0);
|
||||||
if (u.utrap && u.utraptype == TT_LAVA)
|
if (u.utrap && u.utraptype == TT_LAVA)
|
||||||
sink_into_lava();
|
sink_into_lava();
|
||||||
@@ -429,7 +429,7 @@ boolean resuming;
|
|||||||
vision_recalc(0); /* vision! */
|
vision_recalc(0); /* vision! */
|
||||||
/* when running in non-tport mode, this gets done through domove() */
|
/* when running in non-tport mode, this gets done through domove() */
|
||||||
if ((!context.run || flags.runmode == RUN_TPORT)
|
if ((!context.run || flags.runmode == RUN_TPORT)
|
||||||
&& (g.multi && (!context.travel ? !(g.multi % 7) : !(moves % 7L)))) {
|
&& (g.multi && (!context.travel ? !(g.multi % 7) : !(g.moves % 7L)))) {
|
||||||
if (flags.time && context.run)
|
if (flags.time && context.run)
|
||||||
context.botl = 1;
|
context.botl = 1;
|
||||||
display_nhwindow(WIN_MAP, FALSE);
|
display_nhwindow(WIN_MAP, FALSE);
|
||||||
@@ -454,10 +454,10 @@ int wtcap;
|
|||||||
/* eel out of water loses hp, similar to monster eels;
|
/* eel out of water loses hp, similar to monster eels;
|
||||||
as hp gets lower, rate of further loss slows down */
|
as hp gets lower, rate of further loss slows down */
|
||||||
if (u.mh > 1 && !Regeneration && rn2(u.mh) > rn2(8)
|
if (u.mh > 1 && !Regeneration && rn2(u.mh) > rn2(8)
|
||||||
&& (!Half_physical_damage || !(moves % 2L)))
|
&& (!Half_physical_damage || !(g.moves % 2L)))
|
||||||
heal = -1;
|
heal = -1;
|
||||||
} else if (u.mh < u.mhmax) {
|
} else if (u.mh < u.mhmax) {
|
||||||
if (Regeneration || (encumbrance_ok && !(moves % 20L)))
|
if (Regeneration || (encumbrance_ok && !(g.moves % 20L)))
|
||||||
heal = 1;
|
heal = 1;
|
||||||
}
|
}
|
||||||
if (heal) {
|
if (heal) {
|
||||||
@@ -474,7 +474,7 @@ int wtcap;
|
|||||||
for the player, but it didn't make sense for gameplay...] */
|
for the player, but it didn't make sense for gameplay...] */
|
||||||
if (u.uhp < u.uhpmax && (encumbrance_ok || Regeneration)) {
|
if (u.uhp < u.uhpmax && (encumbrance_ok || Regeneration)) {
|
||||||
if (u.ulevel > 9) {
|
if (u.ulevel > 9) {
|
||||||
if (!(moves % 3L)) {
|
if (!(g.moves % 3L)) {
|
||||||
int Con = (int) ACURR(A_CON);
|
int Con = (int) ACURR(A_CON);
|
||||||
|
|
||||||
if (Con <= 12) {
|
if (Con <= 12) {
|
||||||
@@ -486,7 +486,7 @@ int wtcap;
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else { /* u.ulevel <= 9 */
|
} else { /* u.ulevel <= 9 */
|
||||||
if (!(moves % (long) ((MAXULEV + 12) / (u.ulevel + 2) + 1)))
|
if (!(g.moves % (long) ((MAXULEV + 12) / (u.ulevel + 2) + 1)))
|
||||||
heal = 1;
|
heal = 1;
|
||||||
}
|
}
|
||||||
if (Regeneration && !heal)
|
if (Regeneration && !heal)
|
||||||
|
|||||||
+4
-4
@@ -317,9 +317,9 @@ register struct obj *obj;
|
|||||||
if (!getdir((char *) 0))
|
if (!getdir((char *) 0))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
res = (moves == context.stethoscope_move)
|
res = (g.moves == context.stethoscope_move)
|
||||||
&& (youmonst.movement == context.stethoscope_movement);
|
&& (youmonst.movement == context.stethoscope_movement);
|
||||||
context.stethoscope_move = moves;
|
context.stethoscope_move = g.moves;
|
||||||
context.stethoscope_movement = youmonst.movement;
|
context.stethoscope_movement = youmonst.movement;
|
||||||
|
|
||||||
g.bhitpos.x = u.ux, g.bhitpos.y = u.uy; /* tentative, reset below */
|
g.bhitpos.x = u.ux, g.bhitpos.y = u.uy; /* tentative, reset below */
|
||||||
@@ -1059,7 +1059,7 @@ struct obj **optr;
|
|||||||
#ifdef AMIGA
|
#ifdef AMIGA
|
||||||
amii_speaker(obj, "aefeaefeaefeaefeaefe", AMII_LOUDER_VOLUME);
|
amii_speaker(obj, "aefeaefeaefeaefeaefe", AMII_LOUDER_VOLUME);
|
||||||
#endif
|
#endif
|
||||||
obj->age = moves;
|
obj->age = g.moves;
|
||||||
learno = TRUE;
|
learno = TRUE;
|
||||||
wakem = TRUE;
|
wakem = TRUE;
|
||||||
|
|
||||||
@@ -2083,7 +2083,7 @@ long timeout;
|
|||||||
debugpline0("null figurine in fig_transform()");
|
debugpline0("null figurine in fig_transform()");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
silent = (timeout != monstermoves); /* happened while away */
|
silent = (timeout != g.monstermoves); /* happened while away */
|
||||||
okay_spot = get_obj_location(figurine, &cc.x, &cc.y, 0);
|
okay_spot = get_obj_location(figurine, &cc.x, &cc.y, 0);
|
||||||
if (figurine->where == OBJ_INVENT || figurine->where == OBJ_MINVENT)
|
if (figurine->where == OBJ_INVENT || figurine->where == OBJ_MINVENT)
|
||||||
okay_spot = enexto(&cc, cc.x, cc.y, &mons[figurine->corpsenm]);
|
okay_spot = enexto(&cc, cc.x, cc.y, &mons[figurine->corpsenm]);
|
||||||
|
|||||||
+4
-4
@@ -1422,7 +1422,7 @@ struct obj *obj;
|
|||||||
|
|
||||||
if (oart->inv_prop > LAST_PROP) {
|
if (oart->inv_prop > LAST_PROP) {
|
||||||
/* It's a special power, not "just" a property */
|
/* It's a special power, not "just" a property */
|
||||||
if (obj->age > monstermoves) {
|
if (obj->age > g.monstermoves) {
|
||||||
/* the artifact is tired :-) */
|
/* the artifact is tired :-) */
|
||||||
You_feel("that %s %s ignoring you.", the(xname(obj)),
|
You_feel("that %s %s ignoring you.", the(xname(obj)),
|
||||||
otense(obj, "are"));
|
otense(obj, "are"));
|
||||||
@@ -1430,7 +1430,7 @@ struct obj *obj;
|
|||||||
obj->age += (long) d(3, 10);
|
obj->age += (long) d(3, 10);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
obj->age = monstermoves + rnz(100);
|
obj->age = g.monstermoves + rnz(100);
|
||||||
|
|
||||||
switch (oart->inv_prop) {
|
switch (oart->inv_prop) {
|
||||||
case TAMING: {
|
case TAMING: {
|
||||||
@@ -1597,7 +1597,7 @@ struct obj *obj;
|
|||||||
iprop = u.uprops[oart->inv_prop].intrinsic;
|
iprop = u.uprops[oart->inv_prop].intrinsic;
|
||||||
boolean on = (eprop & W_ARTI) != 0; /* true if prop just set */
|
boolean on = (eprop & W_ARTI) != 0; /* true if prop just set */
|
||||||
|
|
||||||
if (on && obj->age > monstermoves) {
|
if (on && obj->age > g.monstermoves) {
|
||||||
/* the artifact is tired :-) */
|
/* the artifact is tired :-) */
|
||||||
u.uprops[oart->inv_prop].extrinsic ^= W_ARTI;
|
u.uprops[oart->inv_prop].extrinsic ^= W_ARTI;
|
||||||
You_feel("that %s %s ignoring you.", the(xname(obj)),
|
You_feel("that %s %s ignoring you.", the(xname(obj)),
|
||||||
@@ -1608,7 +1608,7 @@ struct obj *obj;
|
|||||||
} else if (!on) {
|
} else if (!on) {
|
||||||
/* when turning off property, determine downtime */
|
/* when turning off property, determine downtime */
|
||||||
/* arbitrary for now until we can tune this -dlc */
|
/* arbitrary for now until we can tune this -dlc */
|
||||||
obj->age = monstermoves + rnz(100);
|
obj->age = g.monstermoves + rnz(100);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((eprop & ~W_ARTI) || iprop) {
|
if ((eprop & ~W_ARTI) || iprop) {
|
||||||
|
|||||||
+7
-7
@@ -168,7 +168,7 @@ int msgflg; /* positive => no message, zero => message, and */
|
|||||||
if (msgflg <= 0)
|
if (msgflg <= 0)
|
||||||
You_feel("%s%s!", (incr > 1 || incr < -1) ? "very " : "", attrstr);
|
You_feel("%s%s!", (incr > 1 || incr < -1) ? "very " : "", attrstr);
|
||||||
context.botl = 1;
|
context.botl = 1;
|
||||||
if (moves > 1 && (ndx == A_STR || ndx == A_CON))
|
if (g.moves > 1 && (ndx == A_STR || ndx == A_CON))
|
||||||
(void) encumber_msg();
|
(void) encumber_msg();
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
@@ -421,14 +421,14 @@ boolean inc_or_dec;
|
|||||||
: "Con",
|
: "Con",
|
||||||
(inc_or_dec) ? "inc" : "dec", AEXE(i));
|
(inc_or_dec) ? "inc" : "dec", AEXE(i));
|
||||||
}
|
}
|
||||||
if (moves > 0 && (i == A_STR || i == A_CON))
|
if (g.moves > 0 && (i == A_STR || i == A_CON))
|
||||||
(void) encumber_msg();
|
(void) encumber_msg();
|
||||||
}
|
}
|
||||||
|
|
||||||
STATIC_OVL void
|
STATIC_OVL void
|
||||||
exerper()
|
exerper()
|
||||||
{
|
{
|
||||||
if (!(moves % 10)) {
|
if (!(g.moves % 10)) {
|
||||||
/* Hunger Checks */
|
/* Hunger Checks */
|
||||||
|
|
||||||
int hs = (u.uhunger > 1000) ? SATIATED : (u.uhunger > 150)
|
int hs = (u.uhunger > 1000) ? SATIATED : (u.uhunger > 150)
|
||||||
@@ -478,7 +478,7 @@ exerper()
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* status checks */
|
/* status checks */
|
||||||
if (!(moves % 5)) {
|
if (!(g.moves % 5)) {
|
||||||
debugpline0("exerper: Status checks");
|
debugpline0("exerper: Status checks");
|
||||||
if ((HClairvoyant & (INTRINSIC | TIMEOUT)) && !BClairvoyant)
|
if ((HClairvoyant & (INTRINSIC | TIMEOUT)) && !BClairvoyant)
|
||||||
exercise(A_WIS, TRUE);
|
exercise(A_WIS, TRUE);
|
||||||
@@ -513,11 +513,11 @@ exerchk()
|
|||||||
/* Check out the periodic accumulations */
|
/* Check out the periodic accumulations */
|
||||||
exerper();
|
exerper();
|
||||||
|
|
||||||
if (moves >= context.next_attrib_check) {
|
if (g.moves >= context.next_attrib_check) {
|
||||||
debugpline1("exerchk: ready to test. multi = %d.", g.multi);
|
debugpline1("exerchk: ready to test. multi = %d.", g.multi);
|
||||||
}
|
}
|
||||||
/* Are we ready for a test? */
|
/* Are we ready for a test? */
|
||||||
if (moves >= context.next_attrib_check && !g.multi) {
|
if (g.moves >= context.next_attrib_check && !g.multi) {
|
||||||
debugpline0("exerchk: testing.");
|
debugpline0("exerchk: testing.");
|
||||||
/*
|
/*
|
||||||
* Law of diminishing returns (Part II):
|
* Law of diminishing returns (Part II):
|
||||||
@@ -971,7 +971,7 @@ newhp()
|
|||||||
hp += rnd(urole.hpadv.inrnd);
|
hp += rnd(urole.hpadv.inrnd);
|
||||||
if (urace.hpadv.inrnd > 0)
|
if (urace.hpadv.inrnd > 0)
|
||||||
hp += rnd(urace.hpadv.inrnd);
|
hp += rnd(urace.hpadv.inrnd);
|
||||||
if (moves <= 1L) { /* initial hero; skip for polyself to new man */
|
if (g.moves <= 1L) { /* initial hero; skip for polyself to new man */
|
||||||
/* Initialize alignment stuff */
|
/* Initialize alignment stuff */
|
||||||
u.ualign.type = aligns[flags.initalign].value;
|
u.ualign.type = aligns[flags.initalign].value;
|
||||||
u.ualign.record = urole.initrecord;
|
u.ualign.record = urole.initrecord;
|
||||||
|
|||||||
+3
-3
@@ -152,7 +152,7 @@ do_statusline2()
|
|||||||
|
|
||||||
/* time/move counter */
|
/* time/move counter */
|
||||||
if (flags.time)
|
if (flags.time)
|
||||||
Sprintf(tmmv, "T:%ld", moves);
|
Sprintf(tmmv, "T:%ld", g.moves);
|
||||||
else
|
else
|
||||||
tmmv[0] = '\0';
|
tmmv[0] = '\0';
|
||||||
tln = strlen(tmmv);
|
tln = strlen(tmmv);
|
||||||
@@ -605,7 +605,7 @@ bot_via_windowport()
|
|||||||
g.blstats[idx][BL_EXP].a.a_long = u.uexp;
|
g.blstats[idx][BL_EXP].a.a_long = u.uexp;
|
||||||
|
|
||||||
/* Time (moves) */
|
/* Time (moves) */
|
||||||
g.blstats[idx][BL_TIME].a.a_long = moves;
|
g.blstats[idx][BL_TIME].a.a_long = g.moves;
|
||||||
|
|
||||||
/* Hunger */
|
/* Hunger */
|
||||||
/* note: u.uhs is unsigned, and 3.6.1's STATUS_HILITE defined
|
/* note: u.uhs is unsigned, and 3.6.1's STATUS_HILITE defined
|
||||||
@@ -812,7 +812,7 @@ status_eval_next_unhilite()
|
|||||||
struct istat_s *curr = NULL;
|
struct istat_s *curr = NULL;
|
||||||
long next_unhilite, this_unhilite;
|
long next_unhilite, this_unhilite;
|
||||||
|
|
||||||
g.bl_hilite_moves = moves;
|
g.bl_hilite_moves = g.moves;
|
||||||
/* figure out when the next unhilight needs to be performed */
|
/* figure out when the next unhilight needs to be performed */
|
||||||
next_unhilite = 0L;
|
next_unhilite = 0L;
|
||||||
for (i = 0; i < MAXBLSTATS; ++i) {
|
for (i = 0; i < MAXBLSTATS; ++i) {
|
||||||
|
|||||||
@@ -1822,7 +1822,7 @@ int final;
|
|||||||
way sooner (in other words, didn't start that way) */
|
way sooner (in other words, didn't start that way) */
|
||||||
? (!final ? "now " : "belatedly ")
|
? (!final ? "now " : "belatedly ")
|
||||||
/* atheist (ignored in very early game) */
|
/* atheist (ignored in very early game) */
|
||||||
: (!u.uconduct.gnostic && moves > 1000L)
|
: (!u.uconduct.gnostic && g.moves > 1000L)
|
||||||
? "nominally "
|
? "nominally "
|
||||||
/* lastly, normal case */
|
/* lastly, normal case */
|
||||||
: "",
|
: "",
|
||||||
@@ -1902,11 +1902,11 @@ int final;
|
|||||||
you_are(buf, "");
|
you_are(buf, "");
|
||||||
|
|
||||||
/* this is shown even if the 'time' option is off */
|
/* this is shown even if the 'time' option is off */
|
||||||
if (moves == 1L) {
|
if (g.moves == 1L) {
|
||||||
you_have("just started your adventure", "");
|
you_have("just started your adventure", "");
|
||||||
} else {
|
} else {
|
||||||
/* 'turns' grates on the nerves in this context... */
|
/* 'turns' grates on the nerves in this context... */
|
||||||
Sprintf(buf, "the dungeon %ld turn%s ago", moves, plur(moves));
|
Sprintf(buf, "the dungeon %ld turn%s ago", g.moves, plur(g.moves));
|
||||||
/* same phrasing for current and final: "entered" is unconditional */
|
/* same phrasing for current and final: "entered" is unconditional */
|
||||||
enlght_line(You_, "entered ", buf, "");
|
enlght_line(You_, "entered ", buf, "");
|
||||||
}
|
}
|
||||||
@@ -3749,7 +3749,7 @@ long *total_size;
|
|||||||
count_obj(invent, &count, &size, FALSE, TRUE);
|
count_obj(invent, &count, &size, FALSE, TRUE);
|
||||||
count_obj(fobj, &count, &size, FALSE, TRUE);
|
count_obj(fobj, &count, &size, FALSE, TRUE);
|
||||||
count_obj(g.level.buriedobjlist, &count, &size, FALSE, TRUE);
|
count_obj(g.level.buriedobjlist, &count, &size, FALSE, TRUE);
|
||||||
count_obj(migrating_objs, &count, &size, FALSE, TRUE);
|
count_obj(g.migrating_objs, &count, &size, FALSE, TRUE);
|
||||||
/* DEADMONSTER check not required in this loop since they have no
|
/* DEADMONSTER check not required in this loop since they have no
|
||||||
* inventory */
|
* inventory */
|
||||||
for (mon = fmon; mon; mon = mon->nmon)
|
for (mon = fmon; mon; mon = mon->nmon)
|
||||||
@@ -3965,9 +3965,9 @@ wiz_show_stats()
|
|||||||
obj_chain(win, "fobj", fobj, TRUE, &total_obj_count, &total_obj_size);
|
obj_chain(win, "fobj", fobj, TRUE, &total_obj_count, &total_obj_size);
|
||||||
obj_chain(win, "buried", g.level.buriedobjlist, FALSE,
|
obj_chain(win, "buried", g.level.buriedobjlist, FALSE,
|
||||||
&total_obj_count, &total_obj_size);
|
&total_obj_count, &total_obj_size);
|
||||||
obj_chain(win, "migrating obj", migrating_objs, FALSE,
|
obj_chain(win, "migrating obj", g.migrating_objs, FALSE,
|
||||||
&total_obj_count, &total_obj_size);
|
&total_obj_count, &total_obj_size);
|
||||||
obj_chain(win, "billobjs", billobjs, FALSE,
|
obj_chain(win, "billobjs", g.billobjs, FALSE,
|
||||||
&total_obj_count, &total_obj_size);
|
&total_obj_count, &total_obj_size);
|
||||||
mon_invent_chain(win, "minvent", fmon, &total_obj_count, &total_obj_size);
|
mon_invent_chain(win, "minvent", fmon, &total_obj_count, &total_obj_size);
|
||||||
mon_invent_chain(win, "migrating minvent", g.migrating_mons,
|
mon_invent_chain(win, "migrating minvent", g.migrating_mons,
|
||||||
|
|||||||
+5
-9
@@ -98,15 +98,6 @@ const int shield_static[SHIELD_COUNT] = {
|
|||||||
S_ss1, S_ss2, S_ss3, S_ss2, S_ss1, S_ss2, S_ss4,
|
S_ss1, S_ss2, S_ss3, S_ss2, S_ss1, S_ss2, S_ss4,
|
||||||
};
|
};
|
||||||
|
|
||||||
NEARDATA long moves = 1L, monstermoves = 1L;
|
|
||||||
/* These diverge when player is Fast */
|
|
||||||
NEARDATA long wailmsg = 0L;
|
|
||||||
|
|
||||||
/* objects that are moving to another dungeon level */
|
|
||||||
NEARDATA struct obj *migrating_objs = (struct obj *) 0;
|
|
||||||
/* objects not yet paid for */
|
|
||||||
NEARDATA struct obj *billobjs = (struct obj *) 0;
|
|
||||||
|
|
||||||
/* used to zero all elements of a struct obj and a struct monst */
|
/* used to zero all elements of a struct obj and a struct monst */
|
||||||
NEARDATA struct obj zeroobj = DUMMY;
|
NEARDATA struct obj zeroobj = DUMMY;
|
||||||
NEARDATA struct monst zeromonst = DUMMY;
|
NEARDATA struct monst zeromonst = DUMMY;
|
||||||
@@ -322,6 +313,11 @@ const struct instance_globals g_init = {
|
|||||||
DUMMY, /* rooms */
|
DUMMY, /* rooms */
|
||||||
NULL, /* subrooms */
|
NULL, /* subrooms */
|
||||||
UNDEFINED_VALUES, /* level */
|
UNDEFINED_VALUES, /* level */
|
||||||
|
1, /* moves */
|
||||||
|
1, /* monstermoves */
|
||||||
|
0, /* wailmsg */
|
||||||
|
NULL, /* migrating_objs */
|
||||||
|
NULL, /* billobjs */
|
||||||
|
|
||||||
/* dig.c */
|
/* dig.c */
|
||||||
UNDEFINED_VALUE, /* did_dig_msg */
|
UNDEFINED_VALUE, /* did_dig_msg */
|
||||||
|
|||||||
@@ -460,7 +460,7 @@ dig(VOID_ARGS)
|
|||||||
newsym(dpx, dpy);
|
newsym(dpx, dpy);
|
||||||
}
|
}
|
||||||
cleanup:
|
cleanup:
|
||||||
context.digging.lastdigtime = moves;
|
context.digging.lastdigtime = g.moves;
|
||||||
context.digging.quiet = FALSE;
|
context.digging.quiet = FALSE;
|
||||||
context.digging.level.dnum = 0;
|
context.digging.level.dnum = 0;
|
||||||
context.digging.level.dlevel = -1;
|
context.digging.level.dlevel = -1;
|
||||||
@@ -1123,8 +1123,8 @@ struct obj *obj;
|
|||||||
&& !context.digging.down
|
&& !context.digging.down
|
||||||
&& context.digging.pos.x == u.ux
|
&& context.digging.pos.x == u.ux
|
||||||
&& context.digging.pos.y == u.uy
|
&& context.digging.pos.y == u.uy
|
||||||
&& (moves <= context.digging.lastdigtime + 2
|
&& (g.moves <= context.digging.lastdigtime + 2
|
||||||
&& moves >= context.digging.lastdigtime)) {
|
&& g.moves >= context.digging.lastdigtime)) {
|
||||||
/* avoid messages if repeated autodigging */
|
/* avoid messages if repeated autodigging */
|
||||||
g.did_dig_msg = TRUE;
|
g.did_dig_msg = TRUE;
|
||||||
context.digging.quiet = TRUE;
|
context.digging.quiet = TRUE;
|
||||||
|
|||||||
@@ -919,8 +919,8 @@ dodown()
|
|||||||
for (obj = invent; obj; obj = obj->nobj) {
|
for (obj = invent; obj; obj = obj->nobj) {
|
||||||
if (obj->oartifact
|
if (obj->oartifact
|
||||||
&& artifact_has_invprop(obj, LEVITATION)) {
|
&& artifact_has_invprop(obj, LEVITATION)) {
|
||||||
if (obj->age < monstermoves)
|
if (obj->age < g.monstermoves)
|
||||||
obj->age = monstermoves;
|
obj->age = g.monstermoves;
|
||||||
obj->age += rnz(100);
|
obj->age += rnz(100);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1804,7 +1804,7 @@ long timeout UNUSED;
|
|||||||
} else { /* rot this corpse away */
|
} else { /* rot this corpse away */
|
||||||
You_feel("%sless hassled.", is_rider(mptr) ? "much " : "");
|
You_feel("%sless hassled.", is_rider(mptr) ? "much " : "");
|
||||||
action = ROT_CORPSE;
|
action = ROT_CORPSE;
|
||||||
when = 250L - (monstermoves - body->age);
|
when = 250L - (g.monstermoves - body->age);
|
||||||
if (when < 1L)
|
if (when < 1L)
|
||||||
when = 1L;
|
when = 1L;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ register struct monst *mtmp;
|
|||||||
EDOG(mtmp)->dropdist = 10000;
|
EDOG(mtmp)->dropdist = 10000;
|
||||||
EDOG(mtmp)->apport = ACURR(A_CHA);
|
EDOG(mtmp)->apport = ACURR(A_CHA);
|
||||||
EDOG(mtmp)->whistletime = 0;
|
EDOG(mtmp)->whistletime = 0;
|
||||||
EDOG(mtmp)->hungrytime = 1000 + monstermoves;
|
EDOG(mtmp)->hungrytime = 1000 + g.monstermoves;
|
||||||
EDOG(mtmp)->ogoal.x = -1; /* force error if used before set */
|
EDOG(mtmp)->ogoal.x = -1; /* force error if used before set */
|
||||||
EDOG(mtmp)->ogoal.y = -1;
|
EDOG(mtmp)->ogoal.y = -1;
|
||||||
EDOG(mtmp)->abuse = 0;
|
EDOG(mtmp)->abuse = 0;
|
||||||
@@ -216,7 +216,7 @@ update_mlstmv()
|
|||||||
for (mon = fmon; mon; mon = mon->nmon) {
|
for (mon = fmon; mon; mon = mon->nmon) {
|
||||||
if (DEADMONSTER(mon))
|
if (DEADMONSTER(mon))
|
||||||
continue;
|
continue;
|
||||||
mon->mlstmv = monstermoves;
|
mon->mlstmv = g.monstermoves;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -359,12 +359,12 @@ boolean with_you;
|
|||||||
* specify its final destination.
|
* specify its final destination.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (mtmp->mlstmv < monstermoves - 1L) {
|
if (mtmp->mlstmv < g.monstermoves - 1L) {
|
||||||
/* heal monster for time spent in limbo */
|
/* heal monster for time spent in limbo */
|
||||||
long nmv = monstermoves - 1L - mtmp->mlstmv;
|
long nmv = g.monstermoves - 1L - mtmp->mlstmv;
|
||||||
|
|
||||||
mon_catchup_elapsed_time(mtmp, nmv);
|
mon_catchup_elapsed_time(mtmp, nmv);
|
||||||
mtmp->mlstmv = monstermoves - 1L;
|
mtmp->mlstmv = g.monstermoves - 1L;
|
||||||
|
|
||||||
/* let monster move a bit on new level (see placement code below) */
|
/* let monster move a bit on new level (see placement code below) */
|
||||||
wander = (xchar) min(nmv, 8);
|
wander = (xchar) min(nmv, 8);
|
||||||
@@ -424,7 +424,7 @@ boolean with_you;
|
|||||||
|
|
||||||
if ((mtmp->mspare1 & MIGR_LEFTOVERS) != 0L) {
|
if ((mtmp->mspare1 & MIGR_LEFTOVERS) != 0L) {
|
||||||
/* Pick up the rest of the MIGR_TO_SPECIES objects */
|
/* Pick up the rest of the MIGR_TO_SPECIES objects */
|
||||||
if (migrating_objs)
|
if (g.migrating_objs)
|
||||||
deliver_obj_to_mon(mtmp, 0, DF_ALL);
|
deliver_obj_to_mon(mtmp, 0, DF_ALL);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -542,8 +542,8 @@ long nmv; /* number of moves */
|
|||||||
&& (carnivorous(mtmp->data) || herbivorous(mtmp->data))) {
|
&& (carnivorous(mtmp->data) || herbivorous(mtmp->data))) {
|
||||||
struct edog *edog = EDOG(mtmp);
|
struct edog *edog = EDOG(mtmp);
|
||||||
|
|
||||||
if ((monstermoves > edog->hungrytime + 500 && mtmp->mhp < 3)
|
if ((g.monstermoves > edog->hungrytime + 500 && mtmp->mhp < 3)
|
||||||
|| (monstermoves > edog->hungrytime + 750))
|
|| (g.monstermoves > edog->hungrytime + 750))
|
||||||
mtmp->mtame = mtmp->mpeaceful = 0;
|
mtmp->mtame = mtmp->mpeaceful = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -659,7 +659,7 @@ boolean pets_only; /* true for ascension or final escape */
|
|||||||
relmon(mtmp, &g.mydogs); /* move it from map to g.mydogs */
|
relmon(mtmp, &g.mydogs); /* move it from map to g.mydogs */
|
||||||
mtmp->mx = mtmp->my = 0; /* avoid mnexto()/MON_AT() problem */
|
mtmp->mx = mtmp->my = 0; /* avoid mnexto()/MON_AT() problem */
|
||||||
mtmp->wormno = num_segs;
|
mtmp->wormno = num_segs;
|
||||||
mtmp->mlstmv = monstermoves;
|
mtmp->mlstmv = g.monstermoves;
|
||||||
} else if (mtmp->iswiz) {
|
} else if (mtmp->iswiz) {
|
||||||
/* we want to be able to find him when his next resurrection
|
/* we want to be able to find him when his next resurrection
|
||||||
chance comes up, but have him resume his present location
|
chance comes up, but have him resume his present location
|
||||||
@@ -720,7 +720,7 @@ coord *cc; /* optional destination coordinates */
|
|||||||
if (In_W_tower(mtmp->mx, mtmp->my, &u.uz))
|
if (In_W_tower(mtmp->mx, mtmp->my, &u.uz))
|
||||||
xyflags |= 2;
|
xyflags |= 2;
|
||||||
mtmp->wormno = num_segs;
|
mtmp->wormno = num_segs;
|
||||||
mtmp->mlstmv = monstermoves;
|
mtmp->mlstmv = g.monstermoves;
|
||||||
mtmp->mtrack[1].x = cc ? cc->x : mtmp->mx;
|
mtmp->mtrack[1].x = cc ? cc->x : mtmp->mx;
|
||||||
mtmp->mtrack[1].y = cc ? cc->y : mtmp->my;
|
mtmp->mtrack[1].y = cc ? cc->y : mtmp->my;
|
||||||
mtmp->mtrack[0].x = xyloc;
|
mtmp->mtrack[0].x = xyloc;
|
||||||
@@ -785,7 +785,7 @@ register struct obj *obj;
|
|||||||
when starving; they never eat stone-to-flesh'd meat */
|
when starving; they never eat stone-to-flesh'd meat */
|
||||||
if (mptr == &mons[PM_GHOUL]) {
|
if (mptr == &mons[PM_GHOUL]) {
|
||||||
if (obj->otyp == CORPSE)
|
if (obj->otyp == CORPSE)
|
||||||
return (peek_at_iced_corpse_age(obj) + 50L <= monstermoves
|
return (peek_at_iced_corpse_age(obj) + 50L <= g.monstermoves
|
||||||
&& fptr != &mons[PM_LIZARD]
|
&& fptr != &mons[PM_LIZARD]
|
||||||
&& fptr != &mons[PM_LICHEN])
|
&& fptr != &mons[PM_LICHEN])
|
||||||
? DOGFOOD
|
? DOGFOOD
|
||||||
@@ -807,7 +807,7 @@ register struct obj *obj;
|
|||||||
case EGG:
|
case EGG:
|
||||||
return carni ? CADAVER : MANFOOD;
|
return carni ? CADAVER : MANFOOD;
|
||||||
case CORPSE:
|
case CORPSE:
|
||||||
if ((peek_at_iced_corpse_age(obj) + 50L <= monstermoves
|
if ((peek_at_iced_corpse_age(obj) + 50L <= g.monstermoves
|
||||||
&& obj->corpsenm != PM_LIZARD && obj->corpsenm != PM_LICHEN
|
&& obj->corpsenm != PM_LIZARD && obj->corpsenm != PM_LICHEN
|
||||||
&& mptr->mlet != S_FUNGUS)
|
&& mptr->mlet != S_FUNGUS)
|
||||||
|| (acidic(fptr) && !resists_acid(mon))
|
|| (acidic(fptr) && !resists_acid(mon))
|
||||||
@@ -915,7 +915,7 @@ register struct obj *obj;
|
|||||||
if (mtmp->mcanmove && !mtmp->mconf && !mtmp->meating
|
if (mtmp->mcanmove && !mtmp->mconf && !mtmp->meating
|
||||||
&& ((tasty = dogfood(mtmp, obj)) == DOGFOOD
|
&& ((tasty = dogfood(mtmp, obj)) == DOGFOOD
|
||||||
|| (tasty <= ACCFOOD
|
|| (tasty <= ACCFOOD
|
||||||
&& EDOG(mtmp)->hungrytime <= monstermoves))) {
|
&& EDOG(mtmp)->hungrytime <= g.monstermoves))) {
|
||||||
/* pet will "catch" and eat this thrown food */
|
/* pet will "catch" and eat this thrown food */
|
||||||
if (canseemon(mtmp)) {
|
if (canseemon(mtmp)) {
|
||||||
boolean big_corpse =
|
boolean big_corpse =
|
||||||
@@ -1035,8 +1035,8 @@ boolean was_dead;
|
|||||||
edog->killed_by_u = 0;
|
edog->killed_by_u = 0;
|
||||||
edog->abuse = 0;
|
edog->abuse = 0;
|
||||||
edog->ogoal.x = edog->ogoal.y = -1;
|
edog->ogoal.x = edog->ogoal.y = -1;
|
||||||
if (was_dead || edog->hungrytime < monstermoves + 500L)
|
if (was_dead || edog->hungrytime < g.monstermoves + 500L)
|
||||||
edog->hungrytime = monstermoves + 500L;
|
edog->hungrytime = g.monstermoves + 500L;
|
||||||
if (was_dead) {
|
if (was_dead) {
|
||||||
edog->droptime = 0L;
|
edog->droptime = 0L;
|
||||||
edog->dropdist = 10000;
|
edog->dropdist = 10000;
|
||||||
|
|||||||
+12
-12
@@ -213,8 +213,8 @@ boolean devour;
|
|||||||
char objnambuf[BUFSZ];
|
char objnambuf[BUFSZ];
|
||||||
|
|
||||||
objnambuf[0] = '\0';
|
objnambuf[0] = '\0';
|
||||||
if (edog->hungrytime < monstermoves)
|
if (edog->hungrytime < g.monstermoves)
|
||||||
edog->hungrytime = monstermoves;
|
edog->hungrytime = g.monstermoves;
|
||||||
nutrit = dog_nutrition(mtmp, obj);
|
nutrit = dog_nutrition(mtmp, obj);
|
||||||
|
|
||||||
deadmimic = (obj->otyp == CORPSE && (obj->corpsenm == PM_SMALL_MIMIC
|
deadmimic = (obj->otyp == CORPSE && (obj->corpsenm == PM_SMALL_MIMIC
|
||||||
@@ -294,7 +294,7 @@ boolean devour;
|
|||||||
#ifdef LINT
|
#ifdef LINT
|
||||||
edog->apport = 0;
|
edog->apport = 0;
|
||||||
#else
|
#else
|
||||||
edog->apport += (int) (200L / ((long) edog->dropdist + monstermoves
|
edog->apport += (int) (200L / ((long) edog->dropdist + g.monstermoves
|
||||||
- edog->droptime));
|
- edog->droptime));
|
||||||
#endif
|
#endif
|
||||||
if (mtmp->data == &mons[PM_RUST_MONSTER] && obj->oerodeproof) {
|
if (mtmp->data == &mons[PM_RUST_MONSTER] && obj->oerodeproof) {
|
||||||
@@ -360,9 +360,9 @@ dog_hunger(mtmp, edog)
|
|||||||
struct monst *mtmp;
|
struct monst *mtmp;
|
||||||
struct edog *edog;
|
struct edog *edog;
|
||||||
{
|
{
|
||||||
if (monstermoves > edog->hungrytime + 500) {
|
if (g.monstermoves > edog->hungrytime + 500) {
|
||||||
if (!carnivorous(mtmp->data) && !herbivorous(mtmp->data)) {
|
if (!carnivorous(mtmp->data) && !herbivorous(mtmp->data)) {
|
||||||
edog->hungrytime = monstermoves + 500;
|
edog->hungrytime = g.monstermoves + 500;
|
||||||
/* but not too high; it might polymorph */
|
/* but not too high; it might polymorph */
|
||||||
} else if (!edog->mhpmax_penalty) {
|
} else if (!edog->mhpmax_penalty) {
|
||||||
/* starving pets are limited in healing */
|
/* starving pets are limited in healing */
|
||||||
@@ -381,7 +381,7 @@ struct edog *edog;
|
|||||||
else
|
else
|
||||||
You_feel("worried about %s.", y_monnam(mtmp));
|
You_feel("worried about %s.", y_monnam(mtmp));
|
||||||
stop_occupation();
|
stop_occupation();
|
||||||
} else if (monstermoves > edog->hungrytime + 750
|
} else if (g.monstermoves > edog->hungrytime + 750
|
||||||
|| DEADMONSTER(mtmp)) {
|
|| DEADMONSTER(mtmp)) {
|
||||||
dog_died:
|
dog_died:
|
||||||
if (mtmp->mleashed && mtmp != u.usteed)
|
if (mtmp->mleashed && mtmp != u.usteed)
|
||||||
@@ -427,7 +427,7 @@ int udist;
|
|||||||
if (edog->apport > 1)
|
if (edog->apport > 1)
|
||||||
edog->apport--;
|
edog->apport--;
|
||||||
edog->dropdist = udist; /* hpscdi!jon */
|
edog->dropdist = udist; /* hpscdi!jon */
|
||||||
edog->droptime = monstermoves;
|
edog->droptime = g.monstermoves;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if ((obj = g.level.objects[omx][omy]) != 0
|
if ((obj = g.level.objects[omx][omy]) != 0
|
||||||
@@ -557,7 +557,7 @@ int after, udist, whappr;
|
|||||||
|
|
||||||
/* follow player if appropriate */
|
/* follow player if appropriate */
|
||||||
if (g.gtyp == UNDEF || (g.gtyp != DOGFOOD && g.gtyp != APPORT
|
if (g.gtyp == UNDEF || (g.gtyp != DOGFOOD && g.gtyp != APPORT
|
||||||
&& monstermoves < edog->hungrytime)) {
|
&& g.monstermoves < edog->hungrytime)) {
|
||||||
g.gx = u.ux;
|
g.gx = u.ux;
|
||||||
g.gy = u.uy;
|
g.gy = u.uy;
|
||||||
if (after && udist <= 4 && g.gx == u.ux && g.gy == u.uy)
|
if (after && udist <= 4 && g.gx == u.ux && g.gy == u.uy)
|
||||||
@@ -923,7 +923,7 @@ int after; /* this is extra fast monster movement */
|
|||||||
else if (j == 1)
|
else if (j == 1)
|
||||||
goto newdogpos; /* eating something */
|
goto newdogpos; /* eating something */
|
||||||
|
|
||||||
whappr = (monstermoves - edog->whistletime < 5);
|
whappr = (g.monstermoves - edog->whistletime < 5);
|
||||||
} else
|
} else
|
||||||
whappr = 0;
|
whappr = 0;
|
||||||
|
|
||||||
@@ -1034,7 +1034,7 @@ int after; /* this is extra fast monster movement */
|
|||||||
return 2;
|
return 2;
|
||||||
|
|
||||||
if ((mstatus & MM_HIT) && !(mstatus & MM_DEF_DIED) && rn2(4)
|
if ((mstatus & MM_HIT) && !(mstatus & MM_DEF_DIED) && rn2(4)
|
||||||
&& mtmp2->mlstmv != monstermoves
|
&& mtmp2->mlstmv != g.monstermoves
|
||||||
&& !onscary(mtmp->mx, mtmp->my, mtmp2)
|
&& !onscary(mtmp->mx, mtmp->my, mtmp2)
|
||||||
/* monnear check needed: long worms hit on tail */
|
/* monnear check needed: long worms hit on tail */
|
||||||
&& monnear(mtmp2, mtmp->mx, mtmp->my)) {
|
&& monnear(mtmp2, mtmp->mx, mtmp->my)) {
|
||||||
@@ -1087,7 +1087,7 @@ int after; /* this is extra fast monster movement */
|
|||||||
cursemsg[i] = TRUE;
|
cursemsg[i] = TRUE;
|
||||||
} else if ((otyp = dogfood(mtmp, obj)) < MANFOOD
|
} else if ((otyp = dogfood(mtmp, obj)) < MANFOOD
|
||||||
&& (otyp < ACCFOOD
|
&& (otyp < ACCFOOD
|
||||||
|| edog->hungrytime <= monstermoves)) {
|
|| edog->hungrytime <= g.monstermoves)) {
|
||||||
/* Note: our dog likes the food so much that he
|
/* Note: our dog likes the food so much that he
|
||||||
* might eat it even when it conceals a cursed object */
|
* might eat it even when it conceals a cursed object */
|
||||||
nix = nx;
|
nix = nx;
|
||||||
@@ -1142,7 +1142,7 @@ int after; /* this is extra fast monster movement */
|
|||||||
/* How hungry is the pet? */
|
/* How hungry is the pet? */
|
||||||
if (!mtmp->isminion) {
|
if (!mtmp->isminion) {
|
||||||
struct edog *dog = EDOG(mtmp);
|
struct edog *dog = EDOG(mtmp);
|
||||||
hungry = (monstermoves > (dog->hungrytime + 300));
|
hungry = (g.monstermoves > (dog->hungrytime + 300));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Identify the best target in a straight line from the pet;
|
/* Identify the best target in a straight line from the pet;
|
||||||
|
|||||||
+2
-2
@@ -1601,7 +1601,7 @@ boolean near_hero;
|
|||||||
int where;
|
int where;
|
||||||
boolean nobreak, noscatter;
|
boolean nobreak, noscatter;
|
||||||
|
|
||||||
for (otmp = migrating_objs; otmp; otmp = otmp2) {
|
for (otmp = g.migrating_objs; otmp; otmp = otmp2) {
|
||||||
otmp2 = otmp->nobj;
|
otmp2 = otmp->nobj;
|
||||||
if (otmp->ox != u.uz.dnum || otmp->oy != u.uz.dlevel)
|
if (otmp->ox != u.uz.dnum || otmp->oy != u.uz.dlevel)
|
||||||
continue;
|
continue;
|
||||||
@@ -1685,7 +1685,7 @@ unsigned long deliverflags;
|
|||||||
maxobj = 1;
|
maxobj = 1;
|
||||||
|
|
||||||
cnt = 0;
|
cnt = 0;
|
||||||
for (otmp = migrating_objs; otmp; otmp = otmp2) {
|
for (otmp = g.migrating_objs; otmp; otmp = otmp2) {
|
||||||
otmp2 = otmp->nobj;
|
otmp2 = otmp->nobj;
|
||||||
where = (int) (otmp->owornmask & 0x7fffL); /* destination code */
|
where = (int) (otmp->owornmask & 0x7fffL); /* destination code */
|
||||||
if ((where & MIGR_TO_SPECIES) == 0)
|
if ((where & MIGR_TO_SPECIES) == 0)
|
||||||
|
|||||||
+3
-3
@@ -2012,13 +2012,13 @@ boolean from_invent;
|
|||||||
at start of this turn, so that "simultaneous"
|
at start of this turn, so that "simultaneous"
|
||||||
multiple breakage isn't drastically worse than
|
multiple breakage isn't drastically worse than
|
||||||
single breakage. (ought to be done via ESHK) */
|
single breakage. (ought to be done via ESHK) */
|
||||||
if (moves != lastmovetime)
|
if (g.moves != lastmovetime)
|
||||||
peaceful_shk = shkp->mpeaceful;
|
peaceful_shk = shkp->mpeaceful;
|
||||||
if (stolen_value(obj, x, y, peaceful_shk, FALSE) > 0L
|
if (stolen_value(obj, x, y, peaceful_shk, FALSE) > 0L
|
||||||
&& (*o_shop != u.ushops[0] || !inside_shop(u.ux, u.uy))
|
&& (*o_shop != u.ushops[0] || !inside_shop(u.ux, u.uy))
|
||||||
&& moves != lastmovetime)
|
&& g.moves != lastmovetime)
|
||||||
make_angry_shk(shkp, x, y);
|
make_angry_shk(shkp, x, y);
|
||||||
lastmovetime = moves;
|
lastmovetime = g.moves;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -643,9 +643,9 @@ boolean allowmsg;
|
|||||||
/* when poly'd into a mind flayer, multiple tentacle hits in one
|
/* when poly'd into a mind flayer, multiple tentacle hits in one
|
||||||
turn cause multiple digestion checks to occur; avoid giving
|
turn cause multiple digestion checks to occur; avoid giving
|
||||||
multiple luck penalties for the same attack */
|
multiple luck penalties for the same attack */
|
||||||
if (moves == ate_brains)
|
if (g.moves == ate_brains)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
ate_brains = moves; /* ate_anything, not just brains... */
|
ate_brains = g.moves; /* ate_anything, not just brains... */
|
||||||
|
|
||||||
if (!CANNIBAL_ALLOWED()
|
if (!CANNIBAL_ALLOWED()
|
||||||
/* non-cannibalistic heroes shouldn't eat own species ever
|
/* non-cannibalistic heroes shouldn't eat own species ever
|
||||||
@@ -1604,7 +1604,7 @@ struct obj *otmp;
|
|||||||
if (!nonrotting_corpse(mnum)) {
|
if (!nonrotting_corpse(mnum)) {
|
||||||
long age = peek_at_iced_corpse_age(otmp);
|
long age = peek_at_iced_corpse_age(otmp);
|
||||||
|
|
||||||
rotted = (monstermoves - age) / (10L + rn2(20));
|
rotted = (g.monstermoves - age) / (10L + rn2(20));
|
||||||
if (otmp->cursed)
|
if (otmp->cursed)
|
||||||
rotted += 2L;
|
rotted += 2L;
|
||||||
else if (otmp->blessed)
|
else if (otmp->blessed)
|
||||||
@@ -2317,7 +2317,7 @@ struct obj *otmp;
|
|||||||
|
|
||||||
/* worst case rather than random
|
/* worst case rather than random
|
||||||
in this calculation to force prompt */
|
in this calculation to force prompt */
|
||||||
rotted = (monstermoves - age) / (10L + 0 /* was rn2(20) */);
|
rotted = (g.monstermoves - age) / (10L + 0 /* was rn2(20) */);
|
||||||
if (otmp->cursed)
|
if (otmp->cursed)
|
||||||
rotted += 2L;
|
rotted += 2L;
|
||||||
else if (otmp->blessed)
|
else if (otmp->blessed)
|
||||||
@@ -2661,7 +2661,7 @@ doeat()
|
|||||||
context.victual.reqtime = objects[otmp->otyp].oc_delay;
|
context.victual.reqtime = objects[otmp->otyp].oc_delay;
|
||||||
if (otmp->otyp != FORTUNE_COOKIE
|
if (otmp->otyp != FORTUNE_COOKIE
|
||||||
&& (otmp->cursed || (!nonrotting_food(otmp->otyp)
|
&& (otmp->cursed || (!nonrotting_food(otmp->otyp)
|
||||||
&& (monstermoves - otmp->age)
|
&& (g.monstermoves - otmp->age)
|
||||||
> (otmp->blessed ? 50L : 30L)
|
> (otmp->blessed ? 50L : 30L)
|
||||||
&& (otmp->orotten || !rn2(7))))) {
|
&& (otmp->orotten || !rn2(7))))) {
|
||||||
if (rottenfood(otmp)) {
|
if (rottenfood(otmp)) {
|
||||||
@@ -2786,7 +2786,7 @@ gethungry()
|
|||||||
&& !Slow_digestion)
|
&& !Slow_digestion)
|
||||||
u.uhunger--; /* ordinary food consumption */
|
u.uhunger--; /* ordinary food consumption */
|
||||||
|
|
||||||
if (moves % 2) { /* odd turns */
|
if (g.moves % 2) { /* odd turns */
|
||||||
/* Regeneration uses up food, unless due to an artifact */
|
/* Regeneration uses up food, unless due to an artifact */
|
||||||
if ((HRegeneration & ~FROMFORM)
|
if ((HRegeneration & ~FROMFORM)
|
||||||
|| (ERegeneration & ~(W_ARTI | W_WEP)))
|
|| (ERegeneration & ~(W_ARTI | W_WEP)))
|
||||||
@@ -2801,7 +2801,7 @@ gethungry()
|
|||||||
u.uhunger--;
|
u.uhunger--;
|
||||||
/* +0 charged rings don't do anything, so don't affect hunger.
|
/* +0 charged rings don't do anything, so don't affect hunger.
|
||||||
Slow digestion cancels move hunger but still causes ring hunger. */
|
Slow digestion cancels move hunger but still causes ring hunger. */
|
||||||
switch ((int) (moves % 20)) { /* note: use even cases only */
|
switch ((int) (g.moves % 20)) { /* note: use even cases only */
|
||||||
case 4:
|
case 4:
|
||||||
if (uleft && (uleft->spe || !objects[uleft->otyp].oc_charged))
|
if (uleft && (uleft->spe || !objects[uleft->otyp].oc_charged))
|
||||||
u.uhunger--;
|
u.uhunger--;
|
||||||
|
|||||||
@@ -1150,7 +1150,7 @@ int how;
|
|||||||
* On those rare occasions you get hosed immediately, go out
|
* On those rare occasions you get hosed immediately, go out
|
||||||
* smiling... :-) -3.
|
* smiling... :-) -3.
|
||||||
*/
|
*/
|
||||||
if (moves <= 1 && how < PANICKED) /* You die... --More-- */
|
if (g.moves <= 1 && how < PANICKED) /* You die... --More-- */
|
||||||
pline("Do not pass go. Do not collect 200 %s.", currency(200L));
|
pline("Do not pass go. Do not collect 200 %s.", currency(200L));
|
||||||
|
|
||||||
if (have_windows)
|
if (have_windows)
|
||||||
@@ -1499,7 +1499,7 @@ int how;
|
|||||||
}
|
}
|
||||||
|
|
||||||
Sprintf(pbuf, "and %ld piece%s of gold, after %ld move%s.", umoney,
|
Sprintf(pbuf, "and %ld piece%s of gold, after %ld move%s.", umoney,
|
||||||
plur(umoney), moves, plur(moves));
|
plur(umoney), g.moves, plur(g.moves));
|
||||||
dump_forward_putstr(endwin, 0, pbuf, done_stopprint);
|
dump_forward_putstr(endwin, 0, pbuf, done_stopprint);
|
||||||
Sprintf(pbuf,
|
Sprintf(pbuf,
|
||||||
"You were level %d with a maximum of %d hit point%s when you %s.",
|
"You were level %d with a maximum of %d hit point%s when you %s.",
|
||||||
|
|||||||
+4
-4
@@ -269,7 +269,7 @@ boolean strict;
|
|||||||
{
|
{
|
||||||
register struct engr *ep = engr_at(x, y);
|
register struct engr *ep = engr_at(x, y);
|
||||||
|
|
||||||
if (ep && ep->engr_type != HEADSTONE && ep->engr_time <= moves) {
|
if (ep && ep->engr_type != HEADSTONE && ep->engr_time <= g.moves) {
|
||||||
return strict ? (fuzzymatch(ep->engr_txt, s, "", TRUE))
|
return strict ? (fuzzymatch(ep->engr_txt, s, "", TRUE))
|
||||||
: (strstri(ep->engr_txt, s) != 0);
|
: (strstri(ep->engr_txt, s) != 0);
|
||||||
}
|
}
|
||||||
@@ -901,7 +901,7 @@ doengrave()
|
|||||||
}
|
}
|
||||||
/* Something has changed the engraving here */
|
/* Something has changed the engraving here */
|
||||||
if (*buf) {
|
if (*buf) {
|
||||||
make_engr_at(u.ux, u.uy, buf, moves, type);
|
make_engr_at(u.ux, u.uy, buf, g.moves, type);
|
||||||
if (!Blind)
|
if (!Blind)
|
||||||
pline_The("engraving now reads: \"%s\".", buf);
|
pline_The("engraving now reads: \"%s\".", buf);
|
||||||
ptext = FALSE;
|
ptext = FALSE;
|
||||||
@@ -1147,7 +1147,7 @@ doengrave()
|
|||||||
Strcpy(buf, oep->engr_txt);
|
Strcpy(buf, oep->engr_txt);
|
||||||
(void) strncat(buf, ebuf, BUFSZ - (int) strlen(buf) - 1);
|
(void) strncat(buf, ebuf, BUFSZ - (int) strlen(buf) - 1);
|
||||||
/* Put the engraving onto the map */
|
/* Put the engraving onto the map */
|
||||||
make_engr_at(u.ux, u.uy, buf, moves - g.multi, type);
|
make_engr_at(u.ux, u.uy, buf, g.moves - g.multi, type);
|
||||||
|
|
||||||
if (post_engr_text[0])
|
if (post_engr_text[0])
|
||||||
pline("%s", post_engr_text);
|
pline("%s", post_engr_text);
|
||||||
@@ -1215,7 +1215,7 @@ int fd;
|
|||||||
* normal levels as the player must have finished engraving
|
* normal levels as the player must have finished engraving
|
||||||
* to be able to move again.
|
* to be able to move again.
|
||||||
*/
|
*/
|
||||||
ep->engr_time = moves;
|
ep->engr_time = g.moves;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+6
-6
@@ -279,7 +279,7 @@ moverock()
|
|||||||
#endif
|
#endif
|
||||||
dopush:
|
dopush:
|
||||||
if (!u.usteed) {
|
if (!u.usteed) {
|
||||||
if (moves > lastmovetime + 2 || moves < lastmovetime)
|
if (g.moves > lastmovetime + 2 || g.moves < lastmovetime)
|
||||||
pline("With %s effort you move %s.",
|
pline("With %s effort you move %s.",
|
||||||
throws_rocks(youmonst.data) ? "little"
|
throws_rocks(youmonst.data) ? "little"
|
||||||
: "great",
|
: "great",
|
||||||
@@ -288,7 +288,7 @@ moverock()
|
|||||||
} else
|
} else
|
||||||
pline("%s moves %s.", upstart(y_monnam(u.usteed)),
|
pline("%s moves %s.", upstart(y_monnam(u.usteed)),
|
||||||
the(xname(otmp)));
|
the(xname(otmp)));
|
||||||
lastmovetime = moves;
|
lastmovetime = g.moves;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Move the boulder *after* the message. */
|
/* Move the boulder *after* the message. */
|
||||||
@@ -1882,7 +1882,7 @@ domove()
|
|||||||
|
|
||||||
if (context.run && flags.runmode != RUN_TPORT) {
|
if (context.run && flags.runmode != RUN_TPORT) {
|
||||||
/* display every step or every 7th step depending upon mode */
|
/* display every step or every 7th step depending upon mode */
|
||||||
if (flags.runmode != RUN_LEAP || !(moves % 7L)) {
|
if (flags.runmode != RUN_LEAP || !(g.moves % 7L)) {
|
||||||
if (flags.time)
|
if (flags.time)
|
||||||
context.botl = 1;
|
context.botl = 1;
|
||||||
curs_on_u();
|
curs_on_u();
|
||||||
@@ -1905,7 +1905,7 @@ overexertion()
|
|||||||
position, but is now called by attack() so that it doesn't
|
position, but is now called by attack() so that it doesn't
|
||||||
execute if you decline to attack a peaceful monster */
|
execute if you decline to attack a peaceful monster */
|
||||||
gethungry();
|
gethungry();
|
||||||
if ((moves % 3L) != 0L && near_capacity() >= HVY_ENCUMBER) {
|
if ((g.moves % 3L) != 0L && near_capacity() >= HVY_ENCUMBER) {
|
||||||
int *hp = (!Upolyd ? &u.uhp : &u.mh);
|
int *hp = (!Upolyd ? &u.uhp : &u.mh);
|
||||||
|
|
||||||
if (*hp > 1) {
|
if (*hp > 1) {
|
||||||
@@ -2863,10 +2863,10 @@ maybe_wail()
|
|||||||
SHOCK_RES, FIRE_RES, SLEEP_RES, DISINT_RES,
|
SHOCK_RES, FIRE_RES, SLEEP_RES, DISINT_RES,
|
||||||
TELEPORT_CONTROL, STEALTH, FAST, INVIS };
|
TELEPORT_CONTROL, STEALTH, FAST, INVIS };
|
||||||
|
|
||||||
if (moves <= wailmsg + 50)
|
if (g.moves <= g.wailmsg + 50)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
wailmsg = moves;
|
g.wailmsg = g.moves;
|
||||||
if (Role_if(PM_WIZARD) || Race_if(PM_ELF) || Role_if(PM_VALKYRIE)) {
|
if (Role_if(PM_WIZARD) || Race_if(PM_ELF) || Role_if(PM_VALKYRIE)) {
|
||||||
const char *who;
|
const char *who;
|
||||||
int i, powercnt;
|
int i, powercnt;
|
||||||
|
|||||||
+1
-1
@@ -195,7 +195,7 @@ boolean destroyit;
|
|||||||
useup(otmp);
|
useup(otmp);
|
||||||
}
|
}
|
||||||
if (box->otyp == ICE_BOX && otmp->otyp == CORPSE) {
|
if (box->otyp == ICE_BOX && otmp->otyp == CORPSE) {
|
||||||
otmp->age = monstermoves - otmp->age; /* actual age */
|
otmp->age = g.monstermoves - otmp->age; /* actual age */
|
||||||
start_corpse_timeout(otmp);
|
start_corpse_timeout(otmp);
|
||||||
}
|
}
|
||||||
place_object(otmp, u.ux, u.uy);
|
place_object(otmp, u.ux, u.uy);
|
||||||
|
|||||||
+5
-5
@@ -440,7 +440,7 @@ ckmailstatus()
|
|||||||
return;
|
return;
|
||||||
if (mustgetmail < 0) {
|
if (mustgetmail < 0) {
|
||||||
#if defined(AMIGA) || defined(MSDOS) || defined(TOS)
|
#if defined(AMIGA) || defined(MSDOS) || defined(TOS)
|
||||||
mustgetmail = (moves < 2000) ? (100 + rn2(2000)) : (2000 + rn2(3000));
|
mustgetmail = (g.moves < 2000) ? (100 + rn2(2000)) : (2000 + rn2(3000));
|
||||||
#endif
|
#endif
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -498,12 +498,12 @@ ckmailstatus()
|
|||||||
|
|
||||||
if (!mailbox || u.uswallow || !flags.biff
|
if (!mailbox || u.uswallow || !flags.biff
|
||||||
#ifdef MAILCKFREQ
|
#ifdef MAILCKFREQ
|
||||||
|| moves < laststattime + MAILCKFREQ
|
|| g.moves < laststattime + MAILCKFREQ
|
||||||
#endif
|
#endif
|
||||||
)
|
)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
laststattime = moves;
|
laststattime = g.moves;
|
||||||
if (stat(mailbox, &nmstat)) {
|
if (stat(mailbox, &nmstat)) {
|
||||||
#ifdef PERMANENT_MAILBOX
|
#ifdef PERMANENT_MAILBOX
|
||||||
pline("Cannot get status of MAIL=\"%s\" anymore.", mailbox);
|
pline("Cannot get status of MAIL=\"%s\" anymore.", mailbox);
|
||||||
@@ -623,8 +623,8 @@ ck_server_admin_msg()
|
|||||||
static struct stat ost,nst;
|
static struct stat ost,nst;
|
||||||
static long lastchk = 0;
|
static long lastchk = 0;
|
||||||
|
|
||||||
if (moves < lastchk + SERVER_ADMIN_MSG_CKFREQ) return;
|
if (g.moves < lastchk + SERVER_ADMIN_MSG_CKFREQ) return;
|
||||||
lastchk = moves;
|
lastchk = g.moves;
|
||||||
|
|
||||||
if (!stat(SERVER_ADMIN_MSG, &nst)) {
|
if (!stat(SERVER_ADMIN_MSG, &nst)) {
|
||||||
if (nst.st_mtime > ost.st_mtime)
|
if (nst.st_mtime > ost.st_mtime)
|
||||||
|
|||||||
+3
-3
@@ -1403,7 +1403,7 @@ int mmflags;
|
|||||||
mtmp->mstrategy |= STRAT_APPEARMSG;
|
mtmp->mstrategy |= STRAT_APPEARMSG;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (allow_minvent && migrating_objs)
|
if (allow_minvent && g.migrating_objs)
|
||||||
deliver_obj_to_mon(mtmp, 1, DF_NONE); /* in case of waiting items */
|
deliver_obj_to_mon(mtmp, 1, DF_NONE); /* in case of waiting items */
|
||||||
|
|
||||||
if (!g.in_mklev)
|
if (!g.in_mklev)
|
||||||
@@ -1487,9 +1487,9 @@ register struct permonst *ptr;
|
|||||||
static NEARDATA s_level *lev;
|
static NEARDATA s_level *lev;
|
||||||
register int alshift;
|
register int alshift;
|
||||||
|
|
||||||
if (oldmoves != moves) {
|
if (oldmoves != g.moves) {
|
||||||
lev = Is_special(&u.uz);
|
lev = Is_special(&u.uz);
|
||||||
oldmoves = moves;
|
oldmoves = g.moves;
|
||||||
}
|
}
|
||||||
switch ((lev) ? lev->flags.align : g.dungeons[u.uz.dnum].flags.align) {
|
switch ((lev) ? lev->flags.align : g.dungeons[u.uz.dnum].flags.align) {
|
||||||
default: /* just in case */
|
default: /* just in case */
|
||||||
|
|||||||
+1
-1
@@ -69,7 +69,7 @@ boolean undirected;
|
|||||||
point_msg = "at you, then curses";
|
point_msg = "at you, then curses";
|
||||||
|
|
||||||
pline("%s points %s.", Monnam(mtmp), point_msg);
|
pline("%s points %s.", Monnam(mtmp), point_msg);
|
||||||
} else if ((!(moves % 4) || !rn2(4))) {
|
} else if ((!(g.moves % 4) || !rn2(4))) {
|
||||||
if (!Deaf)
|
if (!Deaf)
|
||||||
Norep("You hear a mumbled curse.");
|
Norep("You hear a mumbled curse.");
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-3
@@ -60,9 +60,9 @@ register struct attack *mattk;
|
|||||||
{
|
{
|
||||||
boolean farq = (distu(magr->mx, magr->my) > 15);
|
boolean farq = (distu(magr->mx, magr->my) > 15);
|
||||||
|
|
||||||
if (!Deaf && (farq != g.far_noise || moves - g.noisetime > 10)) {
|
if (!Deaf && (farq != g.far_noise || g.moves - g.noisetime > 10)) {
|
||||||
g.far_noise = farq;
|
g.far_noise = farq;
|
||||||
g.noisetime = moves;
|
g.noisetime = g.moves;
|
||||||
You_hear("%s%s.",
|
You_hear("%s%s.",
|
||||||
(mattk->aatyp == AT_EXPL) ? "an explosion" : "some noises",
|
(mattk->aatyp == AT_EXPL) ? "an explosion" : "some noises",
|
||||||
farq ? " in the distance" : "");
|
farq ? " in the distance" : "");
|
||||||
@@ -342,7 +342,7 @@ register struct monst *magr, *mdef;
|
|||||||
* some cases, in which case this still counts as its move for the round
|
* some cases, in which case this still counts as its move for the round
|
||||||
* and it shouldn't move again.
|
* and it shouldn't move again.
|
||||||
*/
|
*/
|
||||||
magr->mlstmv = monstermoves;
|
magr->mlstmv = g.monstermoves;
|
||||||
|
|
||||||
/* Now perform all attacks for the monster. */
|
/* Now perform all attacks for the monster. */
|
||||||
for (i = 0; i < NATTK; i++) {
|
for (i = 0; i < NATTK; i++) {
|
||||||
|
|||||||
+2
-2
@@ -779,7 +779,7 @@ register struct monst *mtmp;
|
|||||||
bot();
|
bot();
|
||||||
/* give player a chance of waking up before dying -kaa */
|
/* give player a chance of waking up before dying -kaa */
|
||||||
if (sum[i] == 1) { /* successful attack */
|
if (sum[i] == 1) { /* successful attack */
|
||||||
if (u.usleep && u.usleep < monstermoves && !rn2(10)) {
|
if (u.usleep && u.usleep < g.monstermoves && !rn2(10)) {
|
||||||
g.multi = -1;
|
g.multi = -1;
|
||||||
g.nomovemsg = "The combat suddenly awakens you.";
|
g.nomovemsg = "The combat suddenly awakens you.";
|
||||||
}
|
}
|
||||||
@@ -1463,7 +1463,7 @@ register struct attack *mattk;
|
|||||||
dmg = 0;
|
dmg = 0;
|
||||||
} else {
|
} else {
|
||||||
if (Role_if(PM_HEALER)) {
|
if (Role_if(PM_HEALER)) {
|
||||||
if (!Deaf && !(moves % 5))
|
if (!Deaf && !(g.moves % 5))
|
||||||
verbalize("Doc, I can't help you unless you cooperate.");
|
verbalize("Doc, I can't help you unless you cooperate.");
|
||||||
dmg = 0;
|
dmg = 0;
|
||||||
} else
|
} else
|
||||||
|
|||||||
+19
-19
@@ -292,7 +292,7 @@ struct obj *box;
|
|||||||
case SACK:
|
case SACK:
|
||||||
case OILSKIN_SACK:
|
case OILSKIN_SACK:
|
||||||
/* initial inventory: sack starts out empty */
|
/* initial inventory: sack starts out empty */
|
||||||
if (moves <= 1 && !g.in_mklev) {
|
if (g.moves <= 1 && !g.in_mklev) {
|
||||||
n = 0;
|
n = 0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -761,7 +761,7 @@ boolean artif;
|
|||||||
|
|
||||||
otmp = newobj();
|
otmp = newobj();
|
||||||
*otmp = zeroobj;
|
*otmp = zeroobj;
|
||||||
otmp->age = monstermoves;
|
otmp->age = g.monstermoves;
|
||||||
otmp->o_id = context.ident++;
|
otmp->o_id = context.ident++;
|
||||||
if (!otmp->o_id)
|
if (!otmp->o_id)
|
||||||
otmp->o_id = context.ident++; /* ident overflowed */
|
otmp->o_id = context.ident++; /* ident overflowed */
|
||||||
@@ -987,7 +987,7 @@ boolean artif;
|
|||||||
otmp = mk_artifact(otmp, (aligntyp) A_NONE);
|
otmp = mk_artifact(otmp, (aligntyp) A_NONE);
|
||||||
/* simulate lacquered armor for samurai */
|
/* simulate lacquered armor for samurai */
|
||||||
if (Role_if(PM_SAMURAI) && otmp->otyp == SPLINT_MAIL
|
if (Role_if(PM_SAMURAI) && otmp->otyp == SPLINT_MAIL
|
||||||
&& (moves <= 1 || In_quest(&u.uz))) {
|
&& (g.moves <= 1 || In_quest(&u.uz))) {
|
||||||
#ifdef UNIXPC
|
#ifdef UNIXPC
|
||||||
/* optimizer bitfield bug */
|
/* optimizer bitfield bug */
|
||||||
otmp->oerodeproof = 1;
|
otmp->oerodeproof = 1;
|
||||||
@@ -1169,7 +1169,7 @@ struct obj *body;
|
|||||||
|
|
||||||
action = ROT_CORPSE; /* default action: rot away */
|
action = ROT_CORPSE; /* default action: rot away */
|
||||||
rot_adjust = g.in_mklev ? 25 : 10; /* give some variation */
|
rot_adjust = g.in_mklev ? 25 : 10; /* give some variation */
|
||||||
corpse_age = monstermoves - body->age;
|
corpse_age = g.monstermoves - body->age;
|
||||||
if (corpse_age > ROT_AGE)
|
if (corpse_age > ROT_AGE)
|
||||||
when = rot_adjust;
|
when = rot_adjust;
|
||||||
else
|
else
|
||||||
@@ -1774,12 +1774,12 @@ struct obj *otmp;
|
|||||||
|
|
||||||
if (otmp->otyp == CORPSE && otmp->on_ice) {
|
if (otmp->otyp == CORPSE && otmp->on_ice) {
|
||||||
/* Adjust the age; must be same as obj_timer_checks() for off ice*/
|
/* Adjust the age; must be same as obj_timer_checks() for off ice*/
|
||||||
age = monstermoves - otmp->age;
|
age = g.monstermoves - otmp->age;
|
||||||
retval += age * (ROT_ICE_ADJUSTMENT - 1) / ROT_ICE_ADJUSTMENT;
|
retval += age * (ROT_ICE_ADJUSTMENT - 1) / ROT_ICE_ADJUSTMENT;
|
||||||
debugpline3(
|
debugpline3(
|
||||||
"The %s age has ice modifications: otmp->age = %ld, returning %ld.",
|
"The %s age has ice modifications: otmp->age = %ld, returning %ld.",
|
||||||
s_suffix(doname(otmp)), otmp->age, retval);
|
s_suffix(doname(otmp)), otmp->age, retval);
|
||||||
debugpline1("Effective age of corpse: %ld.", monstermoves - retval);
|
debugpline1("Effective age of corpse: %ld.", g.monstermoves - retval);
|
||||||
}
|
}
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
@@ -1818,8 +1818,8 @@ int force; /* 0 = no force so do checks, <0 = force off, >0 force on */
|
|||||||
later calculations behave as if it had been on ice during
|
later calculations behave as if it had been on ice during
|
||||||
that time (longwinded way of saying this is the inverse
|
that time (longwinded way of saying this is the inverse
|
||||||
of removing it from the ice and of peeking at its age). */
|
of removing it from the ice and of peeking at its age). */
|
||||||
age = monstermoves - otmp->age;
|
age = g.monstermoves - otmp->age;
|
||||||
otmp->age = monstermoves - (age * ROT_ICE_ADJUSTMENT);
|
otmp->age = g.monstermoves - (age * ROT_ICE_ADJUSTMENT);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Check for corpses coming off ice */
|
/* Check for corpses coming off ice */
|
||||||
@@ -1840,7 +1840,7 @@ int force; /* 0 = no force so do checks, <0 = force off, >0 force on */
|
|||||||
tleft /= ROT_ICE_ADJUSTMENT;
|
tleft /= ROT_ICE_ADJUSTMENT;
|
||||||
restart_timer = TRUE;
|
restart_timer = TRUE;
|
||||||
/* Adjust the age */
|
/* Adjust the age */
|
||||||
age = monstermoves - otmp->age;
|
age = g.monstermoves - otmp->age;
|
||||||
otmp->age += age * (ROT_ICE_ADJUSTMENT - 1) / ROT_ICE_ADJUSTMENT;
|
otmp->age += age * (ROT_ICE_ADJUSTMENT - 1) / ROT_ICE_ADJUSTMENT;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1907,7 +1907,7 @@ struct monst *mtmp;
|
|||||||
* OBJ_MINVENT monster's invent chain
|
* OBJ_MINVENT monster's invent chain
|
||||||
* OBJ_MIGRATING migrating chain
|
* OBJ_MIGRATING migrating chain
|
||||||
* OBJ_BURIED level.buriedobjs chain
|
* OBJ_BURIED level.buriedobjs chain
|
||||||
* OBJ_ONBILL on billobjs chain
|
* OBJ_ONBILL on g.billobjs chain
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
obj_extract_self(obj)
|
obj_extract_self(obj)
|
||||||
@@ -1930,13 +1930,13 @@ struct obj *obj;
|
|||||||
extract_nobj(obj, &obj->ocarry->minvent);
|
extract_nobj(obj, &obj->ocarry->minvent);
|
||||||
break;
|
break;
|
||||||
case OBJ_MIGRATING:
|
case OBJ_MIGRATING:
|
||||||
extract_nobj(obj, &migrating_objs);
|
extract_nobj(obj, &g.migrating_objs);
|
||||||
break;
|
break;
|
||||||
case OBJ_BURIED:
|
case OBJ_BURIED:
|
||||||
extract_nobj(obj, &g.level.buriedobjlist);
|
extract_nobj(obj, &g.level.buriedobjlist);
|
||||||
break;
|
break;
|
||||||
case OBJ_ONBILL:
|
case OBJ_ONBILL:
|
||||||
extract_nobj(obj, &billobjs);
|
extract_nobj(obj, &g.billobjs);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
panic("obj_extract_self");
|
panic("obj_extract_self");
|
||||||
@@ -2055,8 +2055,8 @@ struct obj *obj;
|
|||||||
panic("add_to_migration: obj not free");
|
panic("add_to_migration: obj not free");
|
||||||
|
|
||||||
obj->where = OBJ_MIGRATING;
|
obj->where = OBJ_MIGRATING;
|
||||||
obj->nobj = migrating_objs;
|
obj->nobj = g.migrating_objs;
|
||||||
migrating_objs = obj;
|
g.migrating_objs = obj;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -2243,9 +2243,9 @@ obj_sanity_check()
|
|||||||
}
|
}
|
||||||
|
|
||||||
objlist_sanity(invent, OBJ_INVENT, "invent sanity");
|
objlist_sanity(invent, OBJ_INVENT, "invent sanity");
|
||||||
objlist_sanity(migrating_objs, OBJ_MIGRATING, "migrating sanity");
|
objlist_sanity(g.migrating_objs, OBJ_MIGRATING, "migrating sanity");
|
||||||
objlist_sanity(g.level.buriedobjlist, OBJ_BURIED, "buried sanity");
|
objlist_sanity(g.level.buriedobjlist, OBJ_BURIED, "buried sanity");
|
||||||
objlist_sanity(billobjs, OBJ_ONBILL, "bill sanity");
|
objlist_sanity(g.billobjs, OBJ_ONBILL, "bill sanity");
|
||||||
|
|
||||||
mon_obj_sanity(fmon, "minvent sanity");
|
mon_obj_sanity(fmon, "minvent sanity");
|
||||||
mon_obj_sanity(g.migrating_mons, "migrating minvent sanity");
|
mon_obj_sanity(g.migrating_mons, "migrating minvent sanity");
|
||||||
@@ -2732,10 +2732,10 @@ struct obj **obj1, **obj2;
|
|||||||
o2wt = otmp2->oeaten ? otmp2->oeaten : otmp2->owt;
|
o2wt = otmp2->oeaten ? otmp2->oeaten : otmp2->owt;
|
||||||
/* averaging the relative ages is less likely to overflow
|
/* averaging the relative ages is less likely to overflow
|
||||||
than averaging the absolute ages directly */
|
than averaging the absolute ages directly */
|
||||||
agetmp = (((moves - otmp1->age) * o1wt
|
agetmp = (((g.moves - otmp1->age) * o1wt
|
||||||
+ (moves - otmp2->age) * o2wt)
|
+ (g.moves - otmp2->age) * o2wt)
|
||||||
/ (o1wt + o2wt));
|
/ (o1wt + o2wt));
|
||||||
otmp1->age = moves - agetmp; /* conv. relative back to absolute */
|
otmp1->age = g.moves - agetmp; /* conv. relative back to absolute */
|
||||||
otmp1->owt += o2wt;
|
otmp1->owt += o2wt;
|
||||||
if (otmp1->oeaten)
|
if (otmp1->oeaten)
|
||||||
otmp1->oeaten += o2wt;
|
otmp1->oeaten += o2wt;
|
||||||
|
|||||||
@@ -754,9 +754,9 @@ movemon()
|
|||||||
mon->isgd flag so that dmonsfree() will get rid of mon) */
|
mon->isgd flag so that dmonsfree() will get rid of mon) */
|
||||||
if (mtmp->isgd && !mtmp->mx) {
|
if (mtmp->isgd && !mtmp->mx) {
|
||||||
/* parked at <0,0>; eventually isgd should get set to false */
|
/* parked at <0,0>; eventually isgd should get set to false */
|
||||||
if (monstermoves > mtmp->mlstmv) {
|
if (g.monstermoves > mtmp->mlstmv) {
|
||||||
(void) gd_move(mtmp);
|
(void) gd_move(mtmp);
|
||||||
mtmp->mlstmv = monstermoves;
|
mtmp->mlstmv = g.monstermoves;
|
||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -1048,7 +1048,7 @@ struct monst *mtmp;
|
|||||||
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) {
|
||||||
otmp3->age = monstermoves - otmp3->age;
|
otmp3->age = g.monstermoves - otmp3->age;
|
||||||
start_corpse_timeout(otmp3);
|
start_corpse_timeout(otmp3);
|
||||||
}
|
}
|
||||||
(void) mpickobj(mtmp, otmp3);
|
(void) mpickobj(mtmp, otmp3);
|
||||||
@@ -2899,7 +2899,7 @@ int x, y, distance;
|
|||||||
continue;
|
continue;
|
||||||
if (mtmp->mtame) {
|
if (mtmp->mtame) {
|
||||||
if (!mtmp->isminion)
|
if (!mtmp->isminion)
|
||||||
EDOG(mtmp)->whistletime = moves;
|
EDOG(mtmp)->whistletime = g.moves;
|
||||||
/* Clear mtrack. This is to fix up a pet who is
|
/* Clear mtrack. This is to fix up a pet who is
|
||||||
stuck "fleeing" its master. */
|
stuck "fleeing" its master. */
|
||||||
memset(mtmp->mtrack, 0, sizeof mtmp->mtrack);
|
memset(mtmp->mtrack, 0, sizeof mtmp->mtrack);
|
||||||
@@ -3823,7 +3823,7 @@ kill_genocided_monsters()
|
|||||||
|
|
||||||
kill_eggs(invent);
|
kill_eggs(invent);
|
||||||
kill_eggs(fobj);
|
kill_eggs(fobj);
|
||||||
kill_eggs(migrating_objs);
|
kill_eggs(g.migrating_objs);
|
||||||
kill_eggs(g.level.buriedobjlist);
|
kill_eggs(g.level.buriedobjlist);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -186,7 +186,7 @@ mon_regen(mon, digest_meal)
|
|||||||
struct monst *mon;
|
struct monst *mon;
|
||||||
boolean digest_meal;
|
boolean digest_meal;
|
||||||
{
|
{
|
||||||
if (mon->mhp < mon->mhpmax && (moves % 20 == 0 || regenerates(mon->data)))
|
if (mon->mhp < mon->mhpmax && (g.moves % 20 == 0 || regenerates(mon->data)))
|
||||||
mon->mhp++;
|
mon->mhp++;
|
||||||
if (mon->mspec_used)
|
if (mon->mspec_used)
|
||||||
mon->mspec_used--;
|
mon->mspec_used--;
|
||||||
|
|||||||
+4
-4
@@ -2267,14 +2267,14 @@ boolean stoning; /* True: stop petrification, False: cure stun && confusion */
|
|||||||
if (mon->mtame && !mon->isminion && nutrit > 0) {
|
if (mon->mtame && !mon->isminion && nutrit > 0) {
|
||||||
struct edog *edog = EDOG(mon);
|
struct edog *edog = EDOG(mon);
|
||||||
|
|
||||||
if (edog->hungrytime < monstermoves)
|
if (edog->hungrytime < g.monstermoves)
|
||||||
edog->hungrytime = monstermoves;
|
edog->hungrytime = g.monstermoves;
|
||||||
edog->hungrytime += nutrit;
|
edog->hungrytime += nutrit;
|
||||||
mon->mconf = 0;
|
mon->mconf = 0;
|
||||||
}
|
}
|
||||||
/* use up monster's next move */
|
/* use up monster's next move */
|
||||||
mon->movement -= NORMAL_SPEED;
|
mon->movement -= NORMAL_SPEED;
|
||||||
mon->mlstmv = monstermoves;
|
mon->mlstmv = g.monstermoves;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* decide whether obj can cure petrification; also used when picking up */
|
/* decide whether obj can cure petrification; also used when picking up */
|
||||||
@@ -2506,7 +2506,7 @@ boolean by_you; /* true: if mon kills itself, hero gets credit/blame */
|
|||||||
}
|
}
|
||||||
/* use up monster's next move */
|
/* use up monster's next move */
|
||||||
mon->movement -= NORMAL_SPEED;
|
mon->movement -= NORMAL_SPEED;
|
||||||
mon->mlstmv = monstermoves;
|
mon->mlstmv = g.monstermoves;
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -360,7 +360,7 @@ boolean credit_hero;
|
|||||||
exercise(A_WIS, TRUE);
|
exercise(A_WIS, TRUE);
|
||||||
}
|
}
|
||||||
/* moves==1L => initial inventory, gameover => final disclosure */
|
/* moves==1L => initial inventory, gameover => final disclosure */
|
||||||
if (moves > 1L && !program_state.gameover) {
|
if (g.moves > 1L && !program_state.gameover) {
|
||||||
if (objects[oindx].oc_class == GEM_CLASS)
|
if (objects[oindx].oc_class == GEM_CLASS)
|
||||||
gem_learned(oindx); /* could affect price of unpaid gems */
|
gem_learned(oindx); /* could affect price of unpaid gems */
|
||||||
update_inventory();
|
update_inventory();
|
||||||
|
|||||||
+3
-3
@@ -2170,7 +2170,7 @@ register struct obj *obj;
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (Icebox && !age_is_relative(obj)) {
|
if (Icebox && !age_is_relative(obj)) {
|
||||||
obj->age = monstermoves - obj->age; /* actual age */
|
obj->age = g.monstermoves - obj->age; /* actual age */
|
||||||
/* stop any corpse timeouts when frozen */
|
/* stop any corpse timeouts when frozen */
|
||||||
if (obj->otyp == CORPSE && obj->timed) {
|
if (obj->otyp == CORPSE && obj->timed) {
|
||||||
long rot_alarm = stop_timer(ROT_CORPSE, obj_to_any(obj));
|
long rot_alarm = stop_timer(ROT_CORPSE, obj_to_any(obj));
|
||||||
@@ -2296,7 +2296,7 @@ removed_from_icebox(obj)
|
|||||||
struct obj *obj;
|
struct obj *obj;
|
||||||
{
|
{
|
||||||
if (!age_is_relative(obj)) {
|
if (!age_is_relative(obj)) {
|
||||||
obj->age = monstermoves - obj->age; /* actual age */
|
obj->age = g.monstermoves - obj->age; /* actual age */
|
||||||
if (obj->otyp == CORPSE)
|
if (obj->otyp == CORPSE)
|
||||||
start_corpse_timeout(obj);
|
start_corpse_timeout(obj);
|
||||||
}
|
}
|
||||||
@@ -2376,7 +2376,7 @@ boolean makecat, givemsg;
|
|||||||
/* set_corpsenm() will start the rot timer that was removed
|
/* set_corpsenm() will start the rot timer that was removed
|
||||||
when makemon() created SchroedingersBox; start it from
|
when makemon() created SchroedingersBox; start it from
|
||||||
now rather than from when this special corpse got created */
|
now rather than from when this special corpse got created */
|
||||||
deadcat->age = monstermoves;
|
deadcat->age = g.monstermoves;
|
||||||
set_corpsenm(deadcat, PM_HOUSECAT);
|
set_corpsenm(deadcat, PM_HOUSECAT);
|
||||||
deadcat = oname(deadcat, sc);
|
deadcat = oname(deadcat, sc);
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -1335,7 +1335,7 @@ dosacrifice()
|
|||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
if (otmp->corpsenm == PM_ACID_BLOB
|
if (otmp->corpsenm == PM_ACID_BLOB
|
||||||
|| (monstermoves <= peek_at_iced_corpse_age(otmp) + 50)) {
|
|| (g.monstermoves <= peek_at_iced_corpse_age(otmp) + 50)) {
|
||||||
value = mons[otmp->corpsenm].difficulty + 1;
|
value = mons[otmp->corpsenm].difficulty + 1;
|
||||||
if (otmp->oeaten)
|
if (otmp->oeaten)
|
||||||
value = eaten_stat(value, otmp);
|
value = eaten_stat(value, otmp);
|
||||||
|
|||||||
+8
-8
@@ -406,7 +406,7 @@ int roomno;
|
|||||||
sanctum = (priest->data == &mons[PM_HIGH_PRIEST]
|
sanctum = (priest->data == &mons[PM_HIGH_PRIEST]
|
||||||
&& (Is_sanctum(&u.uz) || In_endgame(&u.uz)));
|
&& (Is_sanctum(&u.uz) || In_endgame(&u.uz)));
|
||||||
can_speak = (priest->mcanmove && !priest->msleeping);
|
can_speak = (priest->mcanmove && !priest->msleeping);
|
||||||
if (can_speak && !Deaf && moves >= epri_p->intone_time) {
|
if (can_speak && !Deaf && g.moves >= epri_p->intone_time) {
|
||||||
unsigned save_priest = priest->ispriest;
|
unsigned save_priest = priest->ispriest;
|
||||||
|
|
||||||
/* don't reveal the altar's owner upon temple entry in
|
/* don't reveal the altar's owner upon temple entry in
|
||||||
@@ -417,7 +417,7 @@ int roomno;
|
|||||||
pline("%s intones:",
|
pline("%s intones:",
|
||||||
canseemon(priest) ? Monnam(priest) : "A nearby voice");
|
canseemon(priest) ? Monnam(priest) : "A nearby voice");
|
||||||
priest->ispriest = save_priest;
|
priest->ispriest = save_priest;
|
||||||
epri_p->intone_time = moves + (long) d(10, 500); /* ~2505 */
|
epri_p->intone_time = g.moves + (long) d(10, 500); /* ~2505 */
|
||||||
/* make sure that we don't suppress entry message when
|
/* make sure that we don't suppress entry message when
|
||||||
we've just given its "priest intones" introduction */
|
we've just given its "priest intones" introduction */
|
||||||
epri_p->enter_time = 0L;
|
epri_p->enter_time = 0L;
|
||||||
@@ -435,7 +435,7 @@ int roomno;
|
|||||||
/* repeat visit, or attacked priest before entering */
|
/* repeat visit, or attacked priest before entering */
|
||||||
msg1 = "You desecrate this place by your presence!";
|
msg1 = "You desecrate this place by your presence!";
|
||||||
}
|
}
|
||||||
} else if (moves >= epri_p->enter_time) {
|
} else if (g.moves >= epri_p->enter_time) {
|
||||||
Sprintf(buf, "Pilgrim, you enter a %s place!",
|
Sprintf(buf, "Pilgrim, you enter a %s place!",
|
||||||
!shrined ? "desecrated" : "sacred");
|
!shrined ? "desecrated" : "sacred");
|
||||||
msg1 = buf;
|
msg1 = buf;
|
||||||
@@ -444,7 +444,7 @@ int roomno;
|
|||||||
verbalize1(msg1);
|
verbalize1(msg1);
|
||||||
if (msg2)
|
if (msg2)
|
||||||
verbalize1(msg2);
|
verbalize1(msg2);
|
||||||
epri_p->enter_time = moves + (long) d(10, 100); /* ~505 */
|
epri_p->enter_time = g.moves + (long) d(10, 100); /* ~505 */
|
||||||
}
|
}
|
||||||
if (!sanctum) {
|
if (!sanctum) {
|
||||||
if (!shrined || !p_coaligned(priest)
|
if (!shrined || !p_coaligned(priest)
|
||||||
@@ -462,9 +462,9 @@ int roomno;
|
|||||||
/* give message if we haven't seen it recently or
|
/* give message if we haven't seen it recently or
|
||||||
if alignment update has caused it to switch from
|
if alignment update has caused it to switch from
|
||||||
forbidding to sense-of-peace or vice versa */
|
forbidding to sense-of-peace or vice versa */
|
||||||
if (moves >= *this_time || *other_time >= *this_time) {
|
if (g.moves >= *this_time || *other_time >= *this_time) {
|
||||||
You(msg1, msg2);
|
You(msg1, msg2);
|
||||||
*this_time = moves + (long) d(10, 20); /* ~55 */
|
*this_time = g.moves + (long) d(10, 20); /* ~55 */
|
||||||
/* avoid being tricked by the RNG: switch might have just
|
/* avoid being tricked by the RNG: switch might have just
|
||||||
happened and previous random threshold could be larger */
|
happened and previous random threshold could be larger */
|
||||||
if (*this_time <= *other_time)
|
if (*this_time <= *other_time)
|
||||||
@@ -630,9 +630,9 @@ register struct monst *priest;
|
|||||||
} else {
|
} else {
|
||||||
verbalize("Thy selfless generosity is deeply appreciated.");
|
verbalize("Thy selfless generosity is deeply appreciated.");
|
||||||
if (money_cnt(invent) < (offer * 2L) && coaligned) {
|
if (money_cnt(invent) < (offer * 2L) && coaligned) {
|
||||||
if (strayed && (moves - u.ucleansed) > 5000L) {
|
if (strayed && (g.moves - u.ucleansed) > 5000L) {
|
||||||
u.ualign.record = 0; /* cleanse thee */
|
u.ualign.record = 0; /* cleanse thee */
|
||||||
u.ucleansed = moves;
|
u.ucleansed = g.moves;
|
||||||
} else {
|
} else {
|
||||||
adjalign(2);
|
adjalign(2);
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -232,7 +232,7 @@ unsigned whichchains;
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (!qarti)
|
if (!qarti)
|
||||||
qarti = find_qarti(migrating_objs);
|
qarti = find_qarti(g.migrating_objs);
|
||||||
}
|
}
|
||||||
if (!qarti && (whichchains & (1 << OBJ_BURIED)) != 0)
|
if (!qarti && (whichchains & (1 << OBJ_BURIED)) != 0)
|
||||||
qarti = find_qarti(g.level.buriedobjlist);
|
qarti = find_qarti(g.level.buriedobjlist);
|
||||||
|
|||||||
+2
-2
@@ -627,7 +627,7 @@ int mode;
|
|||||||
if (!perform_bwrite(mode))
|
if (!perform_bwrite(mode))
|
||||||
goto skip_lots;
|
goto skip_lots;
|
||||||
|
|
||||||
bwrite(fd, (genericptr_t) &moves, sizeof(moves)); /* timestamp */
|
bwrite(fd, (genericptr_t) &g.moves, sizeof(g.moves)); /* timestamp */
|
||||||
bwrite(fd, (genericptr_t) &n_regions, sizeof(n_regions));
|
bwrite(fd, (genericptr_t) &n_regions, sizeof(n_regions));
|
||||||
for (i = 0; i < n_regions; i++) {
|
for (i = 0; i < n_regions; i++) {
|
||||||
bwrite(fd, (genericptr_t) ®ions[i]->bounding_box, sizeof(NhRect));
|
bwrite(fd, (genericptr_t) ®ions[i]->bounding_box, sizeof(NhRect));
|
||||||
@@ -687,7 +687,7 @@ boolean ghostly; /* If a bones file restore */
|
|||||||
if (ghostly)
|
if (ghostly)
|
||||||
tmstamp = 0;
|
tmstamp = 0;
|
||||||
else
|
else
|
||||||
tmstamp = (moves - tmstamp);
|
tmstamp = (g.moves - tmstamp);
|
||||||
mread(fd, (genericptr_t) &n_regions, sizeof(n_regions));
|
mread(fd, (genericptr_t) &n_regions, sizeof(n_regions));
|
||||||
max_regions = n_regions;
|
max_regions = n_regions;
|
||||||
if (n_regions > 0)
|
if (n_regions > 0)
|
||||||
|
|||||||
+7
-7
@@ -172,7 +172,7 @@ boolean ghostly;
|
|||||||
|
|
||||||
mread(fd, (genericptr_t) tmp_dam, sizeof(*tmp_dam));
|
mread(fd, (genericptr_t) tmp_dam, sizeof(*tmp_dam));
|
||||||
if (ghostly)
|
if (ghostly)
|
||||||
tmp_dam->when += (monstermoves - g.omoves);
|
tmp_dam->when += (g.monstermoves - g.omoves);
|
||||||
Strcpy(damaged_shops,
|
Strcpy(damaged_shops,
|
||||||
in_rooms(tmp_dam->place.x, tmp_dam->place.y, SHOPBASE));
|
in_rooms(tmp_dam->place.x, tmp_dam->place.y, SHOPBASE));
|
||||||
if (u.uz.dlevel) {
|
if (u.uz.dlevel) {
|
||||||
@@ -286,7 +286,7 @@ boolean ghostly, frozen;
|
|||||||
* immediately after old player died.
|
* immediately after old player died.
|
||||||
*/
|
*/
|
||||||
if (ghostly && !frozen && !age_is_relative(otmp))
|
if (ghostly && !frozen && !age_is_relative(otmp))
|
||||||
otmp->age = monstermoves - g.omoves + otmp->age;
|
otmp->age = g.monstermoves - g.omoves + otmp->age;
|
||||||
|
|
||||||
/* get contents of a container or statue */
|
/* get contents of a container or statue */
|
||||||
if (Has_contents(otmp)) {
|
if (Has_contents(otmp)) {
|
||||||
@@ -649,7 +649,7 @@ unsigned int *stuckid, *steedid;
|
|||||||
impossible("restgamestate: lost ball & chain");
|
impossible("restgamestate: lost ball & chain");
|
||||||
}
|
}
|
||||||
|
|
||||||
migrating_objs = restobjchn(fd, FALSE, FALSE);
|
g.migrating_objs = restobjchn(fd, FALSE, FALSE);
|
||||||
g.migrating_mons = restmonchn(fd, FALSE);
|
g.migrating_mons = restmonchn(fd, FALSE);
|
||||||
mread(fd, (genericptr_t) g.mvitals, sizeof(g.mvitals));
|
mread(fd, (genericptr_t) g.mvitals, sizeof(g.mvitals));
|
||||||
|
|
||||||
@@ -676,8 +676,8 @@ unsigned int *stuckid, *steedid;
|
|||||||
|
|
||||||
restore_dungeon(fd);
|
restore_dungeon(fd);
|
||||||
restlevchn(fd);
|
restlevchn(fd);
|
||||||
mread(fd, (genericptr_t) &moves, sizeof moves);
|
mread(fd, (genericptr_t) &g.moves, sizeof g.moves);
|
||||||
mread(fd, (genericptr_t) &monstermoves, sizeof monstermoves);
|
mread(fd, (genericptr_t) &g.monstermoves, sizeof g.monstermoves);
|
||||||
mread(fd, (genericptr_t) &g.quest_status, sizeof (struct q_score));
|
mread(fd, (genericptr_t) &g.quest_status, sizeof (struct q_score));
|
||||||
mread(fd, (genericptr_t) g.spl_book, (MAXSPELL + 1) * sizeof (struct spell));
|
mread(fd, (genericptr_t) g.spl_book, (MAXSPELL + 1) * sizeof (struct spell));
|
||||||
restore_artifacts(fd);
|
restore_artifacts(fd);
|
||||||
@@ -1057,7 +1057,7 @@ boolean ghostly;
|
|||||||
(boolean) ((sfrestinfo.sfi1 & SFI1_RLECOMP) == SFI1_RLECOMP));
|
(boolean) ((sfrestinfo.sfi1 & SFI1_RLECOMP) == SFI1_RLECOMP));
|
||||||
mread(fd, (genericptr_t) g.lastseentyp, sizeof(g.lastseentyp));
|
mread(fd, (genericptr_t) g.lastseentyp, sizeof(g.lastseentyp));
|
||||||
mread(fd, (genericptr_t) &g.omoves, sizeof(g.omoves));
|
mread(fd, (genericptr_t) &g.omoves, sizeof(g.omoves));
|
||||||
elapsed = monstermoves - g.omoves;
|
elapsed = g.monstermoves - g.omoves;
|
||||||
mread(fd, (genericptr_t) &g.upstair, sizeof(stairway));
|
mread(fd, (genericptr_t) &g.upstair, sizeof(stairway));
|
||||||
mread(fd, (genericptr_t) &g.dnstair, sizeof(stairway));
|
mread(fd, (genericptr_t) &g.dnstair, sizeof(stairway));
|
||||||
mread(fd, (genericptr_t) &g.upladder, sizeof(stairway));
|
mread(fd, (genericptr_t) &g.upladder, sizeof(stairway));
|
||||||
@@ -1091,7 +1091,7 @@ boolean ghostly;
|
|||||||
/* restobjchn()'s `frozen' argument probably ought to be a callback
|
/* restobjchn()'s `frozen' argument probably ought to be a callback
|
||||||
routine so that we can check for objects being buried under ice */
|
routine so that we can check for objects being buried under ice */
|
||||||
g.level.buriedobjlist = restobjchn(fd, ghostly, FALSE);
|
g.level.buriedobjlist = restobjchn(fd, ghostly, FALSE);
|
||||||
billobjs = restobjchn(fd, ghostly, FALSE);
|
g.billobjs = restobjchn(fd, ghostly, FALSE);
|
||||||
rest_engravings(fd);
|
rest_engravings(fd);
|
||||||
|
|
||||||
/* reset level.monsters for new level */
|
/* reset level.monsters for new level */
|
||||||
|
|||||||
+11
-11
@@ -300,7 +300,7 @@ register int fd, mode;
|
|||||||
urealtime.start_timing = urealtime.finish_time;
|
urealtime.start_timing = urealtime.finish_time;
|
||||||
save_killers(fd, mode);
|
save_killers(fd, mode);
|
||||||
|
|
||||||
/* must come before migrating_objs and g.migrating_mons are freed */
|
/* must come before g.migrating_objs and g.migrating_mons are freed */
|
||||||
save_timers(fd, mode, RANGE_GLOBAL);
|
save_timers(fd, mode, RANGE_GLOBAL);
|
||||||
save_light_sources(fd, mode, RANGE_GLOBAL);
|
save_light_sources(fd, mode, RANGE_GLOBAL);
|
||||||
|
|
||||||
@@ -314,11 +314,11 @@ register int fd, mode;
|
|||||||
saveobjchn(fd, (struct obj *) 0, mode);
|
saveobjchn(fd, (struct obj *) 0, mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
saveobjchn(fd, migrating_objs, mode);
|
saveobjchn(fd, g.migrating_objs, mode);
|
||||||
savemonchn(fd, g.migrating_mons, mode);
|
savemonchn(fd, g.migrating_mons, mode);
|
||||||
if (release_data(mode)) {
|
if (release_data(mode)) {
|
||||||
invent = 0;
|
invent = 0;
|
||||||
migrating_objs = 0;
|
g.migrating_objs = 0;
|
||||||
g.migrating_mons = 0;
|
g.migrating_mons = 0;
|
||||||
}
|
}
|
||||||
bwrite(fd, (genericptr_t) g.mvitals, sizeof(g.mvitals));
|
bwrite(fd, (genericptr_t) g.mvitals, sizeof(g.mvitals));
|
||||||
@@ -326,8 +326,8 @@ register int fd, mode;
|
|||||||
save_dungeon(fd, (boolean) !!perform_bwrite(mode),
|
save_dungeon(fd, (boolean) !!perform_bwrite(mode),
|
||||||
(boolean) !!release_data(mode));
|
(boolean) !!release_data(mode));
|
||||||
savelevchn(fd, mode);
|
savelevchn(fd, mode);
|
||||||
bwrite(fd, (genericptr_t) &moves, sizeof moves);
|
bwrite(fd, (genericptr_t) &g.moves, sizeof g.moves);
|
||||||
bwrite(fd, (genericptr_t) &monstermoves, sizeof monstermoves);
|
bwrite(fd, (genericptr_t) &g.monstermoves, sizeof g.monstermoves);
|
||||||
bwrite(fd, (genericptr_t) &g.quest_status, sizeof(struct q_score));
|
bwrite(fd, (genericptr_t) &g.quest_status, sizeof(struct q_score));
|
||||||
bwrite(fd, (genericptr_t) g.spl_book,
|
bwrite(fd, (genericptr_t) g.spl_book,
|
||||||
sizeof(struct spell) * (MAXSPELL + 1));
|
sizeof(struct spell) * (MAXSPELL + 1));
|
||||||
@@ -452,7 +452,7 @@ int mode;
|
|||||||
}
|
}
|
||||||
if (mode != FREE_SAVE) {
|
if (mode != FREE_SAVE) {
|
||||||
g.level_info[lev].where = ACTIVE;
|
g.level_info[lev].where = ACTIVE;
|
||||||
g.level_info[lev].time = moves;
|
g.level_info[lev].time = g.moves;
|
||||||
g.level_info[lev].size = bytes_counted;
|
g.level_info[lev].size = bytes_counted;
|
||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
@@ -504,7 +504,7 @@ int mode;
|
|||||||
savelevl(fd,
|
savelevl(fd,
|
||||||
(boolean) ((sfsaveinfo.sfi1 & SFI1_RLECOMP) == SFI1_RLECOMP));
|
(boolean) ((sfsaveinfo.sfi1 & SFI1_RLECOMP) == SFI1_RLECOMP));
|
||||||
bwrite(fd, (genericptr_t) g.lastseentyp, sizeof(g.lastseentyp));
|
bwrite(fd, (genericptr_t) g.lastseentyp, sizeof(g.lastseentyp));
|
||||||
bwrite(fd, (genericptr_t) &monstermoves, sizeof(monstermoves));
|
bwrite(fd, (genericptr_t) &g.monstermoves, sizeof(g.monstermoves));
|
||||||
bwrite(fd, (genericptr_t) &g.upstair, sizeof(stairway));
|
bwrite(fd, (genericptr_t) &g.upstair, sizeof(stairway));
|
||||||
bwrite(fd, (genericptr_t) &g.dnstair, sizeof(stairway));
|
bwrite(fd, (genericptr_t) &g.dnstair, sizeof(stairway));
|
||||||
bwrite(fd, (genericptr_t) &g.upladder, sizeof(stairway));
|
bwrite(fd, (genericptr_t) &g.upladder, sizeof(stairway));
|
||||||
@@ -530,7 +530,7 @@ skip_lots:
|
|||||||
savetrapchn(fd, g.ftrap, mode);
|
savetrapchn(fd, g.ftrap, mode);
|
||||||
saveobjchn(fd, fobj, mode);
|
saveobjchn(fd, fobj, mode);
|
||||||
saveobjchn(fd, g.level.buriedobjlist, mode);
|
saveobjchn(fd, g.level.buriedobjlist, mode);
|
||||||
saveobjchn(fd, billobjs, mode);
|
saveobjchn(fd, g.billobjs, mode);
|
||||||
if (release_data(mode)) {
|
if (release_data(mode)) {
|
||||||
int x,y;
|
int x,y;
|
||||||
|
|
||||||
@@ -541,7 +541,7 @@ skip_lots:
|
|||||||
g.ftrap = 0;
|
g.ftrap = 0;
|
||||||
fobj = 0;
|
fobj = 0;
|
||||||
g.level.buriedobjlist = 0;
|
g.level.buriedobjlist = 0;
|
||||||
billobjs = 0;
|
g.billobjs = 0;
|
||||||
/* level.bonesinfo = 0; -- handled by savecemetery() */
|
/* level.bonesinfo = 0; -- handled by savecemetery() */
|
||||||
}
|
}
|
||||||
save_engravings(fd, mode);
|
save_engravings(fd, mode);
|
||||||
@@ -1360,7 +1360,7 @@ freedynamicdata()
|
|||||||
freetrapchn(g.ftrap);
|
freetrapchn(g.ftrap);
|
||||||
freeobjchn(fobj);
|
freeobjchn(fobj);
|
||||||
freeobjchn(g.level.buriedobjlist);
|
freeobjchn(g.level.buriedobjlist);
|
||||||
freeobjchn(billobjs);
|
freeobjchn(g.billobjs);
|
||||||
free_engravings();
|
free_engravings();
|
||||||
freedamage();
|
freedamage();
|
||||||
|
|
||||||
@@ -1369,7 +1369,7 @@ freedynamicdata()
|
|||||||
free_timers(RANGE_GLOBAL);
|
free_timers(RANGE_GLOBAL);
|
||||||
free_light_sources(RANGE_GLOBAL);
|
free_light_sources(RANGE_GLOBAL);
|
||||||
freeobjchn(invent);
|
freeobjchn(invent);
|
||||||
freeobjchn(migrating_objs);
|
freeobjchn(g.migrating_objs);
|
||||||
freemonchn(g.migrating_mons);
|
freemonchn(g.migrating_mons);
|
||||||
freemonchn(g.mydogs); /* ascension or dungeon escape */
|
freemonchn(g.mydogs); /* ascension or dungeon escape */
|
||||||
/* freelevchn(); -- [folded into free_dungeons()] */
|
/* freelevchn(); -- [folded into free_dungeons()] */
|
||||||
|
|||||||
@@ -305,7 +305,7 @@ register struct monst *shkp;
|
|||||||
for (mtmp = g.migrating_mons; mtmp; mtmp = mtmp->nmon)
|
for (mtmp = g.migrating_mons; mtmp; mtmp = mtmp->nmon)
|
||||||
clear_unpaid(shkp, mtmp->minvent);
|
clear_unpaid(shkp, mtmp->minvent);
|
||||||
|
|
||||||
while ((obj = billobjs) != 0) {
|
while ((obj = g.billobjs) != 0) {
|
||||||
obj_extract_self(obj);
|
obj_extract_self(obj);
|
||||||
dealloc_obj(obj);
|
dealloc_obj(obj);
|
||||||
}
|
}
|
||||||
@@ -693,7 +693,7 @@ struct obj *obj;
|
|||||||
|
|
||||||
/* if you bring a sack of N picks into a shop to sell,
|
/* if you bring a sack of N picks into a shop to sell,
|
||||||
don't repeat this N times when they're taken out */
|
don't repeat this N times when they're taken out */
|
||||||
if (moves != pickmovetime) {
|
if (g.moves != pickmovetime) {
|
||||||
if (!Deaf && !muteshk(shkp))
|
if (!Deaf && !muteshk(shkp))
|
||||||
verbalize("You sneaky %s! Get out of here with that pick!",
|
verbalize("You sneaky %s! Get out of here with that pick!",
|
||||||
cad(FALSE));
|
cad(FALSE));
|
||||||
@@ -703,7 +703,7 @@ struct obj *obj;
|
|||||||
haseyes(shkp->data) ? "glares at"
|
haseyes(shkp->data) ? "glares at"
|
||||||
: "is dismayed because of");
|
: "is dismayed because of");
|
||||||
}
|
}
|
||||||
pickmovetime = moves;
|
pickmovetime = g.moves;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1915,7 +1915,7 @@ register struct bill_x *bp;
|
|||||||
register unsigned int id = bp->bo_id;
|
register unsigned int id = bp->bo_id;
|
||||||
|
|
||||||
if (bp->useup)
|
if (bp->useup)
|
||||||
obj = o_on(id, billobjs);
|
obj = o_on(id, g.billobjs);
|
||||||
else
|
else
|
||||||
obj = find_oid(id);
|
obj = find_oid(id);
|
||||||
return obj;
|
return obj;
|
||||||
@@ -1924,7 +1924,7 @@ register struct bill_x *bp;
|
|||||||
/*
|
/*
|
||||||
* Look for o_id on all lists but billobj. Return obj or NULL if not found.
|
* Look for o_id on all lists but billobj. Return obj or NULL if not found.
|
||||||
* Its OK for restore_timers() to call this function, there should not
|
* Its OK for restore_timers() to call this function, there should not
|
||||||
* be any timeouts on the billobjs chain.
|
* be any timeouts on the g.billobjs chain.
|
||||||
*/
|
*/
|
||||||
struct obj *
|
struct obj *
|
||||||
find_oid(id)
|
find_oid(id)
|
||||||
@@ -1941,7 +1941,7 @@ unsigned id;
|
|||||||
return obj;
|
return obj;
|
||||||
if ((obj = o_on(id, g.level.buriedobjlist)) != 0)
|
if ((obj = o_on(id, g.level.buriedobjlist)) != 0)
|
||||||
return obj;
|
return obj;
|
||||||
if ((obj = o_on(id, migrating_objs)) != 0)
|
if ((obj = o_on(id, g.migrating_objs)) != 0)
|
||||||
return obj;
|
return obj;
|
||||||
|
|
||||||
/* not found yet; check inventory for members of various monst lists */
|
/* not found yet; check inventory for members of various monst lists */
|
||||||
@@ -2402,7 +2402,7 @@ struct monst *shkp;
|
|||||||
bp->bo_id = obj->o_id;
|
bp->bo_id = obj->o_id;
|
||||||
bp->bquan = obj->quan;
|
bp->bquan = obj->quan;
|
||||||
if (dummy) { /* a dummy object must be inserted into */
|
if (dummy) { /* a dummy object must be inserted into */
|
||||||
bp->useup = 1; /* the billobjs chain here. crucial for */
|
bp->useup = 1; /* the g.billobjs chain here. crucial for */
|
||||||
add_to_billobjs(obj); /* eating floorfood in shop. see eat.c */
|
add_to_billobjs(obj); /* eating floorfood in shop. see eat.c */
|
||||||
} else
|
} else
|
||||||
bp->useup = 0;
|
bp->useup = 0;
|
||||||
@@ -2420,8 +2420,8 @@ struct obj *obj;
|
|||||||
if (obj->timed)
|
if (obj->timed)
|
||||||
obj_stop_timers(obj);
|
obj_stop_timers(obj);
|
||||||
|
|
||||||
obj->nobj = billobjs;
|
obj->nobj = g.billobjs;
|
||||||
billobjs = obj;
|
g.billobjs = obj;
|
||||||
obj->where = OBJ_ONBILL;
|
obj->where = OBJ_ONBILL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3360,12 +3360,12 @@ long cost;
|
|||||||
for (tmp_dam = g.level.damagelist; tmp_dam; tmp_dam = tmp_dam->next)
|
for (tmp_dam = g.level.damagelist; tmp_dam; tmp_dam = tmp_dam->next)
|
||||||
if (tmp_dam->place.x == x && tmp_dam->place.y == y) {
|
if (tmp_dam->place.x == x && tmp_dam->place.y == y) {
|
||||||
tmp_dam->cost += cost;
|
tmp_dam->cost += cost;
|
||||||
tmp_dam->when = monstermoves; /* needed by pay_for_damage() */
|
tmp_dam->when = g.monstermoves; /* needed by pay_for_damage() */
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
tmp_dam = (struct damage *) alloc((unsigned) sizeof *tmp_dam);
|
tmp_dam = (struct damage *) alloc((unsigned) sizeof *tmp_dam);
|
||||||
(void) memset((genericptr_t) tmp_dam, 0, sizeof *tmp_dam);
|
(void) memset((genericptr_t) tmp_dam, 0, sizeof *tmp_dam);
|
||||||
tmp_dam->when = monstermoves;
|
tmp_dam->when = g.monstermoves;
|
||||||
tmp_dam->place.x = x;
|
tmp_dam->place.x = x;
|
||||||
tmp_dam->place.y = y;
|
tmp_dam->place.y = y;
|
||||||
tmp_dam->cost = cost;
|
tmp_dam->cost = cost;
|
||||||
@@ -3521,7 +3521,7 @@ boolean catchup; /* restoring a level */
|
|||||||
struct trap *ttmp;
|
struct trap *ttmp;
|
||||||
int i, k, ix, iy, disposition = 1;
|
int i, k, ix, iy, disposition = 1;
|
||||||
|
|
||||||
if ((monstermoves - tmp_dam->when) < REPAIR_DELAY)
|
if ((g.monstermoves - tmp_dam->when) < REPAIR_DELAY)
|
||||||
return 0;
|
return 0;
|
||||||
if (shkp->msleeping || !shkp->mcanmove || ESHK(shkp)->following)
|
if (shkp->msleeping || !shkp->mcanmove || ESHK(shkp)->following)
|
||||||
return 0;
|
return 0;
|
||||||
@@ -3692,7 +3692,7 @@ struct monst *shkp;
|
|||||||
eshkp->following = 0;
|
eshkp->following = 0;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
if (moves > followmsg + 4) {
|
if (g.moves > followmsg + 4) {
|
||||||
if (!Deaf && !muteshk(shkp))
|
if (!Deaf && !muteshk(shkp))
|
||||||
verbalize("%s, %s! Didn't you forget to pay?",
|
verbalize("%s, %s! Didn't you forget to pay?",
|
||||||
Hello(shkp), g.plname);
|
Hello(shkp), g.plname);
|
||||||
@@ -3700,7 +3700,7 @@ struct monst *shkp;
|
|||||||
pline("%s holds out %s upturned %s.",
|
pline("%s holds out %s upturned %s.",
|
||||||
Shknam(shkp), noit_mhis(shkp),
|
Shknam(shkp), noit_mhis(shkp),
|
||||||
mbodypart(shkp, HAND));
|
mbodypart(shkp, HAND));
|
||||||
followmsg = moves;
|
followmsg = g.moves;
|
||||||
if (!rn2(9)) {
|
if (!rn2(9)) {
|
||||||
pline("%s doesn't like customers who don't pay.",
|
pline("%s doesn't like customers who don't pay.",
|
||||||
Shknam(shkp));
|
Shknam(shkp));
|
||||||
@@ -3938,7 +3938,7 @@ boolean cant_mollify;
|
|||||||
for (tmp_dam = g.level.damagelist; tmp_dam; tmp_dam = tmp_dam->next) {
|
for (tmp_dam = g.level.damagelist; tmp_dam; tmp_dam = tmp_dam->next) {
|
||||||
char *shp;
|
char *shp;
|
||||||
|
|
||||||
if (tmp_dam->when != monstermoves || !tmp_dam->cost)
|
if (tmp_dam->when != g.monstermoves || !tmp_dam->cost)
|
||||||
continue;
|
continue;
|
||||||
cost_of_damage += tmp_dam->cost;
|
cost_of_damage += tmp_dam->cost;
|
||||||
Strcpy(shops_affected,
|
Strcpy(shops_affected,
|
||||||
|
|||||||
+6
-6
@@ -637,9 +637,9 @@ register struct monst *mtmp;
|
|||||||
} else if (mtmp->mpeaceful) {
|
} else if (mtmp->mpeaceful) {
|
||||||
if (mtmp->mtame
|
if (mtmp->mtame
|
||||||
&& (mtmp->mconf || mtmp->mflee || mtmp->mtrapped
|
&& (mtmp->mconf || mtmp->mflee || mtmp->mtrapped
|
||||||
|| moves > EDOG(mtmp)->hungrytime || mtmp->mtame < 5))
|
|| g.moves > EDOG(mtmp)->hungrytime || mtmp->mtame < 5))
|
||||||
pline_msg = "whines.";
|
pline_msg = "whines.";
|
||||||
else if (mtmp->mtame && EDOG(mtmp)->hungrytime > moves + 1000)
|
else if (mtmp->mtame && EDOG(mtmp)->hungrytime > g.moves + 1000)
|
||||||
pline_msg = "yips.";
|
pline_msg = "yips.";
|
||||||
else {
|
else {
|
||||||
if (mtmp->data
|
if (mtmp->data
|
||||||
@@ -655,9 +655,9 @@ register struct monst *mtmp;
|
|||||||
if (mtmp->mconf || mtmp->mflee || mtmp->mtrapped
|
if (mtmp->mconf || mtmp->mflee || mtmp->mtrapped
|
||||||
|| mtmp->mtame < 5)
|
|| mtmp->mtame < 5)
|
||||||
pline_msg = "yowls.";
|
pline_msg = "yowls.";
|
||||||
else if (moves > EDOG(mtmp)->hungrytime)
|
else if (g.moves > EDOG(mtmp)->hungrytime)
|
||||||
pline_msg = "meows.";
|
pline_msg = "meows.";
|
||||||
else if (EDOG(mtmp)->hungrytime > moves + 1000)
|
else if (EDOG(mtmp)->hungrytime > g.moves + 1000)
|
||||||
pline_msg = "purrs.";
|
pline_msg = "purrs.";
|
||||||
else
|
else
|
||||||
pline_msg = "mews.";
|
pline_msg = "mews.";
|
||||||
@@ -694,7 +694,7 @@ register struct monst *mtmp;
|
|||||||
case MS_NEIGH:
|
case MS_NEIGH:
|
||||||
if (mtmp->mtame < 5)
|
if (mtmp->mtame < 5)
|
||||||
pline_msg = "neighs.";
|
pline_msg = "neighs.";
|
||||||
else if (moves > EDOG(mtmp)->hungrytime)
|
else if (g.moves > EDOG(mtmp)->hungrytime)
|
||||||
pline_msg = "whinnies.";
|
pline_msg = "whinnies.";
|
||||||
else
|
else
|
||||||
pline_msg = "whickers.";
|
pline_msg = "whickers.";
|
||||||
@@ -792,7 +792,7 @@ register struct monst *mtmp;
|
|||||||
} else if (mtmp->mhp < mtmp->mhpmax / 2)
|
} else if (mtmp->mhp < mtmp->mhpmax / 2)
|
||||||
pline_msg = "asks for a potion of healing.";
|
pline_msg = "asks for a potion of healing.";
|
||||||
else if (mtmp->mtame && !mtmp->isminion
|
else if (mtmp->mtame && !mtmp->isminion
|
||||||
&& moves > EDOG(mtmp)->hungrytime)
|
&& g.moves > EDOG(mtmp)->hungrytime)
|
||||||
verbl_msg = "I'm hungry.";
|
verbl_msg = "I'm hungry.";
|
||||||
/* Specific monsters' interests */
|
/* Specific monsters' interests */
|
||||||
else if (is_elf(ptr))
|
else if (is_elf(ptr))
|
||||||
|
|||||||
+1
-1
@@ -241,7 +241,7 @@ struct obj *book2;
|
|||||||
arti_cursed = TRUE;
|
arti_cursed = TRUE;
|
||||||
}
|
}
|
||||||
if (otmp->otyp == BELL_OF_OPENING
|
if (otmp->otyp == BELL_OF_OPENING
|
||||||
&& (moves - otmp->age) < 5L) { /* you rang it recently */
|
&& (g.moves - otmp->age) < 5L) { /* you rang it recently */
|
||||||
if (!otmp->cursed)
|
if (!otmp->cursed)
|
||||||
arti2_primed = TRUE;
|
arti2_primed = TRUE;
|
||||||
else
|
else
|
||||||
|
|||||||
+13
-13
@@ -459,7 +459,7 @@ nh_timeout()
|
|||||||
baseluck -= 1;
|
baseluck -= 1;
|
||||||
|
|
||||||
if (u.uluck != baseluck
|
if (u.uluck != baseluck
|
||||||
&& moves % ((u.uhave.amulet || u.ugangr) ? 300 : 600) == 0) {
|
&& g.moves % ((u.uhave.amulet || u.ugangr) ? 300 : 600) == 0) {
|
||||||
/* Cursed luckstones stop bad luck from timing out; blessed luckstones
|
/* Cursed luckstones stop bad luck from timing out; blessed luckstones
|
||||||
* stop good luck from timing out; normal luckstones stop both;
|
* stop good luck from timing out; normal luckstones stop both;
|
||||||
* neither is stopped if you don't have a luckstone.
|
* neither is stopped if you don't have a luckstone.
|
||||||
@@ -718,7 +718,7 @@ boolean wakeup_msg;
|
|||||||
g.afternmv = Hear_again; /* this won't give any messages */
|
g.afternmv = Hear_again; /* this won't give any messages */
|
||||||
}
|
}
|
||||||
/* early wakeup from combat won't be possible until next monster turn */
|
/* early wakeup from combat won't be possible until next monster turn */
|
||||||
u.usleep = monstermoves;
|
u.usleep = g.monstermoves;
|
||||||
g.nomovemsg = wakeup_msg ? "You wake up." : You_can_move_again;
|
g.nomovemsg = wakeup_msg ? "You wake up." : You_can_move_again;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -787,7 +787,7 @@ long timeout;
|
|||||||
mnum = big_to_little(egg->corpsenm);
|
mnum = big_to_little(egg->corpsenm);
|
||||||
/* The identity of one's father is learned, not innate */
|
/* The identity of one's father is learned, not innate */
|
||||||
yours = (egg->spe || (!flags.female && carried(egg) && !rn2(2)));
|
yours = (egg->spe || (!flags.female && carried(egg) && !rn2(2)));
|
||||||
silent = (timeout != monstermoves); /* hatched while away */
|
silent = (timeout != g.monstermoves); /* hatched while away */
|
||||||
|
|
||||||
/* only can hatch when in INVENT, FLOOR, MINVENT */
|
/* only can hatch when in INVENT, FLOOR, MINVENT */
|
||||||
if (get_obj_location(egg, &x, &y, 0)) {
|
if (get_obj_location(egg, &x, &y, 0)) {
|
||||||
@@ -1107,8 +1107,8 @@ long timeout;
|
|||||||
many = menorah ? obj->spe > 1 : obj->quan > 1L;
|
many = menorah ? obj->spe > 1 : obj->quan > 1L;
|
||||||
|
|
||||||
/* timeout while away */
|
/* timeout while away */
|
||||||
if (timeout != monstermoves) {
|
if (timeout != g.monstermoves) {
|
||||||
long how_long = monstermoves - timeout;
|
long how_long = g.monstermoves - timeout;
|
||||||
|
|
||||||
if (how_long >= obj->age) {
|
if (how_long >= obj->age) {
|
||||||
obj->age = 0;
|
obj->age = 0;
|
||||||
@@ -1537,7 +1537,7 @@ long expire_time;
|
|||||||
del_light_source(LS_OBJECT, obj_to_any(obj));
|
del_light_source(LS_OBJECT, obj_to_any(obj));
|
||||||
|
|
||||||
/* restore unused time */
|
/* restore unused time */
|
||||||
obj->age += expire_time - monstermoves;
|
obj->age += expire_time - g.monstermoves;
|
||||||
|
|
||||||
obj->lamplit = 0;
|
obj->lamplit = 0;
|
||||||
|
|
||||||
@@ -1601,7 +1601,7 @@ do_storms()
|
|||||||
* boolean start_timer(long timeout,short kind,short func_index,
|
* boolean start_timer(long timeout,short kind,short func_index,
|
||||||
* anything *arg)
|
* anything *arg)
|
||||||
* Start a timer of kind 'kind' that will expire at time
|
* Start a timer of kind 'kind' that will expire at time
|
||||||
* monstermoves+'timeout'. Call the function at 'func_index'
|
* g.monstermoves+'timeout'. Call the function at 'func_index'
|
||||||
* in the timeout table using argument 'arg'. Return TRUE if
|
* in the timeout table using argument 'arg'. Return TRUE if
|
||||||
* a timer was started. This places the timer on a list ordered
|
* a timer was started. This places the timer on a list ordered
|
||||||
* "sooner" to "later". If an object, increment the object's
|
* "sooner" to "later". If an object, increment the object's
|
||||||
@@ -1748,7 +1748,7 @@ wiz_timeout_queue()
|
|||||||
if (win == WIN_ERR)
|
if (win == WIN_ERR)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
Sprintf(buf, "Current time = %ld.", monstermoves);
|
Sprintf(buf, "Current time = %ld.", g.monstermoves);
|
||||||
putstr(win, 0, buf);
|
putstr(win, 0, buf);
|
||||||
putstr(win, 0, "");
|
putstr(win, 0, "");
|
||||||
putstr(win, 0, "Active timeout queue:");
|
putstr(win, 0, "Active timeout queue:");
|
||||||
@@ -1832,7 +1832,7 @@ run_timers()
|
|||||||
* any time. The list is ordered, we are done when the first element
|
* any time. The list is ordered, we are done when the first element
|
||||||
* is in the future.
|
* is in the future.
|
||||||
*/
|
*/
|
||||||
while (g.timer_base && g.timer_base->timeout <= monstermoves) {
|
while (g.timer_base && g.timer_base->timeout <= g.monstermoves) {
|
||||||
curr = g.timer_base;
|
curr = g.timer_base;
|
||||||
g.timer_base = curr->next;
|
g.timer_base = curr->next;
|
||||||
|
|
||||||
@@ -1862,7 +1862,7 @@ anything *arg;
|
|||||||
(void) memset((genericptr_t)gnu, 0, sizeof(timer_element));
|
(void) memset((genericptr_t)gnu, 0, sizeof(timer_element));
|
||||||
gnu->next = 0;
|
gnu->next = 0;
|
||||||
gnu->tid = g.timer_id++;
|
gnu->tid = g.timer_id++;
|
||||||
gnu->timeout = monstermoves + when;
|
gnu->timeout = g.monstermoves + when;
|
||||||
gnu->kind = kind;
|
gnu->kind = kind;
|
||||||
gnu->needs_fixup = 0;
|
gnu->needs_fixup = 0;
|
||||||
gnu->func_index = func_index;
|
gnu->func_index = func_index;
|
||||||
@@ -1897,7 +1897,7 @@ anything *arg;
|
|||||||
if (timeout_funcs[doomed->func_index].cleanup)
|
if (timeout_funcs[doomed->func_index].cleanup)
|
||||||
(*timeout_funcs[doomed->func_index].cleanup)(arg, timeout);
|
(*timeout_funcs[doomed->func_index].cleanup)(arg, timeout);
|
||||||
free((genericptr_t) doomed);
|
free((genericptr_t) doomed);
|
||||||
return (timeout - monstermoves);
|
return (timeout - g.monstermoves);
|
||||||
}
|
}
|
||||||
return 0L;
|
return 0L;
|
||||||
}
|
}
|
||||||
@@ -1952,7 +1952,7 @@ struct obj *src, *dest;
|
|||||||
for (curr = g.timer_base; curr; curr = next_timer) {
|
for (curr = g.timer_base; curr; curr = next_timer) {
|
||||||
next_timer = curr->next; /* things may be inserted */
|
next_timer = curr->next; /* things may be inserted */
|
||||||
if (curr->kind == TIMER_OBJECT && curr->arg.a_obj == src) {
|
if (curr->kind == TIMER_OBJECT && curr->arg.a_obj == src) {
|
||||||
(void) start_timer(curr->timeout - monstermoves, TIMER_OBJECT,
|
(void) start_timer(curr->timeout - g.monstermoves, TIMER_OBJECT,
|
||||||
curr->func_index, obj_to_any(dest));
|
curr->func_index, obj_to_any(dest));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2055,7 +2055,7 @@ xchar x, y;
|
|||||||
short func_index;
|
short func_index;
|
||||||
{
|
{
|
||||||
long expires = spot_time_expires(x, y, func_index);
|
long expires = spot_time_expires(x, y, func_index);
|
||||||
return (expires > 0L) ? expires - monstermoves : 0L;
|
return (expires > 0L) ? expires - g.monstermoves : 0L;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Insert timer into the global queue */
|
/* Insert timer into the global queue */
|
||||||
|
|||||||
+1
-1
@@ -366,7 +366,7 @@ int how;
|
|||||||
Fprintf(rfile, "%cwhile=%s", XLOG_SEP,
|
Fprintf(rfile, "%cwhile=%s", XLOG_SEP,
|
||||||
g.multi_reason ? g.multi_reason : "helpless");
|
g.multi_reason ? g.multi_reason : "helpless");
|
||||||
Fprintf(rfile, "%cconduct=0x%lx%cturns=%ld%cachieve=0x%lx", XLOG_SEP,
|
Fprintf(rfile, "%cconduct=0x%lx%cturns=%ld%cachieve=0x%lx", XLOG_SEP,
|
||||||
encodeconduct(), XLOG_SEP, moves, XLOG_SEP, encodeachieve());
|
encodeconduct(), XLOG_SEP, g.moves, XLOG_SEP, encodeachieve());
|
||||||
Fprintf(rfile, "%crealtime=%ld%cstarttime=%ld%cendtime=%ld", XLOG_SEP,
|
Fprintf(rfile, "%crealtime=%ld%cstarttime=%ld%cendtime=%ld", XLOG_SEP,
|
||||||
(long) urealtime.realtime, XLOG_SEP,
|
(long) urealtime.realtime, XLOG_SEP,
|
||||||
(long) ubirthday, XLOG_SEP, (long) urealtime.finish_time);
|
(long) ubirthday, XLOG_SEP, (long) urealtime.finish_time);
|
||||||
|
|||||||
+1
-1
@@ -642,7 +642,7 @@ resurrect()
|
|||||||
if (mtmp->iswiz
|
if (mtmp->iswiz
|
||||||
/* if he has the Amulet, he won't bring it to you */
|
/* if he has the Amulet, he won't bring it to you */
|
||||||
&& !mon_has_amulet(mtmp)
|
&& !mon_has_amulet(mtmp)
|
||||||
&& (elapsed = monstermoves - mtmp->mlstmv) > 0L) {
|
&& (elapsed = g.monstermoves - mtmp->mlstmv) > 0L) {
|
||||||
mon_catchup_elapsed_time(mtmp, elapsed);
|
mon_catchup_elapsed_time(mtmp, elapsed);
|
||||||
if (elapsed >= LARGEST_INT)
|
if (elapsed >= LARGEST_INT)
|
||||||
elapsed = LARGEST_INT - 1;
|
elapsed = LARGEST_INT - 1;
|
||||||
|
|||||||
+2
-2
@@ -219,9 +219,9 @@ struct monst *worm;
|
|||||||
seg->nseg = new_seg; /* attach it to the end of the list */
|
seg->nseg = new_seg; /* attach it to the end of the list */
|
||||||
wheads[wnum] = new_seg; /* move the end pointer */
|
wheads[wnum] = new_seg; /* move the end pointer */
|
||||||
|
|
||||||
if (wgrowtime[wnum] <= moves) {
|
if (wgrowtime[wnum] <= g.moves) {
|
||||||
if (!wgrowtime[wnum])
|
if (!wgrowtime[wnum])
|
||||||
wgrowtime[wnum] = moves + rnd(5);
|
wgrowtime[wnum] = g.moves + rnd(5);
|
||||||
else
|
else
|
||||||
wgrowtime[wnum] += rn1(15, 3);
|
wgrowtime[wnum] += rn1(15, 3);
|
||||||
worm->mhp += 3;
|
worm->mhp += 3;
|
||||||
|
|||||||
+2
-2
@@ -741,7 +741,7 @@ clear_bypasses()
|
|||||||
}
|
}
|
||||||
for (otmp = invent; otmp; otmp = otmp->nobj)
|
for (otmp = invent; otmp; otmp = otmp->nobj)
|
||||||
otmp->bypass = 0;
|
otmp->bypass = 0;
|
||||||
for (otmp = migrating_objs; otmp; otmp = otmp->nobj)
|
for (otmp = g.migrating_objs; otmp; otmp = otmp->nobj)
|
||||||
otmp->bypass = 0;
|
otmp->bypass = 0;
|
||||||
for (mtmp = fmon; mtmp; mtmp = mtmp->nmon) {
|
for (mtmp = fmon; mtmp; mtmp = mtmp->nmon) {
|
||||||
if (DEADMONSTER(mtmp))
|
if (DEADMONSTER(mtmp))
|
||||||
@@ -762,7 +762,7 @@ clear_bypasses()
|
|||||||
/* no MCORPSENM(mtmp)==PM_LONG_WORM check here; long worms can't
|
/* no MCORPSENM(mtmp)==PM_LONG_WORM check here; long worms can't
|
||||||
be just created by polymorph and migrating at the same time */
|
be just created by polymorph and migrating at the same time */
|
||||||
}
|
}
|
||||||
/* billobjs and g.mydogs chains don't matter here */
|
/* g.billobjs and g.mydogs chains don't matter here */
|
||||||
context.bypasses = FALSE;
|
context.bypasses = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2899,7 +2899,7 @@ struct obj *obj; /* wand or spell */
|
|||||||
case WAN_POLYMORPH:
|
case WAN_POLYMORPH:
|
||||||
case SPE_POLYMORPH:
|
case SPE_POLYMORPH:
|
||||||
del_engr(e);
|
del_engr(e);
|
||||||
make_engr_at(x, y, random_engraving(buf), moves, (xchar) 0);
|
make_engr_at(x, y, random_engraving(buf), g.moves, (xchar) 0);
|
||||||
break;
|
break;
|
||||||
case WAN_CANCELLATION:
|
case WAN_CANCELLATION:
|
||||||
case SPE_CANCELLATION:
|
case SPE_CANCELLATION:
|
||||||
|
|||||||
Reference in New Issue
Block a user