conflicting delayed killers

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
This commit is contained in:
cohrs
2003-09-29 19:24:20 +00:00
parent a89fa75f4c
commit 559be58c21
54 changed files with 430 additions and 349 deletions

View 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 */