comment/formatting tidbits

Some miscellaneous stuff I don't want to discard of lose track of.
No change it actual code.
This commit is contained in:
PatR
2019-05-05 15:20:09 -07:00
parent e2eeca2ed0
commit 6127c10848
4 changed files with 41 additions and 23 deletions
+15 -5
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 botl.c $NHDT-Date: 1554857126 2019/04/10 00:45:26 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.144 $ */ /* NetHack 3.6 botl.c $NHDT-Date: 1557094795 2019/05/05 22:19:55 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.145 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Michael Allison, 2006. */ /*-Copyright (c) Michael Allison, 2006. */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -811,6 +811,15 @@ boolean *valsetlist;
} }
#endif #endif
/*
* TODO?
* It's possible for HPmax (or ENEmax) to change while current
* HP (or energy) stays the same. [Perhaps current and maximum
* both go up, then before the next status update takes place
* current goes down again.] If that happens with HPmax, we
* ought to force the windowport to treat current HP as changed
* if hitpointbar is On, in order for that to be re-rendered.
*/
if (update_all || chg || reset) { if (update_all || chg || reset) {
idxmax = curr->idxmax; idxmax = curr->idxmax;
pc = (idxmax >= 0) ? percentage(curr, &blstats[idx][idxmax]) : 0; pc = (idxmax >= 0) ? percentage(curr, &blstats[idx][idxmax]) : 0;
@@ -892,8 +901,8 @@ boolean *valsetlist;
if (context.botlx && (windowprocs.wincap2 & WC2_RESET_STATUS) != 0L) if (context.botlx && (windowprocs.wincap2 & WC2_RESET_STATUS) != 0L)
status_update(BL_RESET, (genericptr_t) 0, 0, 0, status_update(BL_RESET, (genericptr_t) 0, 0, 0,
NO_COLOR, (unsigned long *) 0); NO_COLOR, (unsigned long *) 0);
else if ((updated || context.botlx) && else if ((updated || context.botlx)
(windowprocs.wincap2 & WC2_FLUSH_STATUS) != 0L) && (windowprocs.wincap2 & WC2_FLUSH_STATUS) != 0L)
status_update(BL_FLUSH, (genericptr_t) 0, 0, 0, status_update(BL_FLUSH, (genericptr_t) 0, 0, 0,
NO_COLOR, (unsigned long *) 0); NO_COLOR, (unsigned long *) 0);
@@ -1376,7 +1385,8 @@ const char *name;
STATIC_OVL boolean STATIC_OVL boolean
hilite_reset_needed(bl_p, augmented_time) hilite_reset_needed(bl_p, augmented_time)
struct istat_s *bl_p; struct istat_s *bl_p;
long augmented_time; long augmented_time; /* no longer augmented; it once encoded fractional
* amounts for multiple moves within same turn */
{ {
/* /*
* This 'multi' handling may need some tuning... * This 'multi' handling may need some tuning...
@@ -1434,7 +1444,7 @@ status_eval_next_unhilite()
} }
} }
/* called by options handling when 'statushilites' boolean is toggled */ /* called by options handling when 'statushilites' value is changed */
void void
reset_status_hilites() reset_status_hilites()
{ {
+11 -13
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 dogmove.c $NHDT-Date: 1551493951 2019/03/02 02:32:31 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.72 $ */ /* NetHack 3.6 dogmove.c $NHDT-Date: 1557094801 2019/05/05 22:20:01 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.74 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2012. */ /*-Copyright (c) Robert Patrick Rankin, 2012. */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -379,8 +379,9 @@ 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 || DEADMONSTER(mtmp)) { } else if (monstermoves > edog->hungrytime + 750
dog_died: || DEADMONSTER(mtmp)) {
dog_died:
if (mtmp->mleashed && mtmp != u.usteed) if (mtmp->mleashed && mtmp != u.usteed)
Your("leash goes slack."); Your("leash goes slack.");
else if (cansee(mtmp->mx, mtmp->my)) else if (cansee(mtmp->mx, mtmp->my))
@@ -615,7 +616,6 @@ int after, udist, whappr;
return appr; return appr;
} }
STATIC_OVL struct monst * STATIC_OVL struct monst *
find_targ(mtmp, dx, dy, maxdist) find_targ(mtmp, dx, dy, maxdist)
register struct monst *mtmp; register struct monst *mtmp;
@@ -644,14 +644,13 @@ int maxdist;
if (!m_cansee(mtmp, curx, cury)) if (!m_cansee(mtmp, curx, cury))
break; break;
targ = m_at(curx, cury);
if (curx == mtmp->mux && cury == mtmp->muy) if (curx == mtmp->mux && cury == mtmp->muy)
return &youmonst; return &youmonst;
if (targ) { if ((targ = m_at(curx, cury)) != 0) {
/* Is the monster visible to the pet? */ /* Is the monster visible to the pet? */
if ((!targ->minvis || perceives(mtmp->data)) && !targ->mundetected) if ((!targ->minvis || perceives(mtmp->data))
&& !targ->mundetected)
break; break;
/* If the pet can't see it, it assumes it aint there */ /* If the pet can't see it, it assumes it aint there */
targ = 0; targ = 0;
@@ -807,7 +806,6 @@ struct monst *mtmp, *mtarg;
return score; return score;
} }
STATIC_OVL struct monst * STATIC_OVL struct monst *
best_target(mtmp) best_target(mtmp)
struct monst *mtmp; /* Pet */ struct monst *mtmp; /* Pet */
@@ -859,7 +857,6 @@ struct monst *mtmp; /* Pet */
return best_targ; return best_targ;
} }
/* return 0 (no move), 1 (move) or 2 (dead) */ /* return 0 (no move), 1 (move) or 2 (dead) */
int int
dog_move(mtmp, after) dog_move(mtmp, after)
@@ -1124,7 +1121,7 @@ int after; /* this is extra fast monster movement */
chcnt = 0; chcnt = 0;
chi = i; chi = i;
} }
nxti: nxti:
; ;
} }
@@ -1139,6 +1136,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 = (monstermoves > (dog->hungrytime + 300));
} }
@@ -1184,7 +1182,7 @@ int after; /* this is extra fast monster movement */
} }
} }
newdogpos: newdogpos:
if (nix != omx || niy != omy) { if (nix != omx || niy != omy) {
boolean wasseen; boolean wasseen;
@@ -1256,7 +1254,7 @@ newdogpos:
} }
cc.x = mtmp->mx; cc.x = mtmp->mx;
cc.y = mtmp->my; cc.y = mtmp->my;
dognext: dognext:
if (!m_in_out_region(mtmp, nix, niy)) if (!m_in_out_region(mtmp, nix, niy))
return 1; return 1;
remove_monster(mtmp->mx, mtmp->my); remove_monster(mtmp->mx, mtmp->my);
+10 -1
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 end.c $NHDT-Date: 1554591224 2019/04/06 22:53:44 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.168 $ */ /* NetHack 3.6 end.c $NHDT-Date: 1557094801 2019/05/05 22:20:01 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.170 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2012. */ /*-Copyright (c) Robert Patrick Rankin, 2012. */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -500,6 +500,15 @@ int how;
} }
Strcpy(killer.name, buf); Strcpy(killer.name, buf);
/*
* Chicken and egg issue:
* Ordinarily Unchanging ought to override something like this,
* but the transformation occurs at death. With the current code,
* the effectiveness of Unchanging stops first, but a case could
* be made that it should last long enough to prevent undead
* transformation. (Turning to slime isn't an issue here because
* Unchanging prevents that from happening.)
*/
if (mptr->mlet == S_WRAITH) if (mptr->mlet == S_WRAITH)
u.ugrave_arise = PM_WRAITH; u.ugrave_arise = PM_WRAITH;
else if (mptr->mlet == S_MUMMY && urace.mummynum != NON_PM) else if (mptr->mlet == S_MUMMY && urace.mummynum != NON_PM)
+5 -4
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 monmove.c $NHDT-Date: 1545596010 2018/12/23 20:13:30 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.111 $ */ /* NetHack 3.6 monmove.c $NHDT-Date: 1557094802 2019/05/05 22:20:02 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.113 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Michael Allison, 2006. */ /*-Copyright (c) Michael Allison, 2006. */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -541,7 +541,7 @@ register struct monst *mtmp;
} }
} }
} }
toofar: toofar:
/* If monster is nearby you, and has to wield a weapon, do so. This /* If monster is nearby you, and has to wield a weapon, do so. This
* costs the monster a move, of course. * costs the monster a move, of course.
@@ -982,7 +982,7 @@ register int after;
if ((likegold || likegems || likeobjs || likemagic || likerock if ((likegold || likegems || likeobjs || likemagic || likerock
|| conceals) && (!*in_rooms(omx, omy, SHOPBASE) || conceals) && (!*in_rooms(omx, omy, SHOPBASE)
|| (!rn2(25) && !mtmp->isshk))) { || (!rn2(25) && !mtmp->isshk))) {
look_for_obj: look_for_obj:
oomx = min(COLNO - 1, omx + minr); oomx = min(COLNO - 1, omx + minr);
oomy = min(ROWNO - 1, omy + minr); oomy = min(ROWNO - 1, omy + minr);
lmx = max(1, omx - minr); lmx = max(1, omx - minr);
@@ -1572,6 +1572,7 @@ register struct monst *mtmp;
if (!gotu) { if (!gotu) {
register int try_cnt = 0; register int try_cnt = 0;
do { do {
if (++try_cnt > 200) if (++try_cnt > 200)
goto found_you; /* punt */ goto found_you; /* punt */
@@ -1585,7 +1586,7 @@ register struct monst *mtmp;
&& (can_ooze(mtmp) || can_fog(mtmp))))) && (can_ooze(mtmp) || can_fog(mtmp)))))
|| !couldsee(mx, my)); || !couldsee(mx, my));
} else { } else {
found_you: found_you:
mx = u.ux; mx = u.ux;
my = u.uy; my = u.uy;
} }