// Deathtypes (weapon deathtypes are the IT_* constants below)
// NOTE: when adding death types, please add an explanation to Docs/spamlog.txt too.
#define VAR_TO_TEXT2(var) #var
+#define CHECK_FIRST_OR_LAST(input,first,count) if(input) { input = (first + count); }
#define CHECK_FIELD_COUNT(field,first,count) if(!field) { field = (first + count); ++count; }
#define CHECK_MAX_DEATHTYPES(name,count) if(count == DT_MAX) { error(strcat("Maximum deathtypes hit: ", VAR_TO_TEXT2(name), ": ", ftos(count), ".\n")); }
#define DT_MAX 1024 // limit of recursive functions with ACCUMULATE_FUNCTION
float DT_COUNT;
-#define DEATHTYPE(name,type,notification) \
+float DEATH_VHFIRST = DT_FIRST;
+float DEATH_VHLAST = DT_FIRST;
+
+#define DEATHTYPE(name,type,notification,first,last) \
float name; \
+ float first; \
+ float last; \
void DecDeathtype_##name() \
{ \
+ CHECK_FIRST_OR_LAST(first, DT_FIRST, DT_COUNT) \
+ CHECK_FIRST_OR_LAST(last, DT_FIRST, DT_COUNT) \
CHECK_FIELD_COUNT(name, DT_FIRST, DT_COUNT) \
CHECK_MAX_DEATHTYPES(name, DT_COUNT) \
}
//ACCUMULATE_FUNCTION(DecDeathtypes, DecDeathtype_##name)
#define DEATHTYPES \
- DEATHTYPE(DEATH_SPECIAL_START, MSG_CENTER, FALSE) \
+ DEATHTYPE(DEATH_FALL, FALSE, FALSE, DEATH_SPECIAL_START, FALSE) \
+ DEATHTYPE(DEATH_TELEFRAG, FALSE, FALSE, FALSE, FALSE) \
+ DEATHTYPE(DEATH_DROWN, FALSE, FALSE, FALSE, FALSE) \
+ DEATHTYPE(DEATH_HURTTRIGGER, FALSE, FALSE, FALSE, FALSE) \
+ DEATHTYPE(DEATH_LAVA, FALSE, FALSE, FALSE, FALSE) \
+ DEATHTYPE(DEATH_SLIME, FALSE, FALSE, FALSE, FALSE) \
+ DEATHTYPE(DEATH_KILL, FALSE, FALSE, FALSE, FALSE) \
+ DEATHTYPE(DEATH_NOAMMO, FALSE, FALSE, FALSE, FALSE) \
+ DEATHTYPE(DEATH_SWAMP, FALSE, FALSE, FALSE, FALSE) \
+ DEATHTYPE(DEATH_TEAMCHANGE, FALSE, FALSE, FALSE, FALSE) \
+ DEATHTYPE(DEATH_AUTOTEAMCHANGE, FALSE, FALSE, FALSE, FALSE) \
+ DEATHTYPE(DEATH_CAMP, FALSE, FALSE, FALSE, FALSE) \
+ DEATHTYPE(DEATH_SHOOTING_STAR, FALSE, FALSE, FALSE, FALSE) \
+ DEATHTYPE(DEATH_ROT, FALSE, FALSE, FALSE, FALSE) \
+ DEATHTYPE(DEATH_MIRRORDAMAGE, FALSE, FALSE, FALSE, FALSE) \
+ DEATHTYPE(DEATH_TOUCHEXPLODE, FALSE, FALSE, FALSE, FALSE) \
+ DEATHTYPE(DEATH_CHEAT, FALSE, FALSE, FALSE, FALSE) \
+ DEATHTYPE(DEATH_FIRE, FALSE, FALSE, FALSE, FALSE) \
+ DEATHTYPE(DEATH_QUIET, FALSE, FALSE, FALSE, FALSE) \
#undef DEATHTYPE
DEATHTYPES
-float DEATH_SPECIAL_START = 10000;
-float DEATH_FALL = 10000;
-float DEATH_TELEFRAG = 10001;
-float DEATH_DROWN = 10002;
-float DEATH_HURTTRIGGER = 10003;
-float DEATH_LAVA = 10004;
-float DEATH_SLIME = 10005;
-float DEATH_KILL = 10006;
-float DEATH_NOAMMO = 10007;
-float DEATH_SWAMP = 10008;
-float DEATH_TEAMCHANGE = 10009;
-float DEATH_AUTOTEAMCHANGE = 10010;
-float DEATH_CAMP = 10011;
-float DEATH_SHOOTING_STAR = 10012;
-float DEATH_ROT = 10013;
-float DEATH_MIRRORDAMAGE = 10014;
-float DEATH_TOUCHEXPLODE = 10015;
-float DEATH_CHEAT = 10016;
-float DEATH_FIRE = 10017;
-float DEATH_QUIET = 10021;
-
-float DEATH_VHFIRST = 10030;
float DEATH_VHCRUSH = 10030;
float DEATH_SBMINIGUN = 10031;
float DEATH_SBROCKET = 10032;
float DEATH_BUMB_RAY = 10042;
float DEATH_BUMB_RAY_HEAL = 10043;
float DEATH_BUMB_DEATH = 10044;
-float DEATH_VHLAST = 10044;
#define DEATH_ISVEHICLE(t) ((t) >= DEATH_VHFIRST && (t) <= DEATH_VHLAST)
float DEATH_GENERIC = 10050;