split g into multiple structures
The consolidation of global variables from scattered source
files into decl.c and declared in decl.h was begun in 3.7.0.
Their placement in common files was done for centralized
initialization and potential re-initialization during a
"play again" scenario.
It wasn't really necessary for all of them to be housed in a
single huge structure to meet the "play again" requirement,
and the single huge structure has been a little unwieldy when
it comes to maintenance.
Following this commit, instead of one single extremely large structure
named 'g' to house all of the relocated global variables, they
are distributed into several ga through gz.
To make things easy for the developer, each variable is placed
into the struct corresponding to the starting letter of the variable.
That way, no lookup is required in order to know which struct houses
a particular variable, it is a simple match to the starting letter
for all the centralized global variables.
A global variable named 'amulets', would be found in ga.
ga.amulets
^ ^
A global varable named 'move', would be found in gm.
gm.moves
^ ^
A global variable named 'val_for_n_or_more' would be found in gv.
gv.val_for_n_or_more
^ ^
A global variable named 'youmonst' would be found in gy.
gy.youmonst
^ ^
This commit is contained in:
354
src/dokick.c
354
src/dokick.c
@@ -6,10 +6,10 @@
|
||||
|
||||
#define is_bigfoot(x) ((x) == &mons[PM_SASQUATCH])
|
||||
#define martial() \
|
||||
(martial_bonus() || is_bigfoot(g.youmonst.data) \
|
||||
(martial_bonus() || is_bigfoot(gy.youmonst.data) \
|
||||
|| (uarmf && uarmf->otyp == KICKING_BOOTS))
|
||||
|
||||
/* g.kickedobj (decl.c) tracks a kicked object until placed or destroyed */
|
||||
/* gk.kickedobj (decl.c) tracks a kicked object until placed or destroyed */
|
||||
|
||||
static void kickdmg(struct monst *, boolean);
|
||||
static boolean maybe_kick_monster(struct monst *, coordxy, coordxy);
|
||||
@@ -50,7 +50,7 @@ kickdmg(struct monst *mon, boolean clumsy)
|
||||
if (mon->data == &mons[PM_SHADE])
|
||||
dmg = 0;
|
||||
|
||||
specialdmg = special_dmgval(&g.youmonst, mon, W_ARMF, (long *) 0);
|
||||
specialdmg = special_dmgval(&gy.youmonst, mon, W_ARMF, (long *) 0);
|
||||
|
||||
if (mon->data == &mons[PM_SHADE] && !specialdmg) {
|
||||
pline_The("%s.", kick_passes_thru);
|
||||
@@ -123,18 +123,18 @@ static boolean
|
||||
maybe_kick_monster(struct monst *mon, coordxy x, coordxy y)
|
||||
{
|
||||
if (mon) {
|
||||
boolean save_forcefight = g.context.forcefight;
|
||||
boolean save_forcefight = gc.context.forcefight;
|
||||
|
||||
g.bhitpos.x = x;
|
||||
g.bhitpos.y = y;
|
||||
gb.bhitpos.x = x;
|
||||
gb.bhitpos.y = y;
|
||||
if (!mon->mpeaceful || !canspotmon(mon))
|
||||
g.context.forcefight = TRUE; /* attack even if invisible */
|
||||
gc.context.forcefight = TRUE; /* attack even if invisible */
|
||||
/* kicking might be halted by discovery of hidden monster,
|
||||
by player declining to attack peaceful monster,
|
||||
or by passing out due to encumbrance */
|
||||
if (attack_checks(mon, (struct obj *) 0) || overexertion())
|
||||
mon = 0; /* don't kick after all */
|
||||
g.context.forcefight = save_forcefight;
|
||||
gc.context.forcefight = save_forcefight;
|
||||
}
|
||||
return (boolean) (mon != 0);
|
||||
}
|
||||
@@ -177,7 +177,7 @@ kick_monster(struct monst *mon, coordxy x, coordxy y)
|
||||
* normally, getting all your attacks _including_ all your kicks.
|
||||
* If you have >1 kick attack, you get all of them.
|
||||
*/
|
||||
if (Upolyd && attacktype(g.youmonst.data, AT_KICK)) {
|
||||
if (Upolyd && attacktype(gy.youmonst.data, AT_KICK)) {
|
||||
struct attack *uattk;
|
||||
int sum, kickdieroll, armorpenalty, specialdmg,
|
||||
attknum = 0,
|
||||
@@ -188,16 +188,16 @@ kick_monster(struct monst *mon, coordxy x, coordxy y)
|
||||
for (i = 0; i < NATTK; i++) {
|
||||
/* first of two kicks might have provoked counterattack
|
||||
that has incapacitated the hero (ie, floating eye) */
|
||||
if (g.multi < 0)
|
||||
if (gm.multi < 0)
|
||||
break;
|
||||
|
||||
uattk = &g.youmonst.data->mattk[i];
|
||||
uattk = &gy.youmonst.data->mattk[i];
|
||||
/* we only care about kicking attacks here */
|
||||
if (uattk->aatyp != AT_KICK)
|
||||
continue;
|
||||
|
||||
kickdieroll = rnd(20);
|
||||
specialdmg = special_dmgval(&g.youmonst, mon, W_ARMF, (long *) 0);
|
||||
specialdmg = special_dmgval(&gy.youmonst, mon, W_ARMF, (long *) 0);
|
||||
if (mon->data == &mons[PM_SHADE] && !specialdmg) {
|
||||
/* doesn't matter whether it would have hit or missed,
|
||||
and shades have no passive counterattack */
|
||||
@@ -340,7 +340,7 @@ ghitm(register struct monst *mtmp, register struct obj *gold)
|
||||
else
|
||||
verbalize("Thanks, scum!");
|
||||
} else if (mtmp->isgd) {
|
||||
umoney = money_cnt(g.invent);
|
||||
umoney = money_cnt(gi.invent);
|
||||
/* Some of these are iffy, because a hostile guard
|
||||
won't become peaceful and resume leading hero
|
||||
out of the vault. If he did do that, player
|
||||
@@ -366,7 +366,7 @@ ghitm(register struct monst *mtmp, register struct obj *gold)
|
||||
goldreqd = 750L;
|
||||
|
||||
if (goldreqd && rn2(3)) {
|
||||
umoney = money_cnt(g.invent);
|
||||
umoney = money_cnt(gi.invent);
|
||||
goldreqd += (umoney + u.ulevel * rn2(5)) / ACURR(A_CHA);
|
||||
if (value > goldreqd)
|
||||
mtmp->mpeaceful = TRUE;
|
||||
@@ -414,7 +414,7 @@ container_impact_dmg(
|
||||
insider = (*u.ushops && inside_shop(u.ux, u.uy)
|
||||
&& *in_rooms(x, y, SHOPBASE) == *u.ushops);
|
||||
/* if dropped or thrown, shop ownership flags are set on this obj */
|
||||
frominv = (obj != g.kickedobj);
|
||||
frominv = (obj != gk.kickedobj);
|
||||
|
||||
for (otmp = obj->cobj; otmp; otmp = otmp2) {
|
||||
const char *result = (char *) 0;
|
||||
@@ -470,12 +470,12 @@ kick_object(coordxy x, coordxy y, char *kickobjnam)
|
||||
|
||||
*kickobjnam = '\0';
|
||||
/* if a pile, the "top" object gets kicked */
|
||||
g.kickedobj = g.level.objects[x][y];
|
||||
if (g.kickedobj) {
|
||||
/* kick object; if doing is fatal, done() will clean up g.kickedobj */
|
||||
Strcpy(kickobjnam, killer_xname(g.kickedobj)); /* matters iff res==0 */
|
||||
gk.kickedobj = gl.level.objects[x][y];
|
||||
if (gk.kickedobj) {
|
||||
/* kick object; if doing is fatal, done() will clean up gk.kickedobj */
|
||||
Strcpy(kickobjnam, killer_xname(gk.kickedobj)); /* matters iff res==0 */
|
||||
res = really_kick_object(x, y);
|
||||
g.kickedobj = (struct obj *) 0;
|
||||
gk.kickedobj = (struct obj *) 0;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
@@ -490,9 +490,9 @@ really_kick_object(coordxy x, coordxy y)
|
||||
char bhitroom;
|
||||
boolean costly, isgold, slide = FALSE;
|
||||
|
||||
/* g.kickedobj should always be set due to conditions of call */
|
||||
if (!g.kickedobj || g.kickedobj->otyp == BOULDER || g.kickedobj == uball
|
||||
|| g.kickedobj == uchain)
|
||||
/* gk.kickedobj should always be set due to conditions of call */
|
||||
if (!gk.kickedobj || gk.kickedobj->otyp == BOULDER || gk.kickedobj == uball
|
||||
|| gk.kickedobj == uchain)
|
||||
return 0;
|
||||
|
||||
if ((trap = t_at(x, y)) != 0) {
|
||||
@@ -516,35 +516,35 @@ really_kick_object(coordxy x, coordxy y)
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (!uarmf && g.kickedobj->otyp == CORPSE
|
||||
&& touch_petrifies(&mons[g.kickedobj->corpsenm])
|
||||
if (!uarmf && gk.kickedobj->otyp == CORPSE
|
||||
&& touch_petrifies(&mons[gk.kickedobj->corpsenm])
|
||||
&& !Stone_resistance) {
|
||||
You("kick %s with your bare %s.",
|
||||
corpse_xname(g.kickedobj, (const char *) 0, CXN_PFX_THE),
|
||||
corpse_xname(gk.kickedobj, (const char *) 0, CXN_PFX_THE),
|
||||
makeplural(body_part(FOOT)));
|
||||
if (poly_when_stoned(g.youmonst.data) && polymon(PM_STONE_GOLEM)) {
|
||||
if (poly_when_stoned(gy.youmonst.data) && polymon(PM_STONE_GOLEM)) {
|
||||
; /* hero has been transformed but kick continues */
|
||||
} else {
|
||||
/* normalize body shape here; foot, not body_part(FOOT) */
|
||||
Sprintf(g.killer.name, "kicking %s barefoot",
|
||||
killer_xname(g.kickedobj));
|
||||
instapetrify(g.killer.name);
|
||||
Sprintf(gk.killer.name, "kicking %s barefoot",
|
||||
killer_xname(gk.kickedobj));
|
||||
instapetrify(gk.killer.name);
|
||||
}
|
||||
}
|
||||
|
||||
isgold = (g.kickedobj->oclass == COIN_CLASS);
|
||||
isgold = (gk.kickedobj->oclass == COIN_CLASS);
|
||||
{
|
||||
int k_owt = (int) g.kickedobj->owt;
|
||||
int k_owt = (int) gk.kickedobj->owt;
|
||||
|
||||
/* for non-gold stack, 1 item will be split off below (unless an
|
||||
early return occurs, so we aren't moving the split to here);
|
||||
calculate the range for that 1 rather than for the whole stack */
|
||||
if (g.kickedobj->quan > 1L && !isgold) {
|
||||
long save_quan = g.kickedobj->quan;
|
||||
if (gk.kickedobj->quan > 1L && !isgold) {
|
||||
long save_quan = gk.kickedobj->quan;
|
||||
|
||||
g.kickedobj->quan = 1L;
|
||||
k_owt = weight(g.kickedobj);
|
||||
g.kickedobj->quan = save_quan;
|
||||
gk.kickedobj->quan = 1L;
|
||||
k_owt = weight(gk.kickedobj);
|
||||
gk.kickedobj->quan = save_quan;
|
||||
}
|
||||
|
||||
/* range < 2 means the object will not move
|
||||
@@ -564,12 +564,12 @@ really_kick_object(coordxy x, coordxy y)
|
||||
} else {
|
||||
if (is_ice(x, y))
|
||||
range += rnd(3), slide = TRUE;
|
||||
if (g.kickedobj->greased)
|
||||
if (gk.kickedobj->greased)
|
||||
range += rnd(3), slide = TRUE;
|
||||
}
|
||||
|
||||
/* Mjollnir is magically too heavy to kick */
|
||||
if (is_art(g.kickedobj, ART_MJOLLNIR))
|
||||
if (is_art(gk.kickedobj, ART_MJOLLNIR))
|
||||
range = 1;
|
||||
|
||||
/* see if the object has a place to move into */
|
||||
@@ -577,7 +577,7 @@ really_kick_object(coordxy x, coordxy y)
|
||||
|| closed_door(x + u.dx, y + u.dy))
|
||||
range = 1;
|
||||
|
||||
costly = (!(g.kickedobj->no_charge && !Has_contents(g.kickedobj))
|
||||
costly = (!(gk.kickedobj->no_charge && !Has_contents(gk.kickedobj))
|
||||
&& (shkp = shop_keeper(*in_rooms(x, y, SHOPBASE))) != 0
|
||||
&& costly_spot(x, y));
|
||||
|
||||
@@ -588,49 +588,49 @@ really_kick_object(coordxy x, coordxy y)
|
||||
pline("It doesn't come loose.");
|
||||
else
|
||||
pline("%s %sn't come loose.",
|
||||
The(distant_name(g.kickedobj, xname)),
|
||||
otense(g.kickedobj, "do"));
|
||||
The(distant_name(gk.kickedobj, xname)),
|
||||
otense(gk.kickedobj, "do"));
|
||||
return (!rn2(3) || martial());
|
||||
}
|
||||
if (Blind)
|
||||
pline("It comes loose.");
|
||||
else
|
||||
pline("%s %s loose.", The(distant_name(g.kickedobj, xname)),
|
||||
otense(g.kickedobj, "come"));
|
||||
obj_extract_self(g.kickedobj);
|
||||
pline("%s %s loose.", The(distant_name(gk.kickedobj, xname)),
|
||||
otense(gk.kickedobj, "come"));
|
||||
obj_extract_self(gk.kickedobj);
|
||||
newsym(x, y);
|
||||
if (costly && (!costly_spot(u.ux, u.uy)
|
||||
|| !strchr(u.urooms, *in_rooms(x, y, SHOPBASE))))
|
||||
addtobill(g.kickedobj, FALSE, FALSE, FALSE);
|
||||
if (!flooreffects(g.kickedobj, u.ux, u.uy, "fall")) {
|
||||
place_object(g.kickedobj, u.ux, u.uy);
|
||||
stackobj(g.kickedobj);
|
||||
addtobill(gk.kickedobj, FALSE, FALSE, FALSE);
|
||||
if (!flooreffects(gk.kickedobj, u.ux, u.uy, "fall")) {
|
||||
place_object(gk.kickedobj, u.ux, u.uy);
|
||||
stackobj(gk.kickedobj);
|
||||
newsym(u.ux, u.uy);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* a box gets a chance of breaking open here */
|
||||
if (Is_box(g.kickedobj)) {
|
||||
boolean otrp = g.kickedobj->otrapped;
|
||||
if (Is_box(gk.kickedobj)) {
|
||||
boolean otrp = gk.kickedobj->otrapped;
|
||||
|
||||
if (range < 2)
|
||||
pline("THUD!");
|
||||
container_impact_dmg(g.kickedobj, x, y);
|
||||
if (g.kickedobj->olocked) {
|
||||
container_impact_dmg(gk.kickedobj, x, y);
|
||||
if (gk.kickedobj->olocked) {
|
||||
if (!rn2(5) || (martial() && !rn2(2))) {
|
||||
You("break open the lock!");
|
||||
breakchestlock(g.kickedobj, FALSE);
|
||||
breakchestlock(gk.kickedobj, FALSE);
|
||||
if (otrp)
|
||||
(void) chest_trap(g.kickedobj, LEG, FALSE);
|
||||
(void) chest_trap(gk.kickedobj, LEG, FALSE);
|
||||
return 1;
|
||||
}
|
||||
} else {
|
||||
if (!rn2(3) || (martial() && !rn2(2))) {
|
||||
pline_The("lid slams open, then falls shut.");
|
||||
g.kickedobj->lknown = 1;
|
||||
gk.kickedobj->lknown = 1;
|
||||
if (otrp)
|
||||
(void) chest_trap(g.kickedobj, LEG, FALSE);
|
||||
(void) chest_trap(gk.kickedobj, LEG, FALSE);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
@@ -640,7 +640,7 @@ really_kick_object(coordxy x, coordxy y)
|
||||
}
|
||||
|
||||
/* fragile objects should not be kicked */
|
||||
if (hero_breaks(g.kickedobj, g.kickedobj->ox, g.kickedobj->oy, 0))
|
||||
if (hero_breaks(gk.kickedobj, gk.kickedobj->ox, gk.kickedobj->oy, 0))
|
||||
return 1;
|
||||
|
||||
/* too heavy to move. range is calculated as potential distance from
|
||||
@@ -648,14 +648,14 @@ really_kick_object(coordxy x, coordxy y)
|
||||
* from its current position
|
||||
*/
|
||||
if (range < 2) {
|
||||
if (!Is_box(g.kickedobj))
|
||||
if (!Is_box(gk.kickedobj))
|
||||
pline("Thump!");
|
||||
return (!rn2(3) || martial());
|
||||
}
|
||||
|
||||
if (g.kickedobj->quan > 1L) {
|
||||
if (gk.kickedobj->quan > 1L) {
|
||||
if (!isgold) {
|
||||
g.kickedobj = splitobj(g.kickedobj, 1L);
|
||||
gk.kickedobj = splitobj(gk.kickedobj, 1L);
|
||||
} else {
|
||||
if (rn2(20)) {
|
||||
static NEARDATA const char *const flyingcoinmsg[] = {
|
||||
@@ -667,11 +667,11 @@ really_kick_object(coordxy x, coordxy y)
|
||||
pline1("Thwwpingg!");
|
||||
You("%s!", flyingcoinmsg[rn2(SIZE(flyingcoinmsg))]);
|
||||
(void) scatter(x, y, rnd(3), VIS_EFFECTS | MAY_HIT,
|
||||
g.kickedobj);
|
||||
gk.kickedobj);
|
||||
newsym(x, y);
|
||||
return 1;
|
||||
}
|
||||
if (g.kickedobj->quan > 300L) {
|
||||
if (gk.kickedobj->quan > 300L) {
|
||||
pline("Thump!");
|
||||
return (!rn2(3) || martial());
|
||||
}
|
||||
@@ -679,63 +679,63 @@ really_kick_object(coordxy x, coordxy y)
|
||||
}
|
||||
|
||||
if (slide && !Blind)
|
||||
pline("Whee! %s %s across the %s.", Doname2(g.kickedobj),
|
||||
otense(g.kickedobj, "slide"), surface(x, y));
|
||||
pline("Whee! %s %s across the %s.", Doname2(gk.kickedobj),
|
||||
otense(gk.kickedobj, "slide"), surface(x, y));
|
||||
|
||||
if (costly && !isgold)
|
||||
addtobill(g.kickedobj, FALSE, FALSE, TRUE);
|
||||
obj_extract_self(g.kickedobj);
|
||||
(void) snuff_candle(g.kickedobj);
|
||||
addtobill(gk.kickedobj, FALSE, FALSE, TRUE);
|
||||
obj_extract_self(gk.kickedobj);
|
||||
(void) snuff_candle(gk.kickedobj);
|
||||
newsym(x, y);
|
||||
mon = bhit(u.dx, u.dy, range, KICKED_WEAPON,
|
||||
(int (*) (struct monst *, struct obj *)) 0,
|
||||
(int (*) (struct obj *, struct obj *)) 0, &g.kickedobj);
|
||||
if (!g.kickedobj)
|
||||
(int (*) (struct obj *, struct obj *)) 0, &gk.kickedobj);
|
||||
if (!gk.kickedobj)
|
||||
return 1; /* object broken */
|
||||
|
||||
if (mon) {
|
||||
if (mon->isshk && g.kickedobj->where == OBJ_MINVENT
|
||||
&& g.kickedobj->ocarry == mon)
|
||||
if (mon->isshk && gk.kickedobj->where == OBJ_MINVENT
|
||||
&& gk.kickedobj->ocarry == mon)
|
||||
return 1; /* alert shk caught it */
|
||||
g.notonhead = (mon->mx != g.bhitpos.x || mon->my != g.bhitpos.y);
|
||||
if (isgold ? ghitm(mon, g.kickedobj) /* caught? */
|
||||
: thitmonst(mon, g.kickedobj)) /* hit && used up? */
|
||||
gn.notonhead = (mon->mx != gb.bhitpos.x || mon->my != gb.bhitpos.y);
|
||||
if (isgold ? ghitm(mon, gk.kickedobj) /* caught? */
|
||||
: thitmonst(mon, gk.kickedobj)) /* hit && used up? */
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* the object might have fallen down a hole;
|
||||
ship_object() will have taken care of shop billing */
|
||||
if (g.kickedobj->where == OBJ_MIGRATING)
|
||||
if (gk.kickedobj->where == OBJ_MIGRATING)
|
||||
return 1;
|
||||
|
||||
bhitroom = *in_rooms(g.bhitpos.x, g.bhitpos.y, SHOPBASE);
|
||||
if (costly && (!costly_spot(g.bhitpos.x, g.bhitpos.y)
|
||||
bhitroom = *in_rooms(gb.bhitpos.x, gb.bhitpos.y, SHOPBASE);
|
||||
if (costly && (!costly_spot(gb.bhitpos.x, gb.bhitpos.y)
|
||||
|| *in_rooms(x, y, SHOPBASE) != bhitroom)) {
|
||||
if (isgold)
|
||||
costly_gold(x, y, g.kickedobj->quan, FALSE);
|
||||
costly_gold(x, y, gk.kickedobj->quan, FALSE);
|
||||
else
|
||||
(void) stolen_value(g.kickedobj, x, y, (boolean) shkp->mpeaceful,
|
||||
(void) stolen_value(gk.kickedobj, x, y, (boolean) shkp->mpeaceful,
|
||||
FALSE);
|
||||
costly = FALSE; /* already billed */
|
||||
}
|
||||
|
||||
if (flooreffects(g.kickedobj, g.bhitpos.x, g.bhitpos.y, "fall"))
|
||||
if (flooreffects(gk.kickedobj, gb.bhitpos.x, gb.bhitpos.y, "fall"))
|
||||
return 1;
|
||||
if (costly) {
|
||||
long gt = 0L;
|
||||
long gtg = 0L;
|
||||
|
||||
/* costly + landed outside shop handled above; must be inside shop */
|
||||
if (g.kickedobj->unpaid)
|
||||
subfrombill(g.kickedobj, shkp);
|
||||
if (gk.kickedobj->unpaid)
|
||||
subfrombill(gk.kickedobj, shkp);
|
||||
|
||||
/* if billed for contained gold during kick, get a refund now */
|
||||
if (Has_contents(g.kickedobj)
|
||||
&& (gt = contained_gold(g.kickedobj, TRUE)) > 0L)
|
||||
donate_gold(gt, shkp, FALSE);
|
||||
if (Has_contents(gk.kickedobj)
|
||||
&& (gtg = contained_gold(gk.kickedobj, TRUE)) > 0L)
|
||||
donate_gold(gtg, shkp, FALSE);
|
||||
}
|
||||
place_object(g.kickedobj, g.bhitpos.x, g.bhitpos.y);
|
||||
stackobj(g.kickedobj);
|
||||
newsym(g.kickedobj->ox, g.kickedobj->oy);
|
||||
place_object(gk.kickedobj, gb.bhitpos.x, gb.bhitpos.y);
|
||||
stackobj(gk.kickedobj);
|
||||
newsym(gk.kickedobj->ox, gk.kickedobj->oy);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -747,33 +747,33 @@ kickstr(char *buf, const char *kickobjnam)
|
||||
|
||||
if (*kickobjnam)
|
||||
what = kickobjnam;
|
||||
else if (g.maploc == &g.nowhere)
|
||||
else if (gm.maploc == &gn.nowhere)
|
||||
what = "nothing";
|
||||
else if (IS_DOOR(g.maploc->typ))
|
||||
else if (IS_DOOR(gm.maploc->typ))
|
||||
what = "a door";
|
||||
else if (IS_TREE(g.maploc->typ))
|
||||
else if (IS_TREE(gm.maploc->typ))
|
||||
what = "a tree";
|
||||
else if (IS_STWALL(g.maploc->typ))
|
||||
else if (IS_STWALL(gm.maploc->typ))
|
||||
what = "a wall";
|
||||
else if (IS_ROCK(g.maploc->typ))
|
||||
else if (IS_ROCK(gm.maploc->typ))
|
||||
what = "a rock";
|
||||
else if (IS_THRONE(g.maploc->typ))
|
||||
else if (IS_THRONE(gm.maploc->typ))
|
||||
what = "a throne";
|
||||
else if (IS_FOUNTAIN(g.maploc->typ))
|
||||
else if (IS_FOUNTAIN(gm.maploc->typ))
|
||||
what = "a fountain";
|
||||
else if (IS_GRAVE(g.maploc->typ))
|
||||
else if (IS_GRAVE(gm.maploc->typ))
|
||||
what = "a headstone";
|
||||
else if (IS_SINK(g.maploc->typ))
|
||||
else if (IS_SINK(gm.maploc->typ))
|
||||
what = "a sink";
|
||||
else if (IS_ALTAR(g.maploc->typ))
|
||||
else if (IS_ALTAR(gm.maploc->typ))
|
||||
what = "an altar";
|
||||
else if (IS_DRAWBRIDGE(g.maploc->typ))
|
||||
else if (IS_DRAWBRIDGE(gm.maploc->typ))
|
||||
what = "a drawbridge";
|
||||
else if (g.maploc->typ == STAIRS)
|
||||
else if (gm.maploc->typ == STAIRS)
|
||||
what = "the stairs";
|
||||
else if (g.maploc->typ == LADDER)
|
||||
else if (gm.maploc->typ == LADDER)
|
||||
what = "a ladder";
|
||||
else if (g.maploc->typ == IRONBARS)
|
||||
else if (gm.maploc->typ == IRONBARS)
|
||||
what = "an iron bar";
|
||||
else
|
||||
what = "something weird";
|
||||
@@ -843,7 +843,7 @@ kick_ouch(coordxy x, coordxy y, const char *kickobjnam)
|
||||
pline_The("drawbridge is unaffected.");
|
||||
/* update maploc to refer to the drawbridge */
|
||||
(void) find_drawbridge(&x, &y);
|
||||
g.maploc = &levl[x][y];
|
||||
gm.maploc = &levl[x][y];
|
||||
}
|
||||
}
|
||||
if (!rn2(3))
|
||||
@@ -865,10 +865,10 @@ dokick(void)
|
||||
boolean no_kick = FALSE;
|
||||
char buf[BUFSZ];
|
||||
|
||||
if (nolimbs(g.youmonst.data) || slithy(g.youmonst.data)) {
|
||||
if (nolimbs(gy.youmonst.data) || slithy(gy.youmonst.data)) {
|
||||
You("have no legs to kick with.");
|
||||
no_kick = TRUE;
|
||||
} else if (verysmall(g.youmonst.data)) {
|
||||
} else if (verysmall(gy.youmonst.data)) {
|
||||
You("are too small to do any kicking.");
|
||||
no_kick = TRUE;
|
||||
} else if (u.usteed) {
|
||||
@@ -885,7 +885,7 @@ dokick(void)
|
||||
} else if (near_capacity() > SLT_ENCUMBER) {
|
||||
Your("load is too heavy to balance yourself for a kick.");
|
||||
no_kick = TRUE;
|
||||
} else if (g.youmonst.data->mlet == S_LIZARD) {
|
||||
} else if (gy.youmonst.data->mlet == S_LIZARD) {
|
||||
Your("legs cannot kick effectively.");
|
||||
no_kick = TRUE;
|
||||
} else if (u.uinwater && !rn2(2)) {
|
||||
@@ -973,23 +973,23 @@ dokick(void)
|
||||
mtmp = isok(x, y) ? m_at(x, y) : 0;
|
||||
/* might not kick monster if it is hidden and becomes revealed,
|
||||
if it is peaceful and player declines to attack, or if the
|
||||
hero passes out due to encumbrance with low hp; g.context.move
|
||||
hero passes out due to encumbrance with low hp; gc.context.move
|
||||
will be 1 unless player declines to kick peaceful monster */
|
||||
if (mtmp) {
|
||||
oldglyph = glyph_at(x, y);
|
||||
if (!maybe_kick_monster(mtmp, x, y))
|
||||
return (g.context.move ? ECMD_TIME : ECMD_OK);
|
||||
return (gc.context.move ? ECMD_TIME : ECMD_OK);
|
||||
}
|
||||
|
||||
wake_nearby();
|
||||
u_wipe_engr(2);
|
||||
|
||||
if (!isok(x, y)) {
|
||||
g.maploc = &g.nowhere;
|
||||
gm.maploc = &gn.nowhere;
|
||||
kick_ouch(x, y, "");
|
||||
return ECMD_TIME;
|
||||
}
|
||||
g.maploc = &levl[x][y];
|
||||
gm.maploc = &levl[x][y];
|
||||
|
||||
/*
|
||||
* The next five tests should stay in their present order:
|
||||
@@ -1026,11 +1026,11 @@ dokick(void)
|
||||
map_invisible(x, y);
|
||||
}
|
||||
/* recoil if floating */
|
||||
if ((Is_airlevel(&u.uz) || Levitation) && g.context.move) {
|
||||
if ((Is_airlevel(&u.uz) || Levitation) && gc.context.move) {
|
||||
int range;
|
||||
|
||||
range =
|
||||
((int) g.youmonst.data->cwt + (weight_cap() + inv_weight()));
|
||||
((int) gy.youmonst.data->cwt + (weight_cap() + inv_weight()));
|
||||
if (range < 1)
|
||||
range = 1; /* divide by zero avoidance */
|
||||
range = (3 * (int) mdat->cwt) / range;
|
||||
@@ -1061,26 +1061,26 @@ dokick(void)
|
||||
return ECMD_TIME;
|
||||
}
|
||||
|
||||
if (!IS_DOOR(g.maploc->typ)) {
|
||||
if (g.maploc->typ == SDOOR) {
|
||||
if (!IS_DOOR(gm.maploc->typ)) {
|
||||
if (gm.maploc->typ == SDOOR) {
|
||||
if (!Levitation && rn2(30) < avrg_attrib) {
|
||||
cvt_sdoor_to_door(g.maploc); /* ->typ = DOOR */
|
||||
cvt_sdoor_to_door(gm.maploc); /* ->typ = DOOR */
|
||||
pline("Crash! %s a secret door!",
|
||||
/* don't "kick open" when it's locked
|
||||
unless it also happens to be trapped */
|
||||
(g.maploc->doormask & (D_LOCKED | D_TRAPPED)) == D_LOCKED
|
||||
(gm.maploc->doormask & (D_LOCKED | D_TRAPPED)) == D_LOCKED
|
||||
? "Your kick uncovers"
|
||||
: "You kick open");
|
||||
exercise(A_DEX, TRUE);
|
||||
if (g.maploc->doormask & D_TRAPPED) {
|
||||
g.maploc->doormask = D_NODOOR;
|
||||
if (gm.maploc->doormask & D_TRAPPED) {
|
||||
gm.maploc->doormask = D_NODOOR;
|
||||
b_trapped("door", FOOT);
|
||||
} else if (g.maploc->doormask != D_NODOOR
|
||||
&& !(g.maploc->doormask & D_LOCKED))
|
||||
g.maploc->doormask = D_ISOPEN;
|
||||
} else if (gm.maploc->doormask != D_NODOOR
|
||||
&& !(gm.maploc->doormask & D_LOCKED))
|
||||
gm.maploc->doormask = D_ISOPEN;
|
||||
feel_newsym(x, y); /* we know it's gone */
|
||||
if (g.maploc->doormask == D_ISOPEN
|
||||
|| g.maploc->doormask == D_NODOOR)
|
||||
if (gm.maploc->doormask == D_ISOPEN
|
||||
|| gm.maploc->doormask == D_NODOOR)
|
||||
unblock_point(x, y); /* vision */
|
||||
return ECMD_TIME;
|
||||
} else {
|
||||
@@ -1088,11 +1088,11 @@ dokick(void)
|
||||
return ECMD_TIME;
|
||||
}
|
||||
}
|
||||
if (g.maploc->typ == SCORR) {
|
||||
if (gm.maploc->typ == SCORR) {
|
||||
if (!Levitation && rn2(30) < avrg_attrib) {
|
||||
pline("Crash! You kick open a secret passage!");
|
||||
exercise(A_DEX, TRUE);
|
||||
g.maploc->typ = CORR;
|
||||
gm.maploc->typ = CORR;
|
||||
feel_newsym(x, y); /* we know it's gone */
|
||||
unblock_point(x, y); /* vision */
|
||||
return ECMD_TIME;
|
||||
@@ -1101,15 +1101,15 @@ dokick(void)
|
||||
return ECMD_TIME;
|
||||
}
|
||||
}
|
||||
if (IS_THRONE(g.maploc->typ)) {
|
||||
if (IS_THRONE(gm.maploc->typ)) {
|
||||
register int i;
|
||||
if (Levitation) {
|
||||
kick_dumb(x, y);
|
||||
return ECMD_TIME;
|
||||
}
|
||||
if ((Luck < 0 || g.maploc->looted) && !rn2(3)) {
|
||||
g.maploc->looted = 0; /* don't leave loose ends.. */
|
||||
g.maploc->typ = ROOM;
|
||||
if ((Luck < 0 || gm.maploc->looted) && !rn2(3)) {
|
||||
gm.maploc->looted = 0; /* don't leave loose ends.. */
|
||||
gm.maploc->typ = ROOM;
|
||||
(void) mkgold((long) rnd(200), x, y);
|
||||
if (Blind)
|
||||
pline("CRASH! You destroy it.");
|
||||
@@ -1119,7 +1119,7 @@ dokick(void)
|
||||
}
|
||||
exercise(A_DEX, TRUE);
|
||||
return ECMD_TIME;
|
||||
} else if (Luck > 0 && !rn2(3) && !g.maploc->looted) {
|
||||
} else if (Luck > 0 && !rn2(3) && !gm.maploc->looted) {
|
||||
(void) mkgold((long) rn1(201, 300), x, y);
|
||||
i = Luck + 1;
|
||||
if (i > 6)
|
||||
@@ -1135,7 +1135,7 @@ dokick(void)
|
||||
newsym(x, y);
|
||||
}
|
||||
/* prevent endless milking */
|
||||
g.maploc->looted = T_LOOTED;
|
||||
gm.maploc->looted = T_LOOTED;
|
||||
return ECMD_TIME;
|
||||
} else if (!rn2(4)) {
|
||||
if (dunlev(&u.uz) < dunlevs_in_dungeon(&u.uz)) {
|
||||
@@ -1149,7 +1149,7 @@ dokick(void)
|
||||
kick_ouch(x, y, "");
|
||||
return ECMD_TIME;
|
||||
}
|
||||
if (IS_ALTAR(g.maploc->typ)) {
|
||||
if (IS_ALTAR(gm.maploc->typ)) {
|
||||
if (Levitation) {
|
||||
kick_dumb(x, y);
|
||||
return ECMD_TIME;
|
||||
@@ -1163,7 +1163,7 @@ dokick(void)
|
||||
exercise(A_DEX, TRUE);
|
||||
return ECMD_TIME;
|
||||
}
|
||||
if (IS_FOUNTAIN(g.maploc->typ)) {
|
||||
if (IS_FOUNTAIN(gm.maploc->typ)) {
|
||||
if (Levitation) {
|
||||
kick_dumb(x, y);
|
||||
return ECMD_TIME;
|
||||
@@ -1182,7 +1182,7 @@ dokick(void)
|
||||
exercise(A_DEX, TRUE);
|
||||
return ECMD_TIME;
|
||||
}
|
||||
if (IS_GRAVE(g.maploc->typ)) {
|
||||
if (IS_GRAVE(gm.maploc->typ)) {
|
||||
if (Levitation) {
|
||||
kick_dumb(x, y);
|
||||
return ECMD_TIME;
|
||||
@@ -1196,8 +1196,8 @@ dokick(void)
|
||||
|| ((u.ualign.type == A_LAWFUL) && (u.ualign.record > -10))) {
|
||||
adjalign(-sgn(u.ualign.type));
|
||||
}
|
||||
g.maploc->typ = ROOM;
|
||||
g.maploc->doormask = 0;
|
||||
gm.maploc->typ = ROOM;
|
||||
gm.maploc->doormask = 0;
|
||||
(void) mksobj_at(ROCK, x, y, TRUE, FALSE);
|
||||
del_engr_at(x, y);
|
||||
if (Blind)
|
||||
@@ -1208,21 +1208,21 @@ dokick(void)
|
||||
}
|
||||
return ECMD_TIME;
|
||||
}
|
||||
if (g.maploc->typ == IRONBARS) {
|
||||
if (gm.maploc->typ == IRONBARS) {
|
||||
kick_ouch(x, y, "");
|
||||
return ECMD_TIME;
|
||||
}
|
||||
if (IS_TREE(g.maploc->typ)) {
|
||||
if (IS_TREE(gm.maploc->typ)) {
|
||||
struct obj *treefruit;
|
||||
|
||||
/* nothing, fruit or trouble? 75:23.5:1.5% */
|
||||
if (rn2(3)) {
|
||||
if (!rn2(6) && !(g.mvitals[PM_KILLER_BEE].mvflags & G_GONE))
|
||||
if (!rn2(6) && !(gm.mvitals[PM_KILLER_BEE].mvflags & G_GONE))
|
||||
You_hear("a low buzzing."); /* a warning */
|
||||
kick_ouch(x, y, "");
|
||||
return ECMD_TIME;
|
||||
}
|
||||
if (rn2(15) && !(g.maploc->looted & TREE_LOOTED)
|
||||
if (rn2(15) && !(gm.maploc->looted & TREE_LOOTED)
|
||||
&& (treefruit = rnd_treefruit_at(x, y))) {
|
||||
long nfruit = 8L - rnl(7), nfall;
|
||||
short frtype = treefruit->otyp;
|
||||
@@ -1246,9 +1246,9 @@ dokick(void)
|
||||
exercise(A_DEX, TRUE);
|
||||
exercise(A_WIS, TRUE); /* discovered a new food source! */
|
||||
newsym(x, y);
|
||||
g.maploc->looted |= TREE_LOOTED;
|
||||
gm.maploc->looted |= TREE_LOOTED;
|
||||
return ECMD_TIME;
|
||||
} else if (!(g.maploc->looted & TREE_SWARM)) {
|
||||
} else if (!(gm.maploc->looted & TREE_SWARM)) {
|
||||
int cnt = rnl(4) + 2;
|
||||
int made = 0;
|
||||
coord mm;
|
||||
@@ -1265,13 +1265,13 @@ dokick(void)
|
||||
pline("You've attracted the tree's former occupants!");
|
||||
else
|
||||
You("smell stale honey.");
|
||||
g.maploc->looted |= TREE_SWARM;
|
||||
gm.maploc->looted |= TREE_SWARM;
|
||||
return ECMD_TIME;
|
||||
}
|
||||
kick_ouch(x, y, "");
|
||||
return ECMD_TIME;
|
||||
}
|
||||
if (IS_SINK(g.maploc->typ)) {
|
||||
if (IS_SINK(gm.maploc->typ)) {
|
||||
int gend = poly_gender();
|
||||
|
||||
if (Levitation) {
|
||||
@@ -1285,8 +1285,8 @@ dokick(void)
|
||||
pline("Klunk!");
|
||||
exercise(A_DEX, TRUE);
|
||||
return ECMD_TIME;
|
||||
} else if (!(g.maploc->looted & S_LPUDDING) && !rn2(3)
|
||||
&& !(g.mvitals[PM_BLACK_PUDDING].mvflags & G_GONE)) {
|
||||
} else if (!(gm.maploc->looted & S_LPUDDING) && !rn2(3)
|
||||
&& !(gm.mvitals[PM_BLACK_PUDDING].mvflags & G_GONE)) {
|
||||
if (Blind)
|
||||
You_hear("a gushing sound.");
|
||||
else
|
||||
@@ -1295,17 +1295,17 @@ dokick(void)
|
||||
(void) makemon(&mons[PM_BLACK_PUDDING], x, y, MM_NOMSG);
|
||||
exercise(A_DEX, TRUE);
|
||||
newsym(x, y);
|
||||
g.maploc->looted |= S_LPUDDING;
|
||||
gm.maploc->looted |= S_LPUDDING;
|
||||
return ECMD_TIME;
|
||||
} else if (!(g.maploc->looted & S_LDWASHER) && !rn2(3)
|
||||
&& !(g.mvitals[PM_AMOROUS_DEMON].mvflags & G_GONE)) {
|
||||
} else if (!(gm.maploc->looted & S_LDWASHER) && !rn2(3)
|
||||
&& !(gm.mvitals[PM_AMOROUS_DEMON].mvflags & G_GONE)) {
|
||||
/* can't resist... */
|
||||
pline("%s returns!", (Blind ? Something : "The dish washer"));
|
||||
if (makemon(&mons[PM_AMOROUS_DEMON], x, y,
|
||||
MM_NOMSG | ((gend == 1 || (gend == 2 && rn2(2)))
|
||||
? MM_MALE : MM_FEMALE)))
|
||||
newsym(x, y);
|
||||
g.maploc->looted |= S_LDWASHER;
|
||||
gm.maploc->looted |= S_LDWASHER;
|
||||
exercise(A_DEX, TRUE);
|
||||
return ECMD_TIME;
|
||||
} else if (!rn2(3)) {
|
||||
@@ -1319,23 +1319,23 @@ dokick(void)
|
||||
: !Deaf
|
||||
? "You hear a sloshing sound" /* Deaf-aware */
|
||||
: "Something splashes you in the", buf);
|
||||
if (!(g.maploc->looted & S_LRING)) { /* once per sink */
|
||||
if (!(gm.maploc->looted & S_LRING)) { /* once per sink */
|
||||
if (!Blind)
|
||||
You_see("a ring shining in its midst.");
|
||||
(void) mkobj_at(RING_CLASS, x, y, TRUE);
|
||||
newsym(x, y);
|
||||
exercise(A_DEX, TRUE);
|
||||
exercise(A_WIS, TRUE); /* a discovery! */
|
||||
g.maploc->looted |= S_LRING;
|
||||
gm.maploc->looted |= S_LRING;
|
||||
}
|
||||
return ECMD_TIME;
|
||||
}
|
||||
kick_ouch(x, y, "");
|
||||
return ECMD_TIME;
|
||||
}
|
||||
if (g.maploc->typ == STAIRS || g.maploc->typ == LADDER
|
||||
|| IS_STWALL(g.maploc->typ)) {
|
||||
if (!IS_STWALL(g.maploc->typ) && g.maploc->ladder == LA_DOWN) {
|
||||
if (gm.maploc->typ == STAIRS || gm.maploc->typ == LADDER
|
||||
|| IS_STWALL(gm.maploc->typ)) {
|
||||
if (!IS_STWALL(gm.maploc->typ) && gm.maploc->ladder == LA_DOWN) {
|
||||
kick_dumb(x, y);
|
||||
return ECMD_TIME;
|
||||
}
|
||||
@@ -1346,8 +1346,8 @@ dokick(void)
|
||||
return ECMD_TIME;
|
||||
}
|
||||
|
||||
if (g.maploc->doormask == D_ISOPEN || g.maploc->doormask == D_BROKEN
|
||||
|| g.maploc->doormask == D_NODOOR) {
|
||||
if (gm.maploc->doormask == D_ISOPEN || gm.maploc->doormask == D_BROKEN
|
||||
|| gm.maploc->doormask == D_NODOOR) {
|
||||
kick_dumb(x, y);
|
||||
return ECMD_TIME; /* uses a turn */
|
||||
}
|
||||
@@ -1363,20 +1363,20 @@ dokick(void)
|
||||
if (rnl(35) < avrg_attrib + (!martial() ? 0 : ACURR(A_DEX))) {
|
||||
boolean shopdoor = *in_rooms(x, y, SHOPBASE) ? TRUE : FALSE;
|
||||
/* break the door */
|
||||
if (g.maploc->doormask & D_TRAPPED) {
|
||||
if (gm.maploc->doormask & D_TRAPPED) {
|
||||
if (Verbose(0, dokick))
|
||||
You("kick the door.");
|
||||
exercise(A_STR, FALSE);
|
||||
g.maploc->doormask = D_NODOOR;
|
||||
gm.maploc->doormask = D_NODOOR;
|
||||
b_trapped("door", FOOT);
|
||||
} else if (ACURR(A_STR) > 18 && !rn2(5) && !shopdoor) {
|
||||
pline("As you kick the door, it shatters to pieces!");
|
||||
exercise(A_STR, TRUE);
|
||||
g.maploc->doormask = D_NODOOR;
|
||||
gm.maploc->doormask = D_NODOOR;
|
||||
} else {
|
||||
pline("As you kick the door, it crashes open!");
|
||||
exercise(A_STR, TRUE);
|
||||
g.maploc->doormask = D_BROKEN;
|
||||
gm.maploc->doormask = D_BROKEN;
|
||||
}
|
||||
feel_newsym(x, y); /* we know we broke it */
|
||||
unblock_point(x, y); /* vision */
|
||||
@@ -1486,7 +1486,7 @@ impact_drop(
|
||||
|
||||
isrock = (missile && missile->otyp == ROCK);
|
||||
oct = dct = 0L;
|
||||
for (obj = g.level.objects[x][y]; obj; obj = obj2) {
|
||||
for (obj = gl.level.objects[x][y]; obj; obj = obj2) {
|
||||
obj2 = obj->nexthere;
|
||||
if (obj == missile)
|
||||
continue;
|
||||
@@ -1530,11 +1530,11 @@ impact_drop(
|
||||
dct == oct ? "the " : dct == 1L ? "an" : "", what);
|
||||
else if (oct == dct)
|
||||
pline("%s adjacent %s %s.", dct == 1L ? "The" : "All the", what,
|
||||
g.gate_str);
|
||||
gg.gate_str);
|
||||
else
|
||||
pline("%s adjacent %s %s.",
|
||||
dct == 1L ? "One of the" : "Some of the",
|
||||
dct == 1L ? "objects falls" : what, g.gate_str);
|
||||
dct == 1L ? "objects falls" : what, gg.gate_str);
|
||||
}
|
||||
|
||||
if (costly && shkp && price) {
|
||||
@@ -1542,11 +1542,11 @@ impact_drop(
|
||||
You("removed %ld %s worth of goods!", price, currency(price));
|
||||
if (cansee(shkp->mx, shkp->my)) {
|
||||
if (ESHK(shkp)->customer[0] == 0)
|
||||
(void) strncpy(ESHK(shkp)->customer, g.plname, PL_NSIZ);
|
||||
(void) strncpy(ESHK(shkp)->customer, gp.plname, PL_NSIZ);
|
||||
if (angry)
|
||||
pline("%s is infuriated!", Shknam(shkp));
|
||||
else
|
||||
pline("\"%s, you are a thief!\"", g.plname);
|
||||
pline("\"%s, you are a thief!\"", gp.plname);
|
||||
} else
|
||||
You_hear("a scream, \"Thief!\"");
|
||||
hot_pursuit(shkp);
|
||||
@@ -1593,7 +1593,7 @@ ship_object(struct obj *otmp, coordxy x, coordxy y, boolean shop_floor_obj)
|
||||
unpaid = is_unpaid(otmp);
|
||||
|
||||
if (OBJ_AT(x, y)) {
|
||||
for (obj = g.level.objects[x][y]; obj; obj = obj->nexthere) {
|
||||
for (obj = gl.level.objects[x][y]; obj; obj = obj->nexthere) {
|
||||
if (obj == uchain)
|
||||
chainthere = TRUE;
|
||||
else if (obj != otmp)
|
||||
@@ -1701,7 +1701,7 @@ obj_delivery(boolean near_hero)
|
||||
d_level fromdlev;
|
||||
boolean isladder;
|
||||
|
||||
for (otmp = g.migrating_objs; otmp; otmp = otmp2) {
|
||||
for (otmp = gm.migrating_objs; otmp; otmp = otmp2) {
|
||||
otmp2 = otmp->nobj;
|
||||
if (otmp->ox != u.uz.dnum || otmp->oy != u.uz.dlevel)
|
||||
continue;
|
||||
@@ -1792,7 +1792,7 @@ deliver_obj_to_mon(struct monst *mtmp, int cnt, unsigned long deliverflags)
|
||||
| M2_GNOME | M2_ORC | M2_DEMON | M2_GIANT)
|
||||
|
||||
cnt = 0;
|
||||
for (otmp = g.migrating_objs; otmp; otmp = otmp2) {
|
||||
for (otmp = gm.migrating_objs; otmp; otmp = otmp2) {
|
||||
otmp2 = otmp->nobj;
|
||||
where = (int) (otmp->owornmask & 0x7fffL); /* destination code */
|
||||
if ((where & MIGR_TO_SPECIES) == 0)
|
||||
@@ -1856,10 +1856,10 @@ otransit_msg(register struct obj *otmp, boolean nodrop, boolean chainthere, long
|
||||
Sprintf(eos(xbuf), ".");
|
||||
else
|
||||
Sprintf(eos(xbuf), " and %s %s.",
|
||||
otense(otmp, "fall"), g.gate_str);
|
||||
otense(otmp, "fall"), gg.gate_str);
|
||||
pline("%s%s", obuf, xbuf);
|
||||
} else if (!nodrop)
|
||||
pline("%s %s %s.", obuf, otense(otmp, "fall"), g.gate_str);
|
||||
pline("%s %s %s.", obuf, otense(otmp, "fall"), gg.gate_str);
|
||||
}
|
||||
|
||||
/* migration destination for objects which fall down to next level */
|
||||
@@ -1869,23 +1869,23 @@ down_gate(coordxy x, coordxy y)
|
||||
struct trap *ttmp;
|
||||
stairway *stway = stairway_at(x, y);
|
||||
|
||||
g.gate_str = 0;
|
||||
gg.gate_str = 0;
|
||||
/* this matches the player restriction in goto_level() */
|
||||
if (on_level(&u.uz, &qstart_level) && !ok_to_quest()) {
|
||||
return MIGR_NOWHERE;
|
||||
}
|
||||
if (stway && !stway->up && !stway->isladder) {
|
||||
g.gate_str = "down the stairs";
|
||||
gg.gate_str = "down the stairs";
|
||||
return (stway->tolev.dnum == u.uz.dnum) ? MIGR_STAIRS_UP
|
||||
: MIGR_SSTAIRS;
|
||||
}
|
||||
if (stway && !stway->up && stway->isladder) {
|
||||
g.gate_str = "down the ladder";
|
||||
gg.gate_str = "down the ladder";
|
||||
return MIGR_LADDER_UP;
|
||||
}
|
||||
/* hole will always be flagged as seen; trap drop might or might not */
|
||||
if ((ttmp = t_at(x, y)) != 0 && ttmp->tseen && is_hole(ttmp->ttyp)) {
|
||||
g.gate_str = (ttmp->ttyp == TRAPDOOR) ? "through the trap door"
|
||||
gg.gate_str = (ttmp->ttyp == TRAPDOOR) ? "through the trap door"
|
||||
: "through the hole";
|
||||
return MIGR_RANDOM;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user