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[];
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 ### */
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);
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
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) {
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;
/* 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);
}
{
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 */
/* 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)
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;
}
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 :
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 */
}
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);
}
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 */
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.");
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:
{
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);
}
}
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);
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);
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.
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);
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)
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 */
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:
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 " : "");
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);
}
}
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;
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;
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;
}
#include "hack.h"
#include "eshk.h"
+#include "lev.h"
#ifndef NO_SIGNAL
#include <signal.h>
#endif
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 ");
} 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)
}
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)
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) {
#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)) {
if (how == GENOCIDED)
pline("Unfortunately you are still genocided...");
else {
- killer = 0;
- killer_format = 0;
+ killer.name[0] = 0;
+ killer.format = 0;
return;
}
}
(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;
}
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 */
} 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 */
}
}
}
+/* 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*/
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;
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;
}
if (olet == MON_EXPLODE) {
- str = killer;
- killer = 0; /* set again later as needed */
+ str = killer.name;
adtyp = AD_PHYS;
} else
switch (abs(type) % 10) {
} 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);
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) {
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 {
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++;
}
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); */
!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.");
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;
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;
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;
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;
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);
}
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);
}
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);
}
}
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();
(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);
}
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;
} 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 */
(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();
You("turn to stone!");
mntmp = PM_STONE_GOLEM;
Stoned = 0;
- delayed_killer = 0;
+ dealloc_killer(find_delayed_killer(STONED));
}
u.mtimedone = rn1(500, 500);
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) {
}
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;
{
/* 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);
}
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");
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);
}
}
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
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) {
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);
}
}
}
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;
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();
}
}
/* 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);
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);
}
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;
}
HUP pline("%s", whynot);
(void) close(fd);
(void) delete_savefile();
- HUP killer = whynot;
+ HUP Strcpy(killer.name, whynot);
HUP done(TRICKED);
return(0);
}
}
#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);
if (fd < 0) {
pline("%s", whynot);
pline("Probably someone removed it.");
- killer = whynot;
+ Strcpy(killer.name, whynot);
done(TRICKED);
return;
}
"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);
fd = create_levelfile(0, whynot);
if (fd < 0) {
pline("%s", whynot);
- killer = whynot;
+ Strcpy(killer.name, whynot);
done(TRICKED);
return;
}
# 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)
freedamage();
/* game-state data */
+ free_killers();
free_timers(RANGE_GLOBAL);
free_light_sources(RANGE_GLOBAL);
freeobjchn(invent);
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:
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;
}
}
#endif
- killer = 0; /* still alive, so far... */
+ killer.name[0] = 0; /* still alive, so far... */
if (newlev < 0) {
if (*u.ushops0) {
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!) ");
} 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";
} 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 */
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;
}
nh_timeout()
{
register struct prop *upp;
+ struct kinfo *kptr;
int sleeptime;
int m_idx;
int baseluck = (flags.moonphase == FULL_MOON) ? 1 : 0;
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:
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;
(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:
(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);
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);
}
}
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)) {
/* 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)) {
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;
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++;
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 */
}
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);
boolean ordinary;
{
int damage = 0;
- char buf[BUFSZ];
switch(obj->otyp) {
case WAN_STRIKING:
: "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);
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);
$(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
$(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
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;
}
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;
}
}
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;
}
@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)
$(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)
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)
$(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)
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)
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)
$(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)
$(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)
$(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)
$(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)
#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;
}
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 */
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;
}
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 */
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 */
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;
}