Remove g.monstermoves
It's redundant with g.moves, so there is no more need for it. Way, way back, it looks like g.moves and g.monstermoves can and did desync, where g.moves would track the amount of moves the player had gotten (and would therefore increase faster if the player were hasted) and g.monstermoves would track the amount of monster move cycles, aka turns. But this has not been the case for a long time, and they both increment together in the same location in allmain.c. There are no longer any cases where they will not be the same value. This is a save-breaking change because it changes struct instance_globals, but I have not updated the editlevel in this commit.
This commit is contained in:
@@ -209,8 +209,8 @@ dog_eat(struct monst *mtmp,
|
||||
char objnambuf[BUFSZ];
|
||||
|
||||
objnambuf[0] = '\0';
|
||||
if (edog->hungrytime < g.monstermoves)
|
||||
edog->hungrytime = g.monstermoves;
|
||||
if (edog->hungrytime < g.moves)
|
||||
edog->hungrytime = g.moves;
|
||||
nutrit = dog_nutrition(mtmp, obj);
|
||||
|
||||
deadmimic = (obj->otyp == CORPSE && (obj->corpsenm == PM_SMALL_MIMIC
|
||||
@@ -291,7 +291,7 @@ dog_eat(struct monst *mtmp,
|
||||
#ifdef LINT
|
||||
edog->apport = 0;
|
||||
#else
|
||||
edog->apport += (int) (200L / ((long) edog->dropdist + g.monstermoves
|
||||
edog->apport += (int) (200L / ((long) edog->dropdist + g.moves
|
||||
- edog->droptime));
|
||||
#endif
|
||||
if (mtmp->data == &mons[PM_RUST_MONSTER] && obj->oerodeproof) {
|
||||
@@ -357,9 +357,9 @@ dog_eat(struct monst *mtmp,
|
||||
static boolean
|
||||
dog_hunger(struct monst *mtmp, struct edog *edog)
|
||||
{
|
||||
if (g.monstermoves > edog->hungrytime + 500) {
|
||||
if (g.moves > edog->hungrytime + 500) {
|
||||
if (!carnivorous(mtmp->data) && !herbivorous(mtmp->data)) {
|
||||
edog->hungrytime = g.monstermoves + 500;
|
||||
edog->hungrytime = g.moves + 500;
|
||||
/* but not too high; it might polymorph */
|
||||
} else if (!edog->mhpmax_penalty) {
|
||||
/* starving pets are limited in healing */
|
||||
@@ -378,7 +378,7 @@ dog_hunger(struct monst *mtmp, struct edog *edog)
|
||||
else
|
||||
You_feel("worried about %s.", y_monnam(mtmp));
|
||||
stop_occupation();
|
||||
} else if (g.monstermoves > edog->hungrytime + 750
|
||||
} else if (g.moves > edog->hungrytime + 750
|
||||
|| DEADMONSTER(mtmp)) {
|
||||
dog_died:
|
||||
if (mtmp->mleashed && mtmp != u.usteed)
|
||||
@@ -421,7 +421,7 @@ dog_invent(struct monst *mtmp, struct edog *edog, int udist)
|
||||
if (edog->apport > 1)
|
||||
edog->apport--;
|
||||
edog->dropdist = udist; /* hpscdi!jon */
|
||||
edog->droptime = g.monstermoves;
|
||||
edog->droptime = g.moves;
|
||||
}
|
||||
} else {
|
||||
if ((obj = g.level.objects[omx][omy]) != 0
|
||||
@@ -549,7 +549,7 @@ dog_goal(register struct monst *mtmp, struct edog *edog,
|
||||
|
||||
/* follow player if appropriate */
|
||||
if (g.gtyp == UNDEF || (g.gtyp != DOGFOOD && g.gtyp != APPORT
|
||||
&& g.monstermoves < edog->hungrytime)) {
|
||||
&& g.moves < edog->hungrytime)) {
|
||||
g.gx = u.ux;
|
||||
g.gy = u.uy;
|
||||
if (after && udist <= 4 && g.gx == u.ux && g.gy == u.uy)
|
||||
@@ -909,7 +909,7 @@ dog_move(register struct monst *mtmp,
|
||||
else if (j == 1)
|
||||
goto newdogpos; /* eating something */
|
||||
|
||||
whappr = (g.monstermoves - edog->whistletime < 5);
|
||||
whappr = (g.moves - edog->whistletime < 5);
|
||||
} else
|
||||
whappr = 0;
|
||||
|
||||
@@ -1009,7 +1009,7 @@ dog_move(register struct monst *mtmp,
|
||||
return 2;
|
||||
|
||||
if ((mstatus & MM_HIT) && !(mstatus & MM_DEF_DIED) && rn2(4)
|
||||
&& mtmp2->mlstmv != g.monstermoves
|
||||
&& mtmp2->mlstmv != g.moves
|
||||
&& !onscary(mtmp->mx, mtmp->my, mtmp2)
|
||||
/* monnear check needed: long worms hit on tail */
|
||||
&& monnear(mtmp2, mtmp->mx, mtmp->my)) {
|
||||
@@ -1062,7 +1062,7 @@ dog_move(register struct monst *mtmp,
|
||||
cursemsg[i] = TRUE;
|
||||
} else if ((otyp = dogfood(mtmp, obj)) < MANFOOD
|
||||
&& (otyp < ACCFOOD
|
||||
|| edog->hungrytime <= g.monstermoves)) {
|
||||
|| edog->hungrytime <= g.moves)) {
|
||||
/* Note: our dog likes the food so much that he
|
||||
* might eat it even when it conceals a cursed object */
|
||||
nix = nx;
|
||||
@@ -1118,7 +1118,7 @@ dog_move(register struct monst *mtmp,
|
||||
if (!mtmp->isminion) {
|
||||
struct edog *dog = EDOG(mtmp);
|
||||
|
||||
hungry = (g.monstermoves > (dog->hungrytime + 300));
|
||||
hungry = (g.moves > (dog->hungrytime + 300));
|
||||
}
|
||||
|
||||
/* Identify the best target in a straight line from the pet;
|
||||
|
||||
Reference in New Issue
Block a user