]> granicus.if.org Git - nethack/commitdiff
conflicting delayed killers
authorcohrs <cohrs>
Mon, 29 Sep 2003 19:24:20 +0000 (19:24 +0000)
committercohrs <cohrs>
Mon, 29 Sep 2003 19:24:20 +0000 (19:24 +0000)
Introduce a new set of functions to manage delayed killers in the trunk, used
in addressing the various reports of delayed killer confusion.  Since existing
delayed killers are related to player properties, the delayed killers are
keyed by uprop indexes.  I did this to avoid adding yet another set of
similar identifiers.
- the new delayed_killer() is used for stoning, sliming, sickness, and
delayed self-genocide while polymorphed.  Some other timed events don't
use it (and didn't use the old delayed_killer variable) because they
use a fixed message when the timeout occurs.
- A new data structure, struct kinfo, is used to track both delayed and
immediate killers.  This encapsulates all the info involved with
identifying a killer.  The structure contains a buffer, which subsumes the
old killer_buf and several other buffers that didn't/couldn't use killer_buf.
- the killer list is saved and restored as part of the game state.
- the special case of usick_cause was removed and a delayed killer list
entry is now used in its place
- common code dealing with (un)sliming is moved to a new make_slimed function
- attempted to update all make dependencies for new end.c -> lev.h
dependency, sorry if I messed any up

54 files changed:
include/decl.h
include/extern.h
include/you.h
src/allmain.c
src/artifact.c
src/cmd.c
src/dbridge.c
src/decl.c
src/do.c
src/do_wear.c
src/dokick.c
src/dothrow.c
src/eat.c
src/end.c
src/exper.c
src/explode.c
src/hack.c
src/mcastu.c
src/mhitu.c
src/mon.c
src/mthrowu.c
src/polyself.c
src/potion.c
src/pray.c
src/read.c
src/restore.c
src/rip.c
src/save.c
src/spell.c
src/teleport.c
src/timeout.c
src/topten.c
src/trap.c
src/uhitm.c
src/zap.c
sys/amiga/Makefile.agc
sys/amiga/Makefile.ami
sys/amiga/amirip.c
sys/mac/macwin.c
sys/msdos/Makefile.BC
sys/msdos/Makefile.GCC
sys/msdos/Makefile.MSC
sys/os2/Makefile.os2
sys/unix/Makefile.src
sys/vms/Makefile.src
sys/wince/bootstrp.mak
sys/winnt/Makefile.bcc
sys/winnt/Makefile.gcc
sys/winnt/Makefile.msc
win/Qt/qt_win.cpp
win/X11/wintext.c
win/gem/wingem.c
win/gnome/gnbind.c
win/win32/mswproc.c

index d1d4ddd2051e777b7ae237cfe9327a8ab224aec3..d1974da2aabb8c91bd5ea9d128f0669ca45e952c 100644 (file)
@@ -170,16 +170,20 @@ E const char disclosure_options[];
 E NEARDATA int smeq[];
 E NEARDATA int doorindex;
 E NEARDATA char *save_cm;
+
+E NEARDATA struct kinfo {
+    struct kinfo *next;                        /* chain of delayed killers */
+    int                id;                     /* uprop keys to ID a delayed killer */
+    int                format;                 /* one of the killer formats */
 #define KILLED_BY_AN    0
 #define KILLED_BY       1
 #define NO_KILLER_PREFIX 2
-E NEARDATA int killer_format;
-E const char *killer;
-E const char *delayed_killer;
+    char       name[BUFSZ];            /* actual killer name */
+killer;
+
 #ifdef GOLDOBJ
 E long done_money;
 #endif
-E char killer_buf[BUFSZ];
 E const char *configfile;
 E NEARDATA char plname[PL_NSIZ];
 E NEARDATA char dogname[];
index 4fb9397a35ce52abee355e4bcefcd838761d4b8c..eb0ffb668f9ee4b44ad3a472dd4afbcca5ab6afb 100644 (file)
@@ -555,6 +555,11 @@ E void FDECL(done, (int));
 E void FDECL(container_contents, (struct obj *,BOOLEAN_P,BOOLEAN_P));
 E void FDECL(terminate, (int));
 E int NDECL(num_genocides);
+E void FDECL(delayed_killer, (int, int, const char*));
+E struct kinfo *FDECL(find_delayed_killer, (int));
+E void FDECL(dealloc_killer, (struct kinfo*));
+E void FDECL(save_killers, (int,int));
+E void FDECL(restore_killers, (int));
 
 /* ### engrave.c ### */
 
@@ -1546,6 +1551,7 @@ E void FDECL(make_confused, (long,BOOLEAN_P));
 E void FDECL(make_stunned, (long,BOOLEAN_P));
 E void FDECL(make_blinded, (long,BOOLEAN_P));
 E void FDECL(make_sick, (long, const char *, BOOLEAN_P,int));
+E void FDECL(make_slimed, (long,const char*));
 E void FDECL(make_vomiting, (long,BOOLEAN_P));
 E void FDECL(make_hallucinated, (long,BOOLEAN_P,long));
 E int NDECL(dodrink);
index 9460bb164b772e20858e01f29aa2bcb58362725b..d792b717675f1e5b470c1a88b044bc54ae5b2d3e 100644 (file)
@@ -265,7 +265,6 @@ struct you {
        struct prop uprops[LAST_PROP+1];
 
        unsigned umconf;
-       char usick_cause[PL_PSIZ+20]; /* sizeof "unicorn horn named "+1 */
        Bitfield(usick_type,2);
 #define SICK_VOMITABLE 0x01
 #define SICK_NONVOMITABLE 0x02
index 61b22a02d7d66ae18a9755e858991d8656f76bf6..8d30d38797d3e0cfb3dfe9e07dd07b96d5cd1c2c 100644 (file)
@@ -360,8 +360,8 @@ moveloop()
            else if (!u.uinvulnerable) {
                u.utrap -= 1<<8;
                if(u.utrap < 1<<8) {
-                   killer_format = KILLED_BY;
-                   killer = "molten lava";
+                   killer.format = KILLED_BY;
+                   Strcpy(killer.name, "molten lava");
                    You("sink below the surface and die.");
                    done(DISSOLVED);
                } else if(didmove && !u.umoved) {
index 29b1f406fca36eb0765a54d216f54f490c7cda43..407295f895929b6cf7ceb3aaeffbc47a9cc59497 100644 (file)
@@ -1210,7 +1210,7 @@ arti_invoke(obj)
                else u.uhp += healamt;
            }
            if(Sick) make_sick(0L,(char *)0,FALSE,SICK_ALL);
-           if(Slimed) Slimed = 0L;
+           if(Slimed) make_slimed(0L, (char *)0);
            if (Blinded > creamed) make_blinded(creamed, FALSE);
            context.botl = 1;
            break;
index 19cc6a0fbea4745182324d8f060910449a3e4f16..1109c92f97cfe729564510c98c0a40ff3a91b994 100644 (file)
--- a/src/cmd.c
+++ b/src/cmd.c
@@ -975,7 +975,7 @@ int final;  /* 0 => still in progress; 1 => over, survived; 2 => dead */
        /* If you die while dismounting, u.usteed is still set.  Since several
         * places in the done() sequence depend on u.usteed, just detect this
         * special case. */
-       if (u.usteed && (final < 2 || strcmp(killer, "riding accident"))) {
+       if (u.usteed && (final < 2 || strcmp(killer.name, "riding accident"))) {
            Sprintf(buf, "riding %s", y_monnam(u.usteed));
            you_are(buf);
        }
index ae80abb2cf6839f3c43c03c9a8bda8310cef00b0..53b9878254d519343fa3663231a92f81a5f1e74a 100644 (file)
@@ -370,18 +370,18 @@ int dest, how;
 {
        if (is_u(etmp)) {
                if (how == DROWNING) {
-                       killer = 0;     /* drown() sets its own killer */
+                       killer.name[0] = 0; /* drown() sets its own killer */
                        (void) drown();
                } else if (how == BURNING) {
-                       killer = 0;     /* lava_effects() sets its own killer */
+                       killer.name[0] = 0; /* lava_effects() sets own killer */
                        (void) lava_effects();
                } else {
                        coord xy;
 
                        /* use more specific killer if specified */
-                       if (!killer) {
-                           killer_format = KILLED_BY_AN;
-                           killer = "falling drawbridge";
+                       if (!killer.name[0]) {
+                           killer.format = KILLED_BY_AN;
+                           Strcpy(killer.name, "falling drawbridge");
                        }
                        done(how);
                        /* So, you didn't die */
@@ -399,7 +399,7 @@ int dest, how;
                /* we might have crawled out of the moat to survive */
                etmp->ex = u.ux,  etmp->ey = u.uy;
        } else {
-               killer = 0;
+               killer.name[0] = 0;
                /* fake "digested to death" damage-type suppresses corpse */
 #define mk_message(dest) ((dest & 1) ? "" : (char *)0)
 #define mk_corpse(dest)  ((dest & 2) ? AD_DGST : AD_PHYS)
@@ -671,8 +671,8 @@ struct entity *etmp;
                                      E_phrase(etmp, "disappear"));
                }
                if (!e_survives_at(etmp, etmp->ex, etmp->ey)) {
-                       killer_format = KILLED_BY_AN;
-                       killer = "closing drawbridge";
+                       killer.format = KILLED_BY_AN;
+                       Strcpy(killer.name, "closing drawbridge");
                        e_died(etmp, 0, CRUSHING);             /* no message */
                        return;
                }
@@ -710,8 +710,8 @@ struct entity *etmp;
                                  E_phrase(etmp, "fall"),
                                  lava ? "lava" : "moat");
                    }
-               killer_format = NO_KILLER_PREFIX;
-               killer = "fell from a drawbridge";
+               killer.format = NO_KILLER_PREFIX;
+               Strcpy(killer.name, "fell from a drawbridge");
                e_died(etmp, e_inview ? 3 : 2,      /* CRUSHING is arbitrary */
                       (is_pool(etmp->ex, etmp->ey)) ? DROWNING :
                       (is_lava(etmp->ex, etmp->ey)) ? BURNING :
@@ -880,8 +880,8 @@ int x,y;
                        if (e_inview)
                                pline("%s blown apart by flying debris.",
                                      E_phrase(etmp2, "are"));
-                       killer_format = KILLED_BY_AN;
-                       killer = "exploding drawbridge";
+                       killer.format = KILLED_BY_AN;
+                       Strcpy(killer.name, "exploding drawbridge");
                        e_died(etmp2, e_inview? 3 : 2, CRUSHING); /*no corpse*/
                }            /* nothing which is vulnerable can survive this */
        }
@@ -909,8 +909,8 @@ int x,y;
                                      E_phrase(etmp1, "die"));
 #endif
                        }
-                       killer_format = KILLED_BY_AN;
-                       killer = "collapsing drawbridge";
+                       killer.format = KILLED_BY_AN;
+                       Strcpy(killer.name, "collapsing drawbridge");
                        e_died(etmp1, e_inview? 3 : 2, CRUSHING); /*no corpse*/
                        if(lev1->typ == MOAT) do_entity(etmp1);
                }
index ac1f7c19711e5a7f3d7e664512a1f574c2094ca2..82918be8b178d803a1f1d180021596be96fe277c 100644 (file)
@@ -45,15 +45,12 @@ struct q_score      quest_status = DUMMY;
 
 NEARDATA int smeq[MAXNROFROOMS+1] = DUMMY;
 NEARDATA int doorindex = 0;
-
 NEARDATA char *save_cm = 0;
-NEARDATA int killer_format = 0;
-const char *killer = 0;
-const char *delayed_killer = 0;
+
+NEARDATA struct kinfo killer = DUMMY;
 #ifdef GOLDOBJ
 NEARDATA long done_money = 0;
 #endif
-char killer_buf[BUFSZ] = DUMMY;
 const char *nomovemsg = 0;
 const char nul[40] = DUMMY;                    /* contains zeros */
 NEARDATA char plname[PL_NSIZ] = DUMMY;         /* player name */
index 3a0f937e11caa23fbd415b3d1d39b77b897b1f62..49ef8cada6c31d8725c42dc6209da56d42147180 100644 (file)
--- a/src/do.c
+++ b/src/do.c
@@ -1072,7 +1072,7 @@ boolean at_stairs, falling, portal;
                if (fd < 0) {
                        pline("%s", whynot);
                        pline("Probably someone removed it.");
-                       killer = whynot;
+                       Strcpy(killer.name, whynot);
                        done(TRICKED);
                        /* we'll reach here if running in wizard mode */
                        error("Cannot continue this game.");
index 22d7e8499d8628907dbd559ec59b93b862d82d6e..ef54c3410dfb1fc31b7abf403e5a3c65f3cb6b66 100644 (file)
@@ -537,10 +537,7 @@ Amulet_on()
        case FAKE_AMULET_OF_YENDOR:
                break;
        case AMULET_OF_UNCHANGING:
-               if (Slimed) {
-                   Slimed = 0;
-                   context.botl = 1;
-               }
+               if (Slimed) make_slimed(0L, (char *)0);
                break;
        case AMULET_OF_CHANGE:
            {
index 86dc7384f3e67736672ed72cfad24b07f0c29903..bb248eebc12efb2b2ed188272afc600332e42299 100644 (file)
@@ -426,17 +426,14 @@ xchar x, y;
 
        if(kickobj->otyp == CORPSE && touch_petrifies(&mons[kickobj->corpsenm])
                        && !Stone_resistance && !uarmf) {
-           char kbuf[BUFSZ];
-
            You("kick the %s with your bare %s.",
                corpse_xname(kickobj, TRUE), makeplural(body_part(FOOT)));
            if (!(poly_when_stoned(youmonst.data) && polymon(PM_STONE_GOLEM))) {
                You("turn to stone...");
-               killer_format = KILLED_BY;
+               killer.format = KILLED_BY;
                /* KMH -- otmp should be kickobj */
-               Sprintf(kbuf, "kicking %s without boots",
+               Sprintf(killer.name, "kicking %s without boots",
                        an(corpse_xname(kickobj, TRUE)));
-               killer = kbuf;
                done(STONING);
            }
        }
index bd92dabd7ff1aab8f5e92b5f8a32795273f76dbf..9c47f18a642b1ee0c91cc19170d0ee5decdba6c4 100644 (file)
@@ -96,8 +96,8 @@ int shotlimit;
                    touch_petrifies(&mons[obj->corpsenm]))) {
                You("throw the %s corpse with your bare %s.",
                    mons[obj->corpsenm].mname, body_part(HAND));
-               Sprintf(killer_buf, "%s corpse", an(mons[obj->corpsenm].mname));
-               instapetrify(killer_buf);
+               Sprintf(killer.name, "%s corpse", an(mons[obj->corpsenm].mname));
+               instapetrify(killer.name);
        }
        if (welded(obj)) {
                weldmsg(obj);
@@ -801,8 +801,8 @@ boolean hitsroof;
            if (!Stone_resistance &&
                    !(poly_when_stoned(youmonst.data) && polymon(PM_STONE_GOLEM))) {
  petrify:
-               killer_format = KILLED_BY;
-               killer = "elementary physics";  /* "what goes up..." */
+               killer.format = KILLED_BY;
+               Strcpy(killer.name, "elementary physics"); /* "what goes up..." */
                You("turn to stone.");
                if (obj) dropy(obj);    /* bypass most of hitfloor() */
                done(STONING);
index 8404f5b10bcb1c91dd927fb1810a632f0101a6db..d0d23d2e0ae8a5b9145aba2af6156b49cbf80b11 100644 (file)
--- a/src/eat.c
+++ b/src/eat.c
@@ -208,7 +208,7 @@ choke(food) /* To a full belly all food is bad. (It.) */
                nomovemsg = 0;
                vomit();
        } else {
-               killer_format = KILLED_BY_AN;
+               killer.format = KILLED_BY_AN;
                /*
                 * Note all "killer"s below read "Choked on %s" on the
                 * high score list & tombstone.  So plan accordingly.
@@ -216,19 +216,19 @@ choke(food)       /* To a full belly all food is bad. (It.) */
                if(food) {
                        You("choke over your %s.", foodword(food));
                        if (food->oclass == COIN_CLASS) {
-                               killer = "a very rich meal";
+                               Strcpy(killer.name, "a very rich meal");
                        } else {
-                               killer = food_xname(food, FALSE);
+                               Strcpy(killer.name, food_xname(food, FALSE));
                                if (food->otyp == CORPSE &&
                                    (mons[food->corpsenm].geno & G_UNIQ)) {
                                    if (!type_is_pname(&mons[food->corpsenm]))
-                                       killer = the(killer);
-                                   killer_format = KILLED_BY;
+                                       Strcpy(killer.name, the(killer.name));
+                                   killer.format = KILLED_BY;
                                }
                        }
                } else {
                        You("choke over it.");
-                       killer = "quick snack";
+                       Strcpy(killer.name, "quick snack");
                }
                You("die...");
                done(CHOKING);
@@ -425,9 +425,8 @@ register int pm;
        if (touch_petrifies(&mons[pm]) || pm == PM_MEDUSA) {
            if (!Stone_resistance &&
                !(poly_when_stoned(youmonst.data) && polymon(PM_STONE_GOLEM))) {
-               Sprintf(killer_buf, "tasting %s meat", mons[pm].mname);
-               killer_format = KILLED_BY;
-               killer = killer_buf;
+               Sprintf(killer.name, "tasting %s meat", mons[pm].mname);
+               killer.format = KILLED_BY;
                You("turn to stone.");
                done(STONING);
                if (context.victual.piece)
@@ -454,12 +453,11 @@ register int pm;
            case PM_DEATH:
            case PM_PESTILENCE:
            case PM_FAMINE:
-               { char buf[BUFSZ];
+               {
                    pline("Eating that is instantly fatal.");
-                   Sprintf(buf, "unwisely ate the body of %s",
+                   Sprintf(killer.name, "unwisely ate the body of %s",
                            mons[pm].mname);
-                   killer = buf;
-                   killer_format = NO_KILLER_PREFIX;
+                   killer.format = NO_KILLER_PREFIX;
                    done(DIED);
                    /* It so happens that since we know these monsters */
                    /* cannot appear in tins, context.victual.piece will always */
@@ -474,8 +472,8 @@ register int pm;
                if (!Slimed && !Unchanging && !flaming(youmonst.data) &&
                        youmonst.data != &mons[PM_GREEN_SLIME]) {
                    You("don't feel very well.");
-                   Slimed = 10L;
-                   context.botl = 1;
+                   make_slimed(10L, (char*) 0);
+                   delayed_killer(SLIMED, KILLED_BY_AN, nul);
                }
                /* Fall through */
            default:
@@ -489,7 +487,7 @@ void
 fix_petrification()
 {
        Stoned = 0;
-       delayed_killer = 0;
+       dealloc_killer(find_delayed_killer(STONED));
        if (Hallucination)
            pline("What a pity - you just ruined a future piece of %sart!",
                  ACURR(A_CHA) > 15 ? "fine " : "");
@@ -1668,8 +1666,8 @@ register struct obj *otmp;
                        if(!rn2(17)) u.uhpmax++;
                        u.uhp = u.uhpmax;
                    } else if (u.uhp <= 0) {
-                       killer_format = KILLED_BY_AN;
-                       killer = "rotten lump of royal jelly";
+                       killer.format = KILLED_BY_AN;
+                       Strcpy(killer.name, "rotten lump of royal jelly");
                        done(POISONING);
                    }
                }
@@ -1679,10 +1677,12 @@ register struct obj *otmp;
                if (touch_petrifies(&mons[otmp->corpsenm])) {
                    if (!Stone_resistance &&
                        !(poly_when_stoned(youmonst.data) && polymon(PM_STONE_GOLEM))) {
-                       if (!Stoned) Stoned = 5;
-                       killer_format = KILLED_BY_AN;
-                       Sprintf(killer_buf, "%s egg", mons[otmp->corpsenm].mname);
-                       delayed_killer = killer_buf;
+                       if (!Stoned) {
+                           Stoned = 5;
+                           Sprintf(killer.name,
+                                   "%s egg", mons[otmp->corpsenm].mname);
+                           delayed_killer(STONED, KILLED_BY_AN, killer.name);
+                       }
                    }
                }
                break;
@@ -2294,8 +2294,8 @@ boolean incr;
                        context.botl = 1;
                        bot();
                        You("die from starvation.");
-                       killer_format = KILLED_BY;
-                       killer = "starvation";
+                       killer.format = KILLED_BY;
+                       Strcpy(killer.name, "starvation");
                        done(STARVING);
                        /* if we return, we lifesaved, and that calls newuhs */
                        return;
@@ -2346,8 +2346,8 @@ boolean incr;
                bot();
                if ((Upolyd ? u.mh : u.uhp) < 1) {
                        You("die from hunger and exhaustion.");
-                       killer_format = KILLED_BY;
-                       killer = "exhaustion";
+                       killer.format = KILLED_BY;
+                       Strcpy(killer.name, "exhaustion");
                        done(STARVING);
                        return;
                }
index d16b12c14ebfd1ffa5bb3115b7a3fd0b0fbc4bf0..8a1ae69465a84bd33721fbe257603093b1f1dac1 100644 (file)
--- a/src/end.c
+++ b/src/end.c
@@ -6,6 +6,7 @@
 
 #include "hack.h"
 #include "eshk.h"
+#include "lev.h"
 #ifndef NO_SIGNAL
 #include <signal.h>
 #endif
@@ -188,18 +189,18 @@ register struct monst *mtmp;
        You("die...");
        mark_synch();   /* flush buffered screen output */
        buf[0] = '\0';
-       killer_format = KILLED_BY_AN;
+       killer.format = KILLED_BY_AN;
        /* "killed by the high priest of Crom" is okay, "killed by the high
           priest" alone isn't */
        if ((mtmp->data->geno & G_UNIQ) != 0 && !(mtmp->data == &mons[PM_HIGH_PRIEST] && !mtmp->ispriest)) {
            if (!type_is_pname(mtmp->data))
                Strcat(buf, "the ");
-           killer_format = KILLED_BY;
+           killer.format = KILLED_BY;
        }
        /* _the_ <invisible> <distorted> ghost of Dudley */
        if (mtmp->data == &mons[PM_GHOST] && mtmp->mnamelth) {
                Strcat(buf, "the ");
-               killer_format = KILLED_BY;
+               killer.format = KILLED_BY;
        }
        if (mtmp->minvis)
                Strcat(buf, "invisible ");
@@ -212,12 +213,11 @@ register struct monst *mtmp;
        } else if(mtmp->isshk) {
                Sprintf(eos(buf), "%s %s, the shopkeeper",
                        (mtmp->female ? "Ms." : "Mr."), shkname(mtmp));
-               killer_format = KILLED_BY;
+               killer.format = KILLED_BY;
        } else if (mtmp->ispriest || mtmp->isminion) {
                /* m_monnam() suppresses "the" prefix plus "invisible", and
                   it overrides the effect of Hallucination on priestname() */
-               killer = m_monnam(mtmp);
-               Strcat(buf, killer);
+               Strcat(buf, m_monnam(mtmp));
        } else {
                Strcat(buf, mtmp->data->mname);
                if (mtmp->mnamelth)
@@ -225,7 +225,7 @@ register struct monst *mtmp;
        }
 
        if (multi) Strcat(buf, ", while helpless");
-       killer = buf;
+       Strcpy(killer.name, buf);
        if (mtmp->data->mlet == S_WRAITH)
                u.ugrave_arise = PM_WRAITH;
        else if (mtmp->data->mlet == S_MUMMY && urace.mummynum != NON_PM)
@@ -534,16 +534,16 @@ done(how)
 int how;
 {
        boolean taken;
-       char kilbuf[BUFSZ], pbuf[BUFSZ];
+       char pbuf[BUFSZ];
        winid endwin = WIN_ERR;
        boolean bones_ok, have_windows = iflags.window_inited;
        struct obj *corpse = (struct obj *)0;
        long umoney;
 
        if (how == TRICKED) {
-           if (killer) {
-               paniclog("trickery", killer);
-               killer = 0;
+           if (killer.name[0]) {
+               paniclog("trickery", killer.name);
+               killer.name[0] = 0;
            }
 #ifdef WIZARD
            if (wizard) {
@@ -553,18 +553,15 @@ int how;
 #endif
        }
 
-       /* kilbuf: used to copy killer in case it comes from something like
-        *      xname(), which would otherwise get overwritten when we call
-        *      xname() when listing possessions
-        * pbuf: holds Sprintf'd output for raw_print and putstr
+       /* pbuf: holds Sprintf'd output for raw_print and putstr
         */
-       if (how == ASCENDED || (!killer && how == GENOCIDED))
-               killer_format = NO_KILLER_PREFIX;
+       if (how == ASCENDED || (!killer.name[0] && how == GENOCIDED))
+               killer.format = NO_KILLER_PREFIX;
        /* Avoid killed by "a" burning or "a" starvation */
-       if (!killer && (how == STARVING || how == BURNING))
-               killer_format = KILLED_BY;
-       Strcpy(kilbuf, (!killer || how >= PANICKED ? deaths[how] : killer));
-       killer = kilbuf;
+       if (!killer.name[0] && (how == STARVING || how == BURNING))
+               killer.format = KILLED_BY;
+       if (!killer.name[0] || how >= PANICKED)
+           Strcpy(killer.name, deaths[how]);
 
        if (how < PANICKED) u.umortality++;
        if (Lifesaved && (how <= GENOCIDED)) {
@@ -583,8 +580,8 @@ int how;
                if (how == GENOCIDED)
                        pline("Unfortunately you are still genocided...");
                else {
-                       killer = 0;
-                       killer_format = 0;
+                       killer.name[0] = 0;
+                       killer.format = 0;
                        return;
                }
        }
@@ -598,8 +595,8 @@ int how;
                        (how == CHOKING) ? "choke" : "die");
                if(u.uhpmax <= 0) u.uhpmax = u.ulevel * 8;      /* arbitrary */
                savelife(how);
-               killer = 0;
-               killer_format = 0;
+               killer.name[0] = 0;
+               killer.format = 0;
                return;
        }
 
@@ -659,24 +656,24 @@ die:
                corpse = mk_named_object(CORPSE, &mons[mnum],
                                       u.ux, u.uy, plname);
                Sprintf(pbuf, "%s, %s%s", plname,
-                       killer_format == NO_KILLER_PREFIX ? "" :
+                       killer.format == NO_KILLER_PREFIX ? "" :
                        killed_by_prefix[how],
-                       killer_format == KILLED_BY_AN ? an(killer) : killer);
+                       killer.format == KILLED_BY_AN ? an(killer.name) :
+                       killer.name);
                make_grave(u.ux, u.uy, pbuf);
            }
        }
 
        if (how == QUIT) {
-               killer_format = NO_KILLER_PREFIX;
-               if (u.uhp < 1) {
-                       how = DIED;
-                       u.umortality++; /* skipped above when how==QUIT */
-                       /* note that killer is pointing at kilbuf */
-                       Strcpy(kilbuf, "quit while already on Charon's boat");
-               }
+           killer.format = NO_KILLER_PREFIX;
+           if (u.uhp < 1) {
+               how = DIED;
+               u.umortality++; /* skipped above when how==QUIT */
+               Strcpy(killer.name, "quit while already on Charon's boat");
+           }
        }
        if (how == ESCAPED || how == PANICKED)
-               killer_format = NO_KILLER_PREFIX;
+               killer.format = NO_KILLER_PREFIX;
 
        if (how != PANICKED) {
            /* these affect score and/or bones, but avoid them during panic */
@@ -755,15 +752,12 @@ die:
        } else
            done_stopprint = 1; /* just avoid any more output */
 
-/* changing kilbuf really changes killer. we do it this way because
-   killer is declared a (const char *)
-*/
-       if (u.uhave.amulet) Strcat(kilbuf, " (with the Amulet)");
+       if (u.uhave.amulet) Strcat(killer.name, " (with the Amulet)");
        else if (how == ESCAPED) {
            if (Is_astralevel(&u.uz))   /* offered Amulet to wrong deity */
-               Strcat(kilbuf, " (in celestial disgrace)");
+               Strcat(killer.name, " (in celestial disgrace)");
            else if (carrying(FAKE_AMULET_OF_YENDOR))
-               Strcat(kilbuf, " (with a fake Amulet)");
+               Strcat(killer.name, " (with a fake Amulet)");
                /* don't bother counting to see whether it should be plural */
        }
 
@@ -1100,4 +1094,94 @@ boolean ask;
     }
 }
 
+/* set a delayed killer, ensure non-delayed killer is cleared out */
+void
+delayed_killer(id, format, killername)
+    int                id;
+    int                format;
+    const char *killername;
+{
+    struct kinfo *k = find_delayed_killer(id);
+
+    if (k == (struct kinfo*) 0) {
+       /* no match, add a new delayed killer to the list */
+       k = (struct kinfo*) alloc(sizeof(struct kinfo));
+       k->id = id;
+       k->next = killer.next;
+       killer.next = k;
+    }
+
+    k->format = format;
+    Strcpy(k->name, killername ? killername : "");
+    killer.name[0] = 0;
+}
+
+struct kinfo*
+find_delayed_killer(id)
+    int id;
+{
+    struct kinfo* k;
+
+    for (k = killer.next; k != (struct kinfo*) 0; k = k->next) {
+       if (k->id == id) break;
+    }
+
+    return k;
+}
+
+void
+dealloc_killer(kptr)
+    struct kinfo *kptr;
+{
+    struct kinfo *prev = &killer, *k;
+
+    if (kptr == (struct kinfo *)0) return;
+    for (k = killer.next; k != (struct kinfo*) 0; k = k->next) {
+       if (k == kptr) break;
+       prev = k;
+    }
+
+    if (k == (struct kinfo*) 0) {
+       impossible("dealloc_killer not on list");
+    } else {
+       prev->next = k->next;
+       free((genericptr_t) k);
+    }
+}
+
+void
+save_killers(fd, mode)
+    int fd;
+    int mode;
+{
+    struct kinfo *kptr;
+
+    if (perform_bwrite(mode)) {
+       for (kptr = &killer; kptr != (struct kinfo*)0; kptr = kptr->next) {
+           bwrite(fd, (genericptr_t)kptr, sizeof(struct kinfo));
+       }
+    }
+    if (release_data(mode)) {
+       while (killer.next) {
+           kptr = killer.next->next;
+           free((genericptr_t)killer.next);
+           killer.next = kptr;
+       }
+    }
+}
+
+void
+restore_killers(fd)
+    int fd;
+{
+    struct kinfo *kptr;
+
+    for (kptr = &killer; kptr != (struct kinfo*)0; kptr = kptr->next) {
+       mread(fd, (genericptr_t)kptr, sizeof(struct kinfo));
+       if (kptr->next) {
+           kptr->next = (struct kinfo*) alloc(sizeof(struct kinfo));
+       }
+    }
+}
+
 /*end.c*/
index 3d2bc546965c2e8eff1e8e2f7d373ab486e83720..6e56c487916bcbe05a1a6a4877c55f09b281b1d0 100644 (file)
@@ -132,9 +132,9 @@ const char *drainer;        /* cause of death, if drain should be fatal */
                reset_rndmonst(NON_PM); /* new monster selection */
        } else {
                if (drainer) {
-                       killer_format = KILLED_BY;
-                       killer = drainer;
-                       done(DIED);
+                   killer.format = KILLED_BY;
+                   if (killer.name != drainer) Strcpy(killer.name, drainer);
+                   done(DIED);
                }
                /* no drainer or lifesaved */
                u.uexp = 0;
index f3c6f1f6cd1240c92c775c058142155221d50a9b..3f80576a348603eaff0b7e842261ebc201936af2 100644 (file)
@@ -31,7 +31,7 @@ int expltype;
        boolean starting = 1;
        boolean visible, any_shield;
        int uhurt = 0; /* 0=unhurt, 1=items damaged, 2=you and items damaged */
-       const char *str;
+       const char *str = (const char *) 0;
        int idamres, idamnonres;
        struct monst *mtmp;
        uchar adtyp;
@@ -53,8 +53,7 @@ int expltype;
                }
 
        if (olet == MON_EXPLODE) {
-           str = killer;
-           killer = 0;         /* set again later as needed */
+           str = killer.name;
            adtyp = AD_PHYS;
        } else
        switch (abs(type) % 10) {
@@ -338,22 +337,23 @@ int expltype;
                    } else {
                        if (olet == MON_EXPLODE) {
                            /* killer handled by caller */
-                           if (str != killer_buf && !generic)
-                               Strcpy(killer_buf, str);
-                           killer_format = KILLED_BY_AN;
+                           if (generic)
+                               killer.name[0] = 0;
+                           else if (str != killer.name)
+                               Strcpy(killer.name, str);
+                           killer.format = KILLED_BY_AN;
                        } else if (type >= 0 && olet != SCROLL_CLASS) {
-                           killer_format = NO_KILLER_PREFIX;
-                           Sprintf(killer_buf, "caught %sself in %s own %s",
+                           killer.format = NO_KILLER_PREFIX;
+                           Sprintf(killer.name, "caught %sself in %s own %s",
                                    uhim(), uhis(), str);
                        } else if (!strncmpi(str,"tower of flame", 8) ||
                                   !strncmpi(str,"fireball", 8)) {
-                           killer_format = KILLED_BY_AN;
-                           Strcpy(killer_buf, str);
+                           killer.format = KILLED_BY_AN;
+                           Strcpy(killer.name, str);
                        } else {
-                           killer_format = KILLED_BY;
-                           Strcpy(killer_buf, str);
+                           killer.format = KILLED_BY;
+                           Strcpy(killer.name, str);
                        }
-                       killer = killer_buf;
                        /* Known BUG: BURNING suppresses corpse in bones data,
                           but done does not handle killer reason correctly */
                        done((adtyp == AD_FIRE) ? BURNING : DIED);
index f3ca86f9273daba7e071b5fd7c0e890aeeb7a024..6f2a15440356ad1de09b672c4576a023d0004f2c 100644 (file)
@@ -2099,8 +2099,9 @@ boolean k_format;
                u.uhpmax = u.uhp;       /* perhaps n was negative */
        context.botl = 1;
        if(u.uhp < 1) {
-               killer_format = k_format;
-               killer = knam;          /* the thing that killed you */
+               killer.format = k_format;
+               if (killer.name != knam) /* the thing that killed you */
+                   Strcpy(killer.name, knam ? knam : "");
                You("die...");
                done(DIED);
        } else if (n > 0 && u.uhp*10 < u.uhpmax) {
index b48db5ac660d44025607d198a813eb607fc5b527..2b2c91a501ae4337ce3168cadb8a63c9b1cc26fe 100644 (file)
@@ -332,8 +332,8 @@ int spellnum;
            if (Hallucination) {
                You("have an out of body experience.");
            } else {
-               killer_format = KILLED_BY_AN;
-               killer = "touch of death";
+               killer.format = KILLED_BY_AN;
+               Strcpy(killer.name, "touch of death");
                done(DIED);
            }
        } else {
index 5b7f5e2018e0e7af316d4227eca6db21bbe95483..0fc9759086ec49373b47b3ed08f66034c5777a40 100644 (file)
@@ -1058,8 +1058,8 @@ dopois:
                                pline("Unfortunately your brain is still gone.");
                            else
                                Your("last thought fades away.");
-                           killer = "brainlessness";
-                           killer_format = KILLED_BY;
+                           Strcpy(killer.name, "brainlessness");
+                           killer.format = KILLED_BY;
                            done(DIED);
                            lifesaved++;
                        }
@@ -1150,18 +1150,16 @@ dopois:
                            if (!Stoned && !Stone_resistance
                                    && !(poly_when_stoned(youmonst.data) &&
                                        polymon(PM_STONE_GOLEM))) {
+                               int kformat = KILLED_BY_AN;
+                               const char *kname = mtmp->data->mname;
+
                                Stoned = 5;
-                               delayed_killer = mtmp->data->mname;
                                if (mtmp->data->geno & G_UNIQ) {
-                                   if (!type_is_pname(mtmp->data)) {
-                                       static char buf[BUFSZ];
-
-                                       /* "the" buffer may be reallocated */
-                                       Strcpy(buf, the(delayed_killer));
-                                       delayed_killer = buf;
-                                   }
-                                   killer_format = KILLED_BY;
-                               } else killer_format = KILLED_BY_AN;
+                                   if (!type_is_pname(mtmp->data))
+                                       kname = the(kname);
+                                   kformat = KILLED_BY;
+                               }
+                               delayed_killer(STONED, kformat, kname);
                                return(1);
                                /* You("turn to stone..."); */
                                /* done_in_by(mtmp); */
@@ -1195,11 +1193,10 @@ dopois:
                                !Is_waterlevel(&u.uz);
 
                            pline("%s drowns you...", Monnam(mtmp));
-                           killer_format = KILLED_BY_AN;
-                           Sprintf(buf, "%s by %s",
+                           killer.format = KILLED_BY_AN;
+                           Sprintf(killer.name, "%s by %s",
                                    moat ? "moat" : "pool of water",
                                    an(mtmp->data->mname));
-                           killer = buf;
                            done(DROWNING);
                        } else if(mattk->aatyp == AT_HUGS)
                            You("are being crushed.");
@@ -1450,8 +1447,8 @@ dopois:
                switch (rn2(20)) {
                case 19: case 18: case 17:
                    if (!Antimagic) {
-                       killer_format = KILLED_BY_AN;
-                       killer = "touch of death";
+                       killer.format = KILLED_BY_AN;
+                       Strcpy(killer.name, "touch of death");
                        done(DIED);
                        dmg = 0;
                        break;
@@ -1491,10 +1488,8 @@ dopois:
                    dmg = 0;
                } else if (!Slimed) {
                    You("don't feel very well.");
-                   Slimed = 10L;
-                   context.botl = 1;
-                   killer_format = KILLED_BY_AN;
-                   delayed_killer = mtmp->data->mname;
+                   make_slimed(10L, (char*) 0);
+                   delayed_killer(SLIMED, KILLED_BY_AN, mtmp->data->mname);
                } else
                    pline("Yuck!");
                break;
@@ -1912,8 +1907,8 @@ gazemu(mtmp, mattk)       /* monster gazes at you */
                    if(poly_when_stoned(youmonst.data) && polymon(PM_STONE_GOLEM))
                        break;
                    You("turn to stone...");
-                   killer_format = KILLED_BY;
-                   killer = mtmp->data->mname;
+                   killer.format = KILLED_BY;
+                   Strcpy(killer.name, mtmp->data->mname);
                    done(STONING);
                }
                break;
index 08fb1edfbee1a37acc84ec9c110b2ccc7054af24..be20c45c537bf64b7b04659fac0042824c91f1f7 100644 (file)
--- a/src/mon.c
+++ b/src/mon.c
@@ -1483,10 +1483,10 @@ boolean was_swallowed;                  /* digestion */
                    if (magr == &youmonst) {
                        There("is an explosion in your %s!",
                              body_part(STOMACH));
-                       Sprintf(killer_buf, "%s explosion",
+                       Sprintf(killer.name, "%s explosion",
                                s_suffix(mdat->mname));
                        if (Half_physical_damage) tmp = (tmp+1) / 2;
-                       losehp(tmp, killer_buf, KILLED_BY_AN);
+                       losehp(tmp, killer.name, KILLED_BY_AN);
                    } else {
                        if (!Deaf) You_hear("an explosion.");
                        magr->mhp -= tmp;
@@ -1502,9 +1502,8 @@ boolean was_swallowed;                    /* digestion */
                    return FALSE;
                }
 
-               Sprintf(killer_buf, "%s explosion", s_suffix(mdat->mname));
-               killer = killer_buf;
-               killer_format = KILLED_BY_AN;
+               Sprintf(killer.name, "%s explosion", s_suffix(mdat->mname));
+               killer.format = KILLED_BY_AN;
                explode(mon->mx, mon->my, -1, tmp, MON_EXPLODE, EXPL_NOXIOUS); 
                return (FALSE);
            }
@@ -2018,8 +2017,8 @@ int  typ, fatal;
                losehp(i, pname, kprefix);
        }
        if(u.uhp < 1) {
-               killer_format = kprefix;
-               killer = pname;
+               killer.format = kprefix;
+               Strcpy(killer.name, pname);
                /* "Poisoned by a poisoned ___" is redundant */
                done(strstri(pname, "poison") ? DIED : POISONING);
        }
@@ -2315,21 +2314,21 @@ struct monst *mon;
                break;
        }
 #ifdef WIZARD
-       /* For debugging only: allow control of polymorphed monster; not saved */
+       /* For debugging: allow control of polymorphed monster; not saved */
        if (wizard && iflags.mon_polycontrol) {
-               char pprompt[BUFSZ], buf[BUFSZ];
-               int tries = 0;
-               do {
-                       Sprintf(pprompt,
-                               "Change %s into what kind of monster? [type the name]",
-                               mon_nam(mon));
-                       getlin(pprompt,buf);
-                       mndx = name_to_mon(buf);
-                       if (mndx < LOW_PM)
-                               You("cannot polymorph %s into that.", mon_nam(mon));
-                       else break;
-               } while(++tries < 5);
-               if (tries==5) pline(thats_enough_tries);
+           char pprompt[BUFSZ], buf[BUFSZ];
+           int tries = 0;
+           do {
+               Sprintf(pprompt,
+                       "Change %s into what kind of monster? [type the name]",
+                       mon_nam(mon));
+               getlin(pprompt,buf);
+               mndx = name_to_mon(buf);
+               if (mndx < LOW_PM)
+                   You("cannot polymorph %s into that.", mon_nam(mon));
+               else break;
+           } while(++tries < 5);
+           if (tries==5) pline(thats_enough_tries);
        }
 #endif /*WIZARD*/
        if (mndx == NON_PM) mndx = rn1(SPECIAL_PM - LOW_PM, LOW_PM);
index 3d1ca76332a0cf9cddc85c9693eeac472afebad5..b627a0f5ab1d1439b15d3ace38ccafa0b36de046 100644 (file)
@@ -400,11 +400,11 @@ m_throw(mon, x, y, dx, dy, range, obj)
                        }
                    }
                    if (hitu && singleobj->otyp == EGG) {
-                       if (!Stone_resistance
+                       if (!Stoned && !Stone_resistance
                            && !(poly_when_stoned(youmonst.data) &&
                                 polymon(PM_STONE_GOLEM))) {
                            Stoned = 5;
-                           killer = (char *) 0;
+                           delayed_killer(STONED, KILLED_BY, nul);
                        }
                    }
                    stop_occupation();
index 6f70e7aae0fa7830e8c815884294c5a9abcf62d0..d5c55c0d5551c46752cca0f3b30f9d92313a331d 100644 (file)
@@ -67,11 +67,16 @@ const char *fmt, *arg;
                        (urace.femalenum != NON_PM &&
                        (mvitals[urace.femalenum].mvflags & G_GENOD))) {
            /* intervening activity might have clobbered genocide info */
-           killer = delayed_killer;
-           if (!killer || !strstri(killer, "genocid")) {
-               killer_format = KILLED_BY;
-               killer = "self-genocide";
+           struct kinfo *kptr = find_delayed_killer(POLYMORPH);
+
+           if (kptr != (struct kinfo*) 0 && kptr->name[0]) {
+               killer.format = kptr->format;
+               Strcpy(killer.name, kptr->name);
+           } else {
+               killer.format = KILLED_BY;
+               Strcpy(killer.name, "self-genocide");
            }
+           dealloc_killer(kptr);
            done(GENOCIDED);
        }
 
@@ -188,7 +193,7 @@ newman()
        u.uhunger = rn1(500,500);
        if (Sick) make_sick(0L, (char *) 0, FALSE, SICK_ALL);
        Stoned = 0;
-       delayed_killer = 0;
+       dealloc_killer(find_delayed_killer(STONED));
        if (u.uhp <= 0 || u.uhpmax <= 0) {
                if (Polymorph_control) {
                    if (u.uhp <= 0) u.uhp = 1;
@@ -196,8 +201,8 @@ newman()
                } else {
 dead: /* we come directly here if their experience level went to 0 or less */
                    Your("new form doesn't seem healthy enough to survive.");
-                   killer_format = KILLED_BY_AN;
-                   killer="unsuccessful polymorph";
+                   killer.format = KILLED_BY_AN;
+                   Strcpy(killer.name, "unsuccessful polymorph");
                    done(DIED);
                    newuhs(FALSE);
                    return; /* lifesaved */
@@ -209,7 +214,7 @@ dead: /* we come directly here if their experience level went to 0 or less */
                (urace.individual.m) ? urace.individual.m : urace.noun);
        if (Slimed) {
                Your("body transforms, but there is still slime on you.");
-               Slimed = 10L;
+               make_slimed(10L, (const char*) 0);
        }
        context.botl = 1;
        see_monsters();
@@ -385,7 +390,7 @@ int mntmp;
                You("turn to stone!");
                mntmp = PM_STONE_GOLEM;
                Stoned = 0;
-               delayed_killer = 0;
+               dealloc_killer(find_delayed_killer(STONED));
        }
 
        u.mtimedone = rn1(500, 500);
@@ -399,7 +404,7 @@ int mntmp;
 
        if (Stone_resistance && Stoned) { /* parnes@eniac.seas.upenn.edu */
                Stoned = 0;
-               delayed_killer = 0;
+               dealloc_killer(find_delayed_killer(STONED));
                You("no longer seem to be petrifying.");
        }
        if (Sick_resistance && Sick) {
@@ -408,13 +413,10 @@ int       mntmp;
        }
        if (Slimed) {
            if (flaming(youmonst.data)) {
-               pline_The("slime burns away!");
-               Slimed = 0L;
-               context.botl = 1;
+               make_slimed(0L, "The slime burns away!");
            } else if (mntmp == PM_GREEN_SLIME) {
                /* do it silently */
-               Slimed = 0L;
-               context.botl = 1;
+               make_slimed(0L, (char*) 0);
            }
        }
        if (nohands(youmonst.data)) Glib = 0;
@@ -715,8 +717,8 @@ rehumanize()
 {
        /* You can't revert back while unchanging */
        if (Unchanging && (u.mh < 1)) {
-               killer_format = NO_KILLER_PREFIX;
-               killer = "killed while stuck in creature form";
+               killer.format = NO_KILLER_PREFIX;
+               Strcpy(killer.name, "killed while stuck in creature form");
                done(DIED);
        }
 
@@ -725,11 +727,8 @@ rehumanize()
        polyman("return to %s form!", urace.adj);
 
        if (u.uhp < 1) {
-           char kbuf[256];
-
-           Sprintf(kbuf, "reverting to unhealthy %s form", urace.adj);
-           killer_format = KILLED_BY;
-           killer = kbuf;
+           Sprintf(killer.name, "reverting to unhealthy %s form", urace.adj);
+           killer.format = KILLED_BY;
            done(DIED);
        }
        if (!uarmg) selftouch("No longer petrify-resistant, you");
@@ -1045,8 +1044,9 @@ dogaze()
                            l_monnam(mtmp));
                        /* as if gazing at a sleeping anything is fruitful... */
                        You("turn to stone...");
-                       killer_format = KILLED_BY;
-                       killer = "deliberately meeting Medusa's gaze";
+                       killer.format = KILLED_BY;
+                       Strcpy(killer.name,
+                              "deliberately meeting Medusa's gaze");
                        done(STONING);
                    }
                }
index a5d7d4eca12820e72ad14d1e7451e72980e6d2fd..da8f00d0ca037b706b2949d83e6e4da349864f4f 100644 (file)
@@ -133,14 +133,24 @@ int type;
 
        if (Sick) {
            exercise(A_CON, FALSE);
-           if (cause) {
-               (void) strncpy(u.usick_cause, cause, sizeof(u.usick_cause));
-               u.usick_cause[sizeof(u.usick_cause)-1] = 0;
-               }
-           else
-               u.usick_cause[0] = 0;
+           delayed_killer(SICK, KILLED_BY_AN, cause);
        } else
-           u.usick_cause[0] = 0;
+           dealloc_killer(find_delayed_killer(SICK));
+}
+
+void
+make_slimed(xtime, msg)
+long xtime;
+const char *msg;
+{
+       long old = Slimed;
+
+       if ((!xtime && old) || (xtime && !old)) {
+           if (msg) pline("%s", msg);
+           context.botl = 1;
+       }
+       set_itimeout(&Slimed, xtime);
+       if (!Slimed) dealloc_killer(find_delayed_killer(SLIMED));
 }
 
 void
index a733a0302f1a910cd894d534ab3da352371205b9..2faec7c2477242dc5ba2b4cd81fa0325b8e9bf61 100644 (file)
@@ -279,13 +279,10 @@ register int trouble;
                    You_feel("more limber.");
                    Stoned = 0;
                    context.botl = 1;
-                   delayed_killer = 0;
+                   dealloc_killer(find_delayed_killer(STONED));
                    break;
            case TROUBLE_SLIMED:
-                   pline_The("slime disappears.");
-                   Slimed = 0;
-                   context.botl = 1;
-                   delayed_killer = 0;
+                   make_slimed(0L, "The slime disappears.");
                    break;
            case TROUBLE_STRANGLED:
                    if (uamul && uamul->otyp == AMULET_OF_STRANGULATION) {
@@ -544,12 +541,9 @@ STATIC_OVL void
 fry_by_god(resp_god)
 aligntyp resp_god;
 {
-       char killerbuf[64];
-
        You("fry to a crisp.");
-       killer_format = KILLED_BY;
-       Sprintf(killerbuf, "the wrath of %s", align_gname(resp_god));
-       killer = killerbuf;
+       killer.format = KILLED_BY;
+       Sprintf(killer.name, "the wrath of %s", align_gname(resp_god));
        done(DIED);
 }
 
index 03fb3142a1c48122b5645178a64d0caf776574c6..fe4d73f1e96e4515d4f966e453829c1c255730f8 100644 (file)
@@ -1593,8 +1593,8 @@ do_class_genocide()
                    }
                }
                if (gameover || u.uhp == -1) {
-                   killer_format = KILLED_BY_AN;
-                   killer = "scroll of genocide";
+                   killer.format = KILLED_BY_AN;
+                   Strcpy(killer.name, "scroll of genocide");
                    if (gameover) done(GENOCIDED);
                }
                return;
@@ -1709,25 +1709,24 @@ int how;
 
                u.uhp = -1;
                if (how & PLAYER) {
-                   killer_format = KILLED_BY;
-                   killer = "genocidal confusion";
+                   killer.format = KILLED_BY;
+                   Strcpy(killer.name, "genocidal confusion");
                } else if (how & ONTHRONE) {
                    /* player selected while on a throne */
-                   killer_format = KILLED_BY_AN;
-                   killer = "imperious order";
+                   killer.format = KILLED_BY_AN;
+                   Strcpy(killer.name, "imperious order");
                } else { /* selected player deliberately, not confused */
-                   killer_format = KILLED_BY_AN;
-                   killer = "scroll of genocide";
+                   killer.format = KILLED_BY_AN;
+                   Strcpy(killer.name, "scroll of genocide");
                }
 
        /* Polymorphed characters will die as soon as they're rehumanized. */
        /* KMH -- Unchanging prevents rehumanization */
                if (Upolyd && ptr != youmonst.data) {
-                       delayed_killer = killer;
-                       killer = 0;
-                       You_feel("dead inside.");
+                   delayed_killer(POLYMORPH, killer.format, killer.name);
+                   You_feel("dead inside.");
                } else
-                       done(GENOCIDED);
+                   done(GENOCIDED);
            } else if (ptr == youmonst.data) {
                rehumanize();
            }
index 53bf5239fb82ddb5d0e54f7fefe9c666b8d96461..3692126464ff130707de26bf517aa31d6f27304e 100644 (file)
@@ -403,6 +403,7 @@ unsigned int *stuckid, *steedid;    /* STEED */
        }
 
        /* this stuff comes after potential aborted restore attempts */
+       restore_killers(fd);
        restore_timers(fd, RANGE_GLOBAL, FALSE, 0L);
        restore_light_sources(fd);
        invent = restobjchn(fd, FALSE, FALSE);
@@ -694,7 +695,7 @@ char *reason;
        pline("Strange, this map is not as I remember it.");
        pline("Somebody is trying some trickery here...");
        pline("This game is void.");
-       killer = reason;
+       Strcpy(killer.name, reason ? reason : "");
        done(TRICKED);
 }
 
index 9a82630058b64ae16e633f98fed70f0c28b92969..595929702f5b0e4ca0edd1095c175941513b07c8 100644 (file)
--- a/src/rip.c
+++ b/src/rip.c
@@ -117,18 +117,18 @@ int how;
        center(GOLD_LINE, buf);
 
        /* Put together death description */
-       switch (killer_format) {
+       switch (killer.format) {
                default: impossible("bad killer format?");
                case KILLED_BY_AN:
                        Strcpy(buf, killed_by_prefix[how]);
-                       Strcat(buf, an(killer));
+                       Strcat(buf, an(killer.name));
                        break;
                case KILLED_BY:
                        Strcpy(buf, killed_by_prefix[how]);
-                       Strcat(buf, killer);
+                       Strcat(buf, killer.name);
                        break;
                case NO_KILLER_PREFIX:
-                       Strcpy(buf, killer);
+                       Strcpy(buf, killer.name);
                        break;
        }
 
index 5cd60e43d0ec1fea9719b4bfd74a1d5b1e76645a..98db2a25e3e0c2989abee6335f796d706b47088f 100644 (file)
@@ -252,7 +252,7 @@ dosave0()
                    HUP pline("%s", whynot);
                    (void) close(fd);
                    (void) delete_savefile();
-                   HUP killer = whynot;
+                   HUP Strcpy(killer.name, whynot);
                    HUP done(TRICKED);
                    return(0);
                }
@@ -297,6 +297,7 @@ register int fd, mode;
        }
 #endif
        bwrite(fd, (genericptr_t) &u, sizeof(struct you));
+       save_killers(fd, mode);
 
        /* must come before migrating_objs and migrating_mons are freed */
        save_timers(fd, mode, RANGE_GLOBAL);
@@ -371,7 +372,7 @@ savestateinlock()
                if (fd < 0) {
                    pline("%s", whynot);
                    pline("Probably someone removed it.");
-                   killer = whynot;
+                   Strcpy(killer.name, whynot);
                    done(TRICKED);
                    return;
                }
@@ -382,7 +383,7 @@ savestateinlock()
                            "Level #0 pid (%d) doesn't match ours (%d)!",
                            hpid, hackpid);
                    pline("%s", whynot);
-                   killer = whynot;
+                   Strcpy(killer.name, whynot);
                    done(TRICKED);
                }
                (void) close(fd);
@@ -390,7 +391,7 @@ savestateinlock()
                fd = create_levelfile(0, whynot);
                if (fd < 0) {
                    pline("%s", whynot);
-                   killer = whynot;
+                   Strcpy(killer.name, whynot);
                    done(TRICKED);
                    return;
                }
@@ -1007,6 +1008,7 @@ freedynamicdata()
 # define freetrapchn(X)        (savetrapchn(0, X, FREE_SAVE), X = 0)
 # define freefruitchn()         savefruitchn(0, FREE_SAVE)
 # define freenames()    savenames(0, FREE_SAVE)
+# define free_killers()         save_killers(0, FREE_SAVE)
 # define free_oracles()        save_oracles(0, FREE_SAVE)
 # define free_waterlevel() save_waterlevel(0, FREE_SAVE)
 # define free_worm()    save_worm(0, FREE_SAVE)
@@ -1032,6 +1034,7 @@ freedynamicdata()
        freedamage();
 
        /* game-state data */
+       free_killers();
        free_timers(RANGE_GLOBAL);
        free_light_sources(RANGE_GLOBAL);
        freeobjchn(invent);
index 42bd5fa1bf67b0dc1fce99bf3b767bf6d902490a..4470105aa4c35c1ac2fd7bc6386d0905f593d5d3 100644 (file)
@@ -925,11 +925,7 @@ boolean atme;
                break;
        case SPE_CURE_SICKNESS:
                if (Sick) You("are no longer ill.");
-               if (Slimed) {
-                   pline_The("slime disappears!");
-                   Slimed = 0;
-                /* context.botl = 1; -- healup() handles this */
-               }
+               if (Slimed) make_slimed(0L, "The slime disappears!");
                healup(0, 0, TRUE, FALSE);
                break;
        case SPE_CREATE_FAMILIAR:
index 861250b9b43c128f0ea2f8817fb4e21121bf0dba..2cd31322ac7972c3da00fed7163273d0955256d4 100644 (file)
@@ -631,8 +631,8 @@ level_tele()
                    is_silent(youmonst.data) ? "writhe" : "scream");
                display_nhwindow(WIN_MESSAGE, FALSE);
                You("cease to exist.");
-               killer_format = NO_KILLER_PREFIX;
-               killer = "committed suicide";
+               killer.format = NO_KILLER_PREFIX;
+               Strcpy(killer.name, "committed suicide");
                done(DIED);
                return;
            }
@@ -685,7 +685,7 @@ level_tele()
        }
 #endif
 
-       killer = 0;             /* still alive, so far... */
+       killer.name[0] = 0;             /* still alive, so far... */
 
        if (newlev < 0) {
                if (*u.ushops0) {
@@ -699,8 +699,8 @@ level_tele()
                if (newlev <= -10) {
                        You("arrive in heaven.");
                        verbalize("Thou art early, but we'll admit thee.");
-                       killer_format = NO_KILLER_PREFIX;
-                       killer = "went to heaven prematurely";
+                       killer.format = NO_KILLER_PREFIX;
+                       Strcpy(killer.name, "went to heaven prematurely");
                } else if (newlev == -9) {
                        You_feel("deliriously happy. ");
                        pline("(In fact, you're on Cloud 9!) ");
@@ -708,7 +708,7 @@ level_tele()
                } else
                        You("are now high above the clouds...");
 
-               if (killer) {
+               if (killer.name[0]) {
                    ;           /* arrival in heaven is pending */
                } else if (Levitation) {
                    escape_by_flying = "float gently down to earth";
@@ -717,15 +717,14 @@ level_tele()
                } else {
                    pline("Unfortunately, you don't know how to fly.");
                    You("plummet a few thousand feet to your death.");
-                   Sprintf(buf,
+                   Sprintf(killer.name,
                          "teleported out of the dungeon and fell to %s death",
                            uhis());
-                   killer = buf;
-                   killer_format = NO_KILLER_PREFIX;
+                   killer.format = NO_KILLER_PREFIX;
                }
        }
 
-       if (killer) {   /* the chosen destination was not survivable */
+       if (killer.name[0]) {   /* the chosen destination was not survivable */
            d_level lsav;
 
            /* set specific death location; this also suppresses bones */
index 1fca06a96f43cf4939e500246c6ee52e28f26f43..75f6ef86167ec902037bbf54f4425d05a54f3cac 100644 (file)
@@ -144,11 +144,8 @@ void
 burn_away_slime()
 {
        if (Slimed) {
-           pline_The("slime that covers you is burned away!");
-           Slimed = 0L;
-           context.botl = 1;
+           make_slimed(0L, "The slime that covers you is burned away!");
        }
-       return;
 }
 
 
@@ -156,6 +153,7 @@ void
 nh_timeout()
 {
        register struct prop *upp;
+       struct kinfo *kptr;
        int sleeptime;
        int m_idx;
        int baseluck = (flags.moonphase == FULL_MOON) ? 1 : 0;
@@ -211,29 +209,28 @@ nh_timeout()
 
        for(upp = u.uprops; upp < u.uprops+SIZE(u.uprops); upp++)
            if((upp->intrinsic & TIMEOUT) && !(--upp->intrinsic & TIMEOUT)) {
+               kptr = find_delayed_killer(upp - u.uprops);
                switch(upp - u.uprops){
                case STONED:
-                       if (delayed_killer && !killer) {
-                               killer = delayed_killer;
-                               delayed_killer = 0;
-                       }
-                       if (!killer) {
-                               /* leaving killer_format would make it
-                                  "petrified by petrification" */
-                               killer_format = NO_KILLER_PREFIX;
-                               killer = "killed by petrification";
+                       if (kptr && kptr->name[0]) {
+                           killer.format = kptr->format;
+                           Strcpy(killer.name, kptr->name);
+                       } else {
+                           killer.format = NO_KILLER_PREFIX;
+                           Strcpy(killer.name, "killed by petrification");
                        }
+                       dealloc_killer(kptr);
                        done(STONING);
                        break;
                case SLIMED:
-                       if (delayed_killer && !killer) {
-                               killer = delayed_killer;
-                               delayed_killer = 0;
-                       }
-                       if (!killer) {
-                               killer_format = NO_KILLER_PREFIX;
-                               killer = "turned into green slime";
+                       if (kptr && kptr->name[0]) {
+                           killer.format = kptr->format;
+                           Strcpy(killer.name, kptr->name);
+                       } else {
+                           killer.format = NO_KILLER_PREFIX;
+                           Strcpy(killer.name, "turned into green slime");
                        }
+                       dealloc_killer(kptr);
                        done(TURNED_SLIME);
                        break;
                case VOMITING:
@@ -241,15 +238,21 @@ nh_timeout()
                        break;
                case SICK:
                        You("die from your illness.");
-                       killer_format = KILLED_BY_AN;
-                       killer = u.usick_cause;
-                       if ((m_idx = name_to_mon(killer)) >= LOW_PM) {
+                       if (kptr && kptr->name[0]) {
+                           killer.format = kptr->format;
+                           Strcpy(killer.name, kptr->name);
+                       } else {
+                           killer.format = KILLED_BY_AN;
+                           killer.name[0] = 0; /* take the default */
+                       }
+                       dealloc_killer(kptr);
+
+                       if ((m_idx = name_to_mon(killer.name)) >= LOW_PM) {
                            if (type_is_pname(&mons[m_idx])) {
-                               killer_format = KILLED_BY;
+                               killer.format = KILLED_BY;
                            } else if (mons[m_idx].geno & G_UNIQ) {
-                               killer = the(killer);
-                               Strcpy(u.usick_cause, killer);
-                               killer_format = KILLED_BY;
+                               Strcpy(killer.name, the(killer.name));
+                               killer.format = KILLED_BY;
                            }
                        }
                        u.usick_type = 0;
@@ -318,8 +321,9 @@ nh_timeout()
                        (void) float_down(I_SPECIAL|TIMEOUT, 0L);
                        break;
                case STRANGLED:
-                       killer_format = KILLED_BY;
-                       killer = (u.uburied) ? "suffocation" : "strangulation";
+                       killer.format = KILLED_BY;
+                       Strcpy(killer.name,
+                              (u.uburied) ? "suffocation" : "strangulation");
                        done(DIED);
                        break;
                case FUMBLING:
index 19a04884a4daa1d2b926bbb80493491b741ffd2d..9c95c9081446cf99bf7d47971a8b9b3e79cebd46 100644 (file)
@@ -315,20 +315,20 @@ int how;
        (void) strncpy(t0->name, plname, NAMSZ);
        t0->name[NAMSZ] = '\0';
        t0->death[0] = '\0';
-       switch (killer_format) {
+       switch (killer.format) {
                default: impossible("bad killer format?");
                case KILLED_BY_AN:
                        Strcat(t0->death, killed_by_prefix[how]);
-                       (void) strncat(t0->death, an(killer),
+                       (void) strncat(t0->death, an(killer.name),
                                                DTHSZ-strlen(t0->death));
                        break;
                case KILLED_BY:
                        Strcat(t0->death, killed_by_prefix[how]);
-                       (void) strncat(t0->death, killer,
+                       (void) strncat(t0->death, killer.name,
                                                DTHSZ-strlen(t0->death));
                        break;
                case NO_KILLER_PREFIX:
-                       (void) strncat(t0->death, killer, DTHSZ);
+                       (void) strncat(t0->death, killer.name, DTHSZ);
                        break;
        }
        t0->birthdate = yyyymmdd(u.ubirthday);
index 45c918795eecf8c9f1de39ebe1802668c7131839..c5ac3ece052c3397bbb824b7b2204d1263b3be74 100644 (file)
@@ -2137,8 +2137,8 @@ const char *str;
        if (poly_when_stoned(youmonst.data) && polymon(PM_STONE_GOLEM))
            return;
        You("turn to stone...");
-       killer_format = KILLED_BY;
-       killer = str;
+       killer.format = KILLED_BY;
+       if (str != killer.name) Strcpy(killer.name, str ? str : "");
        done(STONING);
 }
 
@@ -2902,9 +2902,10 @@ drown()
        }
        u.uinwater = 1;
        You("drown.");
-       killer_format = KILLED_BY_AN;
-       killer = (levl[u.ux][u.uy].typ == POOL || Is_medusa_level(&u.uz)) ?
-           "pool of water" : "moat";
+       killer.format = KILLED_BY_AN;
+       Strcpy(killer.name,
+              (levl[u.ux][u.uy].typ == POOL || Is_medusa_level(&u.uz)) ?
+              "pool of water" : "moat");
        done(DROWNING);
        /* oops, we're still alive.  better get out of the water. */
        while (!safe_teleds(TRUE)) {
@@ -3924,8 +3925,8 @@ lava_effects()
 
        /* s/he died... */
        u.uhp = -1;
-       killer_format = KILLED_BY;
-       killer = lava_killer;
+       killer.format = KILLED_BY;
+       Strcpy(killer.name, lava_killer);
        You("burn to a crisp...");
        done(BURNING);
        while (!safe_teleds(TRUE)) {
index c982a08ce0c0412c0c99d89034156ea22e81f0b8..8c27ef9226417f0b7bb493ceab1d070792908fa7 100644 (file)
@@ -1519,7 +1519,7 @@ register struct attack *mattk;
                    if (!Unchanging && mdef->data == &mons[PM_GREEN_SLIME]) {
                        if (!Slimed) {
                            You("suck in some slime and don't feel very well.");
-                           Slimed = 10L;
+                           make_slimed(10L, (char*) 0);
                        }
                    }
                    break;
@@ -1536,8 +1536,7 @@ register struct attack *mattk;
                u.uconduct.food++;
                if (touch_petrifies(mdef->data) && !Stone_resistance && !Stoned) {
                    Stoned = 5;
-                   killer_format = KILLED_BY_AN;
-                   delayed_killer = mdef->data->mname;
+                   delayed_killer(STONED, KILLED_BY_AN, mdef->data->mname);
                }
                if (!vegan(mdef->data))
                    u.uconduct.unvegan++;
@@ -1765,10 +1764,9 @@ register struct attack *mattk;
                        if (is_rider(mdef->data)) {
                         pline("Unfortunately, digesting any of it is fatal.");
                            end_engulf();
-                           Sprintf(msgbuf, "unwisely tried to eat %s",
+                           Sprintf(killer.name, "unwisely tried to eat %s",
                                    mdef->data->mname);
-                           killer = msgbuf;
-                           killer_format = NO_KILLER_PREFIX;
+                           killer.format = NO_KILLER_PREFIX;
                            done(DIED);
                            return 0;           /* lifesaved */
                        }
@@ -1818,8 +1816,7 @@ register struct attack *mattk;
                                Sprintf(msgbuf, "%s isn't sitting well with you.",
                                        The(mdef->data->mname));
                                if (!Unchanging) {
-                                       Slimed = 5L;
-                                       context.botl = 1;
+                                   make_slimed(5L, (char*) 0);
                                }
                            } else
                            exercise(A_CON, TRUE);
index 587af1d121f56011e8e67187f39ca6e8a9830676..7b1879110f28b1200724e85ea9414bf87b37d33a 100644 (file)
--- a/src/zap.c
+++ b/src/zap.c
@@ -1852,7 +1852,6 @@ struct obj *obj;
 boolean ordinary;
 {
        int     damage = 0;
-       char buf[BUFSZ];
 
        switch(obj->otyp) {
                case WAN_STRIKING:
@@ -2030,9 +2029,8 @@ boolean ordinary;
                          : "You seem no deader than before.");
                        break;
                    }
-                   Sprintf(buf, "shot %sself with a death ray", uhim());
-                   killer = buf;
-                   killer_format = NO_KILLER_PREFIX;
+                   Sprintf(killer.name,"shot %sself with a death ray",uhim());
+                   killer.format = NO_KILLER_PREFIX;
                    You("irradiate yourself with pure energy!");
                    You("die.");
                    makeknown(obj->otyp);
@@ -3110,8 +3108,8 @@ xchar sx, sy;
                You("aren't affected.");
                break;
            }
-           killer_format = KILLED_BY_AN;
-           killer = fltxt;
+           killer.format = KILLED_BY_AN;
+           Strcpy(killer.name, fltxt ? fltxt : "");
            /* when killed by disintegration breath, don't leave corpse */
            u.ugrave_arise = (type == -ZT_BREATH(ZT_DEATH)) ? -3 : NON_PM;
            done(DIED);
index 2537d8808bcf8b9d18f0ec3d07be2988bbe933b4..2818d7fce6b0fcedab5cae4d499f9085ce352456 100644 (file)
@@ -1063,7 +1063,7 @@ $(O)dungeon.o:  $(NHS)dungeon.c $(HDEP) $(I)dgn_file.h $(I)dlb.h
 
 $(O)eat.o:  $(NHS)eat.c $(HDEP)
 
-$(O)end.o:  $(NHS)end.c $(HDEP) $(I)eshk.h $(I)dlb.h
+$(O)end.o:  $(NHS)end.c $(HDEP) $(I)eshk.h $(I)lev.h $(I)dlb.h
 
 $(O)engrave.o:  $(NHS)engrave.c $(HDEP) $(I)lev.h
 
index b9e830a6ab2357c1b2be3fcfdcff54f5d77e7cfc..21d31761eb3e6bd15c3f11d80ffddb730c11d23f 100644 (file)
@@ -1396,7 +1396,7 @@ $(O)dungeon.o:  $(NHS)dungeon.c $(HDEP) $(I)dgn_file.h $(I)dlb.h
 
 $(O)eat.o:  $(NHS)eat.c $(HDEP)
 
-$(O)end.o:  $(NHS)end.c $(HDEP) $(I)eshk.h $(I)dlb.h
+$(O)end.o:  $(NHS)end.c $(HDEP) $(I)eshk.h $(I)lev.h $(I)dlb.h
 
 $(O)engrave.o:  $(NHS)engrave.c $(HDEP) $(I)lev.h
 
index c41110a4faddd83e1ace14d8c74b1f79d19988f7..66fe866600c1c2ea6a1f24a7bbe5b449bf03d7bb 100644 (file)
@@ -152,19 +152,19 @@ int how;
     BltBitMap(*tbmp, 0, 0, rp->BitMap, xoff, yoff, tomb_bmhd.w, tomb_bmhd.h, 0xc0, 0xff, NULL);
 
     /* Put together death description */
-    switch (killer_format) {
+    switch (killer.format) {
     default:
        impossible("bad killer format?");
     case KILLED_BY_AN:
        Strcpy(buf, killed_by_prefix[how]);
-       Strcat(buf, an(killer));
+       Strcat(buf, an(killer.name));
        break;
     case KILLED_BY:
        Strcpy(buf, killed_by_prefix[how]);
-       Strcat(buf, killer);
+       Strcat(buf, killer.name);
        break;
     case NO_KILLER_PREFIX:
-       Strcpy(buf, killer);
+       Strcpy(buf, killer.name);
        break;
     }
 
@@ -205,19 +205,19 @@ int how;
     tomb_text(buf);
 
     /* Put together death description */
-    switch (killer_format) {
+    switch (killer.format) {
     default:
        impossible("bad killer format?");
     case KILLED_BY_AN:
        Strcpy(buf, killed_by_prefix[how]);
-       Strcat(buf, an(killer));
+       Strcat(buf, an(killer.name));
        break;
     case KILLED_BY:
        Strcpy(buf, killed_by_prefix[how]);
-       Strcat(buf, killer);
+       Strcat(buf, killer.name);
        break;
     case NO_KILLER_PREFIX:
-       Strcpy(buf, killer);
+       Strcpy(buf, killer.name);
        break;
     }
 
index a54f454e7b2b2d80b8f62f17fcf17f375f98b4ea..8b2f62bc495cd11ea91b5409de446c85770efea5 100644 (file)
@@ -1200,7 +1200,7 @@ mac_destroy_nhwindow (winid win) {
        }
        if (win == WIN_INVEN || win == WIN_MESSAGE) {
                if (iflags.window_inited) {
-                       if (flags.tombstone && killer) {
+                       if (flags.tombstone && killer.name[0]) {
                                /* Prepare for the coming of the tombstone window. */
                                win_fonts [NHW_TEXT] = kFontIDMonaco;
                        }
index e78ce3c47904a11659efa835e7dbc9bc60e8185f..53e8b9472c62f1b0a096bf22f30308fe8408378a 100644 (file)
@@ -1814,7 +1814,7 @@ $(O)drawing.o:   $(SRC)\drawing.c  $(HACK_H) $(TERMCAP_H)
        @echo $(BCOPTS1) >> $(VROOMMCFG)
        @echo $(BCOPTS2) >> $(VROOMMCFG)
        $(CC) $(CFLAGSN) $(COBJNAM)$@ $(SRC)\drawing.c
-$(O)end.o:       $(SRC)\end.c      $(HACK_H) $(ESHK_H) $(DLB_H)
+$(O)end.o:       $(SRC)\end.c      $(HACK_H) $(ESHK_H) $(LEV_H) $(DLB_H)
        @type schema$(SCHEMA).bc | find "$(@B)_o" > $(VROOMMCFG)
        @echo $(BCOPTS1) >> $(VROOMMCFG)
        @echo $(BCOPTS2) >> $(VROOMMCFG)
index 5e67522438195d2bad5fe1856b6c7805e8fec41c..5af3e15d7d41551193d26515e980a1a995057eaa 100644 (file)
@@ -1166,7 +1166,7 @@ $(O)dothrow.o: dothrow.c $(HACK_H)
 $(O)drawing.o: drawing.c $(HACK_H) $(INCL)/tcap.h
 $(O)dungeon.o: dungeon.c $(HACK_H) $(INCL)/dgn_file.h $(INCL)/dlb.h
 $(O)eat.o: eat.c $(HACK_H)
-$(O)end.o: end.c $(HACK_H) $(INCL)/eshk.h $(INCL)/dlb.h
+$(O)end.o: end.c $(HACK_H) $(INCL)/eshk.h $(INCL)/lev.h $(INCL)/dlb.h
 $(O)engrave.o: engrave.c $(HACK_H) $(INCL)/lev.h
 $(O)exper.o: exper.c $(HACK_H)
 $(O)explode.o: explode.c $(HACK_H)
index 7984dedaa8cb7a6849fe4e3db649a1101bf06094..29f4a9999352aec0f08927acdb2d82e95cb02568 100644 (file)
@@ -1020,7 +1020,7 @@ dothrow.o: dothrow.c $(HACK_H)
 drawing.o: drawing.c $(HACK_H) $(INCL)\tcap.h
 dungeon.o: dungeon.c $(HACK_H) $(INCL)\dgn_file.h $(INCL)\dlb.h
 eat.o: eat.c $(HACK_H)
-end.o: end.c $(HACK_H) $(INCL)\eshk.h $(INCL)\dlb.h
+end.o: end.c $(HACK_H) $(INCL)\eshk.h $(INCL)\lev.h $(INCL)\dlb.h
 engrave.o: engrave.c $(HACK_H) $(INCL)\lev.h
 exper.o: exper.c $(HACK_H)
 explode.o: explode.c $(HACK_H)
index 18ae59e012a5c8f126b0883af3af9020cef55e9e..6f2743b8d1421218e317effa5e6bdf023edd486d 100644 (file)
@@ -1550,7 +1550,7 @@ $(OBJ)\dungeon.o  : $(SRC)\$(CB) $(HACK_H) $(INCL)\dgn_file.h
        $(SRCCC)
 $(OBJ)\eat.o      : $(SRC)\$(CB) $(HACK_H)
        $(SRCCC)
-$(OBJ)\end.o      : $(SRC)\$(CB) $(HACK_H) $(INCL)\eshk.h
+$(OBJ)\end.o      : $(SRC)\$(CB) $(HACK_H) $(INCL)\eshk.h $(INCL)\lev.h
        $(SRCCC)
 $(OBJ)\engrave.o  : $(SRC)\$(CB) $(HACK_H) $(INCL)\lev.h
        $(SRCCC)
index e7687978bb0738d1d3a57d732822988a9691e40a..172455fa1ac9f5eff50caa87571911087de12116 100644 (file)
@@ -719,7 +719,7 @@ dothrow.o: dothrow.c $(HACK_H)
 drawing.o: drawing.c $(HACK_H) ../include/tcap.h
 dungeon.o: dungeon.c $(HACK_H) ../include/dgn_file.h ../include/dlb.h
 eat.o: eat.c $(HACK_H)
-end.o: end.c $(HACK_H) ../include/eshk.h ../include/dlb.h
+end.o: end.c $(HACK_H) ../include/eshk.h ../include/lev.h ../include/dlb.h
 engrave.o: engrave.c $(HACK_H) ../include/lev.h
 exper.o: exper.c $(HACK_H)
 explode.o: explode.c $(HACK_H)
index b5360a3744269e48800c975770946ac7479bebbe..3a105e31ae8a42ff2d8c3c899490b3eb6499d474 100644 (file)
@@ -372,7 +372,7 @@ dothrow.obj :       dothrow.c $(HACK_H)
 drawing.obj :  drawing.c $(HACK_H) $(INC)tcap.h
 dungeon.obj :  dungeon.c $(HACK_H) $(INC)dgn_file.h $(INC)dlb.h
 eat.obj :      eat.c $(HACK_H)
-end.obj :      end.c $(HACK_H) $(INC)eshk.h $(INC)dlb.h
+end.obj :      end.c $(HACK_H) $(INC)eshk.h $(INC)lev.h $(INC)dlb.h
 engrave.obj :  engrave.c $(HACK_H) $(INC)lev.h
 exper.obj :    exper.c $(HACK_H)
 explode.obj :  explode.c $(HACK_H)
index f04eac259fefe48c6bc5d76253de8a2b687776f8..4988c219c05811196c011878e23ac552a0c7e1de 100644 (file)
@@ -789,7 +789,7 @@ $(O)dothrow.o: $(SRC)\dothrow.c $(HACK_H)
 $(O)drawing.o: $(SRC)\drawing.c $(HACK_H) $(INCL)\tcap.h
 $(O)dungeon.o: $(SRC)\dungeon.c $(HACK_H) $(INCL)\dgn_file.h $(INCL)\dlb.h
 $(O)eat.o: $(SRC)\eat.c $(HACK_H)
-$(O)end.o: $(SRC)\end.c $(HACK_H) $(INCL)\eshk.h $(INCL)\dlb.h
+$(O)end.o: $(SRC)\end.c $(HACK_H) $(INCL)\eshk.h $(INCL)\lev.h $(INCL)\dlb.h
 $(O)engrave.o: $(SRC)\engrave.c $(HACK_H) $(INCL)\lev.h
 $(O)exper.o: $(SRC)\exper.c $(HACK_H)
 $(O)explode.o: $(SRC)\explode.c $(HACK_H)
index 4a2e80389a165f7676ebb9b8fae0ed95c30705f5..417006636a58e64c5d527530f3f9869442c24c66 100644 (file)
@@ -1284,7 +1284,7 @@ $(O)dothrow.o: dothrow.c $(HACK_H)
 $(O)drawing.o: drawing.c $(HACK_H) $(INCL)\tcap.h
 $(O)dungeon.o: dungeon.c $(HACK_H) $(INCL)\dgn_file.h $(INCL)\dlb.h
 $(O)eat.o: eat.c $(HACK_H)
-$(O)end.o: end.c $(HACK_H) $(INCL)\eshk.h $(INCL)\dlb.h
+$(O)end.o: end.c $(HACK_H) $(INCL)\eshk.h $(INCL)\lev.h $(INCL)\dlb.h
 $(O)engrave.o: engrave.c $(HACK_H) $(INCL)\lev.h
 $(O)exper.o: exper.c $(HACK_H)
 $(O)explode.o: explode.c $(HACK_H)
index 428289f0a003766ea5aaa60b80a6c676d96ecc79..d7885b6be0f8d526e6a6052e64a64b670aa938a6 100644 (file)
@@ -1258,7 +1258,7 @@ $(O)dothrow.o: dothrow.c $(HACK_H)
 $(O)drawing.o: drawing.c $(HACK_H) $(INCL)/tcap.h
 $(O)dungeon.o: dungeon.c $(HACK_H) $(INCL)/dgn_file.h $(INCL)/dlb.h
 $(O)eat.o: eat.c $(HACK_H)
-$(O)end.o: end.c $(HACK_H) $(INCL)/eshk.h $(INCL)/dlb.h
+$(O)end.o: end.c $(HACK_H) $(INCL)/eshk.h $(INCL)/lev.h $(INCL)/dlb.h
 $(O)engrave.o: engrave.c $(HACK_H) $(INCL)/lev.h
 $(O)exper.o: exper.c $(HACK_H)
 $(O)explode.o: explode.c $(HACK_H)
index df98d18cc86555d3ecaece42f0c4b0e63f54c83a..237c69ce78171e9fde2ad2fc14c304368d9a07ca 100644 (file)
@@ -1325,7 +1325,7 @@ $(O)dothrow.o: dothrow.c $(HACK_H)
 $(O)drawing.o: drawing.c $(HACK_H) $(INCL)\tcap.h
 $(O)dungeon.o: dungeon.c $(HACK_H) $(INCL)\dgn_file.h $(INCL)\dlb.h
 $(O)eat.o: eat.c $(HACK_H)
-$(O)end.o: end.c $(HACK_H) $(INCL)\eshk.h $(INCL)\dlb.h
+$(O)end.o: end.c $(HACK_H) $(INCL)\eshk.h $(INCL)\lev.h $(INCL)\dlb.h
 $(O)engrave.o: engrave.c $(HACK_H) $(INCL)\lev.h
 $(O)exper.o: exper.c $(HACK_H)
 $(O)explode.o: explode.c $(HACK_H)
index 7fcafb9e46d57e0ea5a779440e5cb7a1e8128aab..89af564f5f5f8e87c40b8068256220d16e6d1427 100644 (file)
@@ -3311,18 +3311,18 @@ static char** rip_line=0;
 #endif
 
     /* Put together death description */
-    switch (killer_format) {
+    switch (killer.format) {
        default: impossible("bad killer format?");
        case KILLED_BY_AN:
            Strcpy(buf, killed_by_prefix[how]);
-           Strcat(buf, an(killer));
+           Strcat(buf, an(killer.name));
            break;
        case KILLED_BY:
            Strcpy(buf, killed_by_prefix[how]);
-           Strcat(buf, killer);
+           Strcat(buf, killer.name);
            break;
        case NO_KILLER_PREFIX:
-           Strcpy(buf, killer);
+           Strcpy(buf, killer.name);
            break;
     }
 
index 84cafe6fa49ef51c123ccdc4b30a9d4bdec6a50d..cfadefcc126f616787aff62e9c7cdc8bd68a6f04 100644 (file)
@@ -290,7 +290,7 @@ create_text_window(wp)
                XtParseTranslationTable(text_translations));    num_args++;
 
     wp->w = XtCreateManagedWidget(
-               killer && WIN_MAP == WIN_ERR ?
+               killer.name[0] && WIN_MAP == WIN_ERR ?
                                  "tombstone" : "text_text", /* name */
                asciiTextWidgetClass,
                form,                   /* parent widget */
@@ -474,18 +474,18 @@ calculate_rip_text(int how)
                done_money);
 #endif
        /* Put together death description */
-       switch (killer_format) {
+       switch (killer.format) {
                default: impossible("bad killer format?");
                case KILLED_BY_AN:
                        Strcpy(buf, killed_by_prefix[how]);
-                       Strcat(buf, an(killer));
+                       Strcat(buf, an(killer.name));
                        break;
                case KILLED_BY:
                        Strcpy(buf, killed_by_prefix[how]);
-                       Strcat(buf, killer);
+                       Strcat(buf, killer.name);
                        break;
                case NO_KILLER_PREFIX:
-                       Strcpy(buf, killer);
+                       Strcpy(buf, killer.name);
                        break;
        }
 
index ceb59d71aa82c35a74538088eb798c07be4db67d..2a5ab652930ac9e57a3283417b57c5e7049e3cd0 100644 (file)
@@ -1083,18 +1083,18 @@ int how;
                done_money);
 #endif
        /* Put together death description */
-       switch (killer_format) {
+       switch (killer.format) {
        default: impossible("bad killer format?");
        case KILLED_BY_AN:
                Strcpy(buf, killed_by_prefix[how]);
-               Strcat(buf, an(killer));
+               Strcat(buf, an(killer.name));
                break;
        case KILLED_BY:
                Strcpy(buf, killed_by_prefix[how]);
-               Strcat(buf, killer);
+               Strcat(buf, killer.name);
                break;
        case NO_KILLER_PREFIX:
-               Strcpy(buf, killer);
+               Strcpy(buf, killer.name);
                break;
        }
        /* Put death type on stone */
index 185090ddd6c475b317435c3b03711d5b890a495d..c3a8f98a0817ad2e35ae6533581af7fb797300c8 100644 (file)
@@ -1170,18 +1170,18 @@ void gnome_outrip(winid wid, int how)
     Strcat(ripString, buf);
 
     /* Put together death description */
-    switch (killer_format) {
+    switch (killer.format) {
            default: impossible("bad killer format?");
            case KILLED_BY_AN:
                    Strcpy(buf, killed_by_prefix[how]);
-                   Strcat(buf, an(killer));
+                   Strcat(buf, an(killer.name));
                    break;
            case KILLED_BY:
                    Strcpy(buf, killed_by_prefix[how]);
-                   Strcat(buf, killer);
+                   Strcat(buf, killer.name);
                    break;
            case NO_KILLER_PREFIX:
-                   Strcpy(buf, killer);
+                   Strcpy(buf, killer.name);
                    break;
     }
     /* Put death type on stone */
index bc020a23a2c841e267ed37a1f538f89b8d5d1e9b..c0a8be40c99a1eaa38a713abf95f0cd03556d1f2 100644 (file)
@@ -1783,18 +1783,18 @@ void mswin_outrip(winid wid, int how)
        putstr(wid, 0, buf);
 
        /* Put together death description */
-       switch (killer_format) {
+       switch (killer.format) {
                default: impossible("bad killer format?");
                case KILLED_BY_AN:
                        Strcpy(buf, killed_by_prefix[how]);
-                       Strcat(buf, an(killer));
+                       Strcat(buf, an(killer.name));
                        break;
                case KILLED_BY:
                        Strcpy(buf, killed_by_prefix[how]);
-                       Strcat(buf, killer);
+                       Strcat(buf, killer.name);
                        break;
                case NO_KILLER_PREFIX:
-                       Strcpy(buf, killer);
+                       Strcpy(buf, killer.name);
                        break;
        }