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

@@ -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);