diff --git a/include/mextra.h b/include/mextra.h index 7f0d00f46..a665b953b 100644 --- a/include/mextra.h +++ b/include/mextra.h @@ -182,9 +182,16 @@ struct edog { Bitfield(killed_by_u, 1); /* you attempted to kill him */ }; +/* for saving the hero's rank in bones monster */ +struct mon_former_rank { + int lev; + short mnum; + boolean female; +}; + struct former_incarnation { - unsigned parentmid; /* make clobber-detection possible */ - char rank[25]; /* for bones' ghost rank in their former life */ + unsigned parentmid; /* make clobber-detection possible */ + struct mon_former_rank rank; /* for bones' ghost rank in former life */ }; /*** diff --git a/include/mondata.h b/include/mondata.h index 5296361fa..80a177f76 100644 --- a/include/mondata.h +++ b/include/mondata.h @@ -260,14 +260,6 @@ || objects[(obj)->otyp].oc_material == VEGGY \ || ((obj)->otyp == CORPSE && (obj)->corpsenm == PM_LICHEN)))) -/* is_bones_monster() is currently only used by hardfought livelog, - * but is included as part of savefile field compatibility adjustments. - */ -#define is_bones_monster(ptr) \ - ((ptr) == &mons[PM_GHOST] || (ptr) == &mons[PM_GHOUL] \ - || (ptr) == &mons[PM_VAMPIRE] || (ptr) == &mons[PM_WRAITH] \ - || (ptr) == &mons[PM_GREEN_SLIME] || (ptr)->mlet == S_MUMMY) - #ifdef PMNAME_MACROS #define pmname(ptr,g) ((((g) == MALE || (g) == FEMALE) && (ptr)->pmnames[g]) \ ? (ptr)->pmnames[g] : (ptr)->pmnames[NEUTRAL]) diff --git a/include/patchlevel.h b/include/patchlevel.h index 9149b3b5f..1c688630e 100644 --- a/include/patchlevel.h +++ b/include/patchlevel.h @@ -17,7 +17,7 @@ * Incrementing EDITLEVEL can be used to force invalidation of old bones * and save files. */ -#define EDITLEVEL 117 +#define EDITLEVEL 118 /* * Development status possibilities. diff --git a/src/bones.c b/src/bones.c index 34adac268..7b43db3e2 100644 --- a/src/bones.c +++ b/src/bones.c @@ -509,9 +509,9 @@ savebones(int how, time_t when, struct obj *corpse) if (!has_former(mtmp)) newformer(mtmp); if (has_former(mtmp)) { - Snprintf(FORMER(mtmp)->rank, - sizeof FORMER(mtmp)->rank, - "%s", rank()); + FORMER(mtmp)->rank.lev = mtmp->m_lev; + FORMER(mtmp)->rank.mnum = Role_switch; + FORMER(mtmp)->rank.female = flags.female; } } for (mtmp = fmon; mtmp; mtmp = mtmp->nmon) { diff --git a/src/do_name.c b/src/do_name.c index d5b7d7852..f690a2984 100644 --- a/src/do_name.c +++ b/src/do_name.c @@ -954,6 +954,10 @@ x_monnam( } else if (do_name && has_mgivenname(mtmp)) { char *name = MGIVENNAME(mtmp); +#if 0 + /* hardfought */ + if (has_former(mtmp) && FORMER(mtmp)->rank.mnum != NON_PM) { +#endif if (mdat == &mons[PM_GHOST]) { Sprintf(eos(buf), "%s ghost", s_suffix(name)); name_at_start = TRUE; @@ -976,6 +980,9 @@ x_monnam( Strcat(buf, name); name_at_start = TRUE; } +#if 0 /* hardfought */ + } +#endif } else if (is_mplayer(mdat) && !In_endgame(&u.uz)) { char pbuf[BUFSZ]; diff --git a/src/end.c b/src/end.c index b4370f049..4c916024a 100644 --- a/src/end.c +++ b/src/end.c @@ -204,7 +204,12 @@ done_in_by(struct monst *mtmp, int how) svk.killer.format = KILLED_BY; } /* _the_ ghost of Dudley */ +#if 0 + /* hardfought */ + if (has_former(mtmp) && FORMER(mtmp)->rank.mnum != NON_PM) { +#else if (mptr == &mons[PM_GHOST] && has_mgivenname(mtmp)) { +#endif Strcat(buf, "the "); svk.killer.format = KILLED_BY; } @@ -247,6 +252,10 @@ done_in_by(struct monst *mtmp, int how) : "%s imitating %s", realnm, shape); mptr = mtmp->data; /* reset for mimicker case */ +#if 0 /* hardfought */ + } else if (has_former(mtmp) && FORMER(mtmp)->rank.mnum != NON_PM) + Strcpy(buf, m_monnam(mtmp)); +#endif } else if (mptr == &mons[PM_GHOST]) { Strcat(buf, "ghost"); if (has_mgivenname(mtmp)) diff --git a/src/mon.c b/src/mon.c index 819cb7bdc..9a11354f5 100644 --- a/src/mon.c +++ b/src/mon.c @@ -3644,15 +3644,13 @@ xkilled( #if 0 /* HARDFOUGHT-only at present */ #ifdef LIVELOG - if (is_bones_monster(mtmp->data) - && has_former(mtmp) && *FORMER(mtmp)->rank - && strlen(FORMER(mtmp)->rank) > 0) { - if (mtmp->data == &mons[PM_GHOST]) - livelog_printf(LL_UMONST, "destroyed %s, the former %s", - livelog_mon_nam(mtmp), FORMER(mtmp)->rank); - else - livelog_printf(LL_UMONST, "destroyed %s, and former %s", - livelog_mon_nam(mtmp), FORMER(mtmp)->rank); + if (has_former(mtmp) && FORMER(mtmp)->rank.mnum != NON_PM) { + livelog_printf(LL_UMONST, "destroyed %s, %s former %s", + livelog_mon_nam(mtmp), + (mtmp->data == &mons[PM_GHOST]) ? "the" : "and", + rank_of(FORMER(mtmp)->rank.lev, + FORMER(mtmp)->rank.mnum, + FORMER(mtmp)->rank.female)); } #endif /* LIVELOG */ #endif