status updating: a*.c
I went through the places that set context.botl/botlx in src/a*.c to see whether I could find any unnecessary status updates. I didn't find anything interesting, mostly some minor sequencing issues plus a couple of redundant sets (call foo() which includes setting botl, then explicitly set botl after it returns). If you issue pline first and then set context.botl, bottom lines won't be updated until the next message or next pass through moveloop. If you order those the other way around, status will be updated as the message describing the reason for the update is being delivered.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.6 artifact.c $NHDT-Date: 1545597414 2018/12/23 20:36:54 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.128 $ */
|
||||
/* NetHack 3.6 artifact.c $NHDT-Date: 1553363416 2019/03/23 17:50:16 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.129 $ */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/*-Copyright (c) Robert Patrick Rankin, 2013. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
@@ -1039,20 +1039,20 @@ char *hittee; /* target's name: "you" or mon_nam(mdef) */
|
||||
if (youmonst.data != old_uasmon)
|
||||
*dmgptr = 0; /* rehumanized, so no more damage */
|
||||
if (u.uenmax > 0) {
|
||||
You("lose magical energy!");
|
||||
u.uenmax--;
|
||||
if (u.uen > 0)
|
||||
u.uen--;
|
||||
context.botl = 1;
|
||||
context.botl = TRUE;
|
||||
You("lose magical energy!");
|
||||
}
|
||||
} else {
|
||||
if (mdef->data == &mons[PM_CLAY_GOLEM])
|
||||
mdef->mhp = 1; /* cancelled clay golems will die */
|
||||
if (youattack && attacktype(mdef->data, AT_MAGC)) {
|
||||
You("absorb magical energy!");
|
||||
u.uenmax++;
|
||||
u.uen++;
|
||||
context.botl = 1;
|
||||
context.botl = TRUE;
|
||||
You("absorb magical energy!");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1474,7 +1474,7 @@ struct obj *obj;
|
||||
make_slimed(0L, (char *) 0);
|
||||
if (Blinded > creamed)
|
||||
make_blinded(creamed, FALSE);
|
||||
context.botl = 1;
|
||||
context.botl = TRUE;
|
||||
break;
|
||||
}
|
||||
case ENERGY_BOOST: {
|
||||
@@ -1485,9 +1485,9 @@ struct obj *obj;
|
||||
else if (epboost < 12)
|
||||
epboost = u.uenmax - u.uen;
|
||||
if (epboost) {
|
||||
You_feel("re-energized.");
|
||||
u.uen += epboost;
|
||||
context.botl = 1;
|
||||
context.botl = TRUE;
|
||||
You_feel("re-energized.");
|
||||
} else
|
||||
goto nothing_special;
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user