Fix wizmakemap to consider monster birth counts and uniques

Also add a new wizmode command #wizborn to show those.
This commit is contained in:
Pasi Kallinen
2020-03-07 21:35:26 +02:00
parent 2a37fe5a3b
commit f5d9324f28
7 changed files with 52 additions and 5 deletions
+1
View File
@@ -19,6 +19,7 @@ Debug-Mode Quick Reference:
#timeout == look at timeout queue and hero's timed intrinsics #timeout == look at timeout queue and hero's timed intrinsics
#vanquished == disclose counts of dead monsters sorted in various ways #vanquished == disclose counts of dead monsters sorted in various ways
#vision == show vision array #vision == show vision array
#wizborn == show monster birth/death/geno/extinct stats
#wizintrinsic == set selected intrinsic timeouts #wizintrinsic == set selected intrinsic timeouts
#wizmakemap == recreate the current dungeon level #wizmakemap == recreate the current dungeon level
#wizrumorcheck == validate first and last rumor for true and false set #wizrumorcheck == validate first and last rumor for true and false set
+3
View File
@@ -1512,6 +1512,9 @@ Default key is \(oqw\(cq.
Wipe off your face. Wipe off your face.
Autocompletes. Autocompletes.
Default key is \(oqM-w\(cq. Default key is \(oqM-w\(cq.
.lp "#wizborn "
Show monster birth, death, genocide, and extinct statistics.
Debug mode only.
.lp "#wizbury " .lp "#wizbury "
Bury objects under and around you. Bury objects under and around you.
Autocompletes. Autocompletes.
+4
View File
@@ -1600,6 +1600,10 @@ Wield a weapon. Default key is `{\tt w}'.
\item[\tb{\#wipe}] \item[\tb{\#wipe}]
Wipe off your face. Autocompletes. Default key is `{\tt M-w}'. Wipe off your face. Autocompletes. Default key is `{\tt M-w}'.
%.lp %.lp
\item[\tb{\#wizborn}]
Show monster birth, death, genocide, and extinct statistics.
Debug mode only.
%.lp
\item[\tb{\#wizbury}] \item[\tb{\#wizbury}]
Bury objects under and around you. Bury objects under and around you.
Autocompletes. Autocompletes.
+3
View File
@@ -64,6 +64,8 @@ if eel bite attack caused hero to move (killed + rehumanized + crawled out
of water), its grab attack could succeed even if no longer adjacent of water), its grab attack could succeed even if no longer adjacent
specifying a count when picking [part of] a stack of scrolls of scare monster specifying a count when picking [part of] a stack of scrolls of scare monster
ignored that count and the whole stack was affected ignored that count and the whole stack was affected
wizmakemap didn't account for unique monsters and didn't correct monster
birth counts
Fixes to 3.7.0-x Problems that Were Exposed Via git Repository Fixes to 3.7.0-x Problems that Were Exposed Via git Repository
@@ -175,6 +177,7 @@ demon lords and princes suppress teleporting in Gehennom
for !fixinv option where inventory letters normally don't stick, try to put for !fixinv option where inventory letters normally don't stick, try to put
a throw-and-return weapon back into the same inventory slot it gets a throw-and-return weapon back into the same inventory slot it gets
thrown from; only works if it does return and is successfully caught thrown from; only works if it does return and is successfully caught
wizard mode #wizborn command
Platform- and/or Interface-Specific New Features Platform- and/or Interface-Specific New Features
+1
View File
@@ -1002,6 +1002,7 @@ E void FDECL(record_achievement, (XCHAR_P));
E boolean FDECL(remove_achievement, (XCHAR_P)); E boolean FDECL(remove_achievement, (XCHAR_P));
E int NDECL(count_achievements); E int NDECL(count_achievements);
E int NDECL(dovanquished); E int NDECL(dovanquished);
E int NDECL(doborn);
E void FDECL(list_vanquished, (CHAR_P, BOOLEAN_P)); E void FDECL(list_vanquished, (CHAR_P, BOOLEAN_P));
E int NDECL(num_genocides); E int NDECL(num_genocides);
E void FDECL(list_genocided, (CHAR_P, BOOLEAN_P)); E void FDECL(list_genocided, (CHAR_P, BOOLEAN_P));
+7 -5
View File
@@ -780,10 +780,15 @@ boolean pre, wiztower;
if (pre) { if (pre) {
rm_mapseen(ledger_no(&u.uz)); rm_mapseen(ledger_no(&u.uz));
for (mtmp = fmon; mtmp; mtmp = mtmp->nmon) { for (mtmp = fmon; mtmp; mtmp = mtmp->nmon) {
int ndx = monsndx(mtmp->data);
if (mtmp->isgd) { /* vault is going away; get rid of guard */ if (mtmp->isgd) { /* vault is going away; get rid of guard */
mtmp->isgd = 0; mtmp->isgd = 0;
mongone(mtmp); mongone(mtmp);
} }
if (mtmp->data->geno & G_UNIQ)
g.mvitals[ndx].mvflags &= ~(G_EXTINCT);
if (g.mvitals[ndx].born)
g.mvitals[ndx].born--;
if (DEADMONSTER(mtmp)) if (DEADMONSTER(mtmp))
continue; continue;
if (mtmp->isshk) if (mtmp->isshk)
@@ -802,11 +807,6 @@ boolean pre, wiztower;
g.context.achieveo.soko_prize_oid = 0; g.context.achieveo.soko_prize_oid = 0;
} }
} }
/* TODO?
* Reduce 'born' tally for each monster about to be discarded
* by savelev(), otherwise replacing heavily populated levels
* tends to make their inhabitants become extinct.
*/
} }
if (Punished) { if (Punished) {
ballrelease(FALSE); ballrelease(FALSE);
@@ -1890,6 +1890,8 @@ struct ext_func_tab extcmdlist[] = {
dowhatis, IFBURIED | GENERALCMD }, dowhatis, IFBURIED | GENERALCMD },
{ 'w', "wield", "wield (put in use) a weapon", dowield }, { 'w', "wield", "wield (put in use) a weapon", dowield },
{ M('w'), "wipe", "wipe off your face", dowipe, AUTOCOMPLETE }, { M('w'), "wipe", "wipe off your face", dowipe, AUTOCOMPLETE },
{ '\0', "wizborn", "show stats of monsters created",
doborn, IFBURIED | WIZMODECMD },
#ifdef DEBUG #ifdef DEBUG
{ '\0', "wizbury", "bury objs under and around you", { '\0', "wizbury", "bury objs under and around you",
wiz_debug_cmd_bury, IFBURIED | AUTOCOMPLETE | WIZMODECMD }, wiz_debug_cmd_bury, IFBURIED | AUTOCOMPLETE | WIZMODECMD },
+33
View File
@@ -2062,6 +2062,39 @@ dovanquished()
return 0; return 0;
} }
/* #wizborn extended command */
int
doborn()
{
static const char fmt[] = "%4i %4i %c %-30s";
int i;
winid datawin = create_nhwindow(NHW_TEXT);
char buf[BUFSZ];
int nborn = 0, ndied = 0;
putstr(datawin, 0, "died born");
for (i = LOW_PM; i < NUMMONS; i++)
if (g.mvitals[i].born || g.mvitals[i].died
|| (g.mvitals[i].mvflags & G_GONE)) {
Sprintf(buf, fmt,
g.mvitals[i].died, g.mvitals[i].born,
((g.mvitals[i].mvflags & G_GONE) == G_EXTINCT) ? 'E' :
((g.mvitals[i].mvflags & G_GONE) == G_GENOD) ? 'G' : ' ',
mons[i].mname);
putstr(datawin, 0, buf);
nborn += g.mvitals[i].born;
ndied += g.mvitals[i].died;
}
putstr(datawin, 0, "");
Sprintf(buf, fmt, ndied, nborn, ' ', "");
display_nhwindow(datawin, FALSE);
destroy_nhwindow(datawin);
return 0;
}
/* high priests aren't unique but are flagged as such to simplify something */ /* high priests aren't unique but are flagged as such to simplify something */
#define UniqCritterIndx(mndx) ((mons[mndx].geno & G_UNIQ) \ #define UniqCritterIndx(mndx) ((mons[mndx].geno & G_UNIQ) \
&& mndx != PM_HIGH_PRIEST) && mndx != PM_HIGH_PRIEST)