]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Deathtypes: port to registry
authorTimePath <andrew.hardaker1995@gmail.com>
Wed, 7 Oct 2015 10:24:33 +0000 (21:24 +1100)
committerTimePath <andrew.hardaker1995@gmail.com>
Wed, 7 Oct 2015 11:07:50 +0000 (22:07 +1100)
81 files changed:
qcsrc/client/damage.qc
qcsrc/client/hud.qc
qcsrc/client/main.qc
qcsrc/client/progs.inc
qcsrc/common/deathtypes.qh [deleted file]
qcsrc/common/deathtypes/all.inc [new file with mode: 0644]
qcsrc/common/deathtypes/all.qc [new file with mode: 0644]
qcsrc/common/deathtypes/all.qh [new file with mode: 0644]
qcsrc/common/monsters/monster/mage.qc
qcsrc/common/monsters/monster/shambler.qc
qcsrc/common/monsters/monster/spider.qc
qcsrc/common/monsters/monster/wyvern.qc
qcsrc/common/monsters/monster/zombie.qc
qcsrc/common/monsters/sv_monsters.qc
qcsrc/common/mutators/mutator/waypoints/waypointsprites.qc
qcsrc/common/notifications.qh
qcsrc/common/triggers/func/breakable.qc
qcsrc/common/triggers/func/door.qc
qcsrc/common/triggers/misc/laser.qc
qcsrc/common/triggers/platforms.qc
qcsrc/common/triggers/teleporters.qc
qcsrc/common/triggers/trigger/hurt.qc
qcsrc/common/triggers/trigger/swamp.qc
qcsrc/common/turrets/turret/ewheel_weapon.qc
qcsrc/common/turrets/turret/flac_weapon.qc
qcsrc/common/turrets/turret/hellion_weapon.qc
qcsrc/common/turrets/turret/hk_weapon.qc
qcsrc/common/turrets/turret/machinegun_weapon.qc
qcsrc/common/turrets/turret/mlrs_weapon.qc
qcsrc/common/turrets/turret/phaser_weapon.qc
qcsrc/common/turrets/turret/plasma.qc
qcsrc/common/turrets/turret/plasma_dual.qc
qcsrc/common/turrets/turret/plasma_weapon.qc
qcsrc/common/turrets/turret/tesla_weapon.qc
qcsrc/common/turrets/turret/walker.qc
qcsrc/common/turrets/turret/walker_weapon.qc
qcsrc/common/util-pre.qh
qcsrc/common/util.qc
qcsrc/common/vehicles/sv_vehicles.qc
qcsrc/common/vehicles/vehicle/bumblebee.qc
qcsrc/common/vehicles/vehicle/bumblebee_weapons.qc
qcsrc/common/vehicles/vehicle/racer.qc
qcsrc/common/vehicles/vehicle/racer_weapon.qc
qcsrc/common/vehicles/vehicle/raptor.qc
qcsrc/common/vehicles/vehicle/raptor_weapons.qc
qcsrc/common/vehicles/vehicle/spiderbot.qc
qcsrc/common/vehicles/vehicle/spiderbot_weapons.qc
qcsrc/common/weapons/all.qc
qcsrc/server/cheats.qc
qcsrc/server/cl_client.qc
qcsrc/server/cl_player.qc
qcsrc/server/command/cmd.qc
qcsrc/server/command/common.qc
qcsrc/server/g_damage.qc
qcsrc/server/g_damage.qh
qcsrc/server/g_world.qc
qcsrc/server/miscfunctions.qc
qcsrc/server/miscfunctions.qh
qcsrc/server/mutators/gamemode.qh
qcsrc/server/mutators/gamemode_ca.qc
qcsrc/server/mutators/gamemode_ctf.qc
qcsrc/server/mutators/gamemode_cts.qc
qcsrc/server/mutators/gamemode_freezetag.qc
qcsrc/server/mutators/gamemode_onslaught.qc
qcsrc/server/mutators/mutator.qh
qcsrc/server/mutators/mutator_bloodloss.qc
qcsrc/server/mutators/mutator_buffs.qc
qcsrc/server/mutators/mutator_campcheck.qc
qcsrc/server/mutators/mutator_instagib.qc
qcsrc/server/mutators/mutator_nades.qc
qcsrc/server/mutators/mutator_overkill.qc
qcsrc/server/mutators/mutator_rocketminsta.qc
qcsrc/server/mutators/mutator_touchexplode.qc
qcsrc/server/mutators/mutators_include.qc
qcsrc/server/portals.qc
qcsrc/server/progs.inc
qcsrc/server/race.qc
qcsrc/server/sv_main.qc
qcsrc/server/t_items.qc
qcsrc/server/teamplay.qc
qcsrc/server/weapons/common.qc

index 7ef7f996bd1e22f93a7c0d07b1650952bbf05974..94560a8332d214bd2223718d2ffcc4af0c18bd04 100644 (file)
@@ -6,7 +6,7 @@
 #include "../common/vehicles/all.qh"
 
 #include "../common/constants.qh"
-#include "../common/deathtypes.qh"
+#include "../common/deathtypes/all.qh"
 #include "../common/effects/effects.qh"
 #include "../common/movetypes/movetypes.qh"
 #include "../common/util.qh"
@@ -99,7 +99,7 @@ void DamageEffect(vector hitorg, float thedamage, int type, int specnum)
 
        life = bound(autocvar_cl_damageeffect_lifetime_min, thedamage * autocvar_cl_damageeffect_lifetime, autocvar_cl_damageeffect_lifetime_max);
 
-       effectname = get_weaponinfo(DEATH_WEAPONOF(type)).netname;
+       effectname = DEATH_WEAPONOF(type).netname;
 
        if(substring(effectname, strlen(effectname) - 5, 5) == "BLOOD")
        {
@@ -221,7 +221,7 @@ void Ent_DamageInfo(float isNew)
 
                setorigin(self, w_org + w_backoff * 2); // for sound() calls
 
-               switch(w_deathtype)
+               switch(DEATH_ENT(w_deathtype))
                {
                        case DEATH_VH_CRUSH:
                                break;
@@ -295,7 +295,7 @@ void Ent_DamageInfo(float isNew)
 
                setorigin(self, w_org + w_backoff * 2); // for sound() calls
 
-               switch(w_deathtype)
+               switch(DEATH_ENT(w_deathtype))
                {
                         case DEATH_TURRET_EWHEEL:
                                sound(self, CH_SHOTS, SND_LASERIMPACT, VOL_BASE, ATTEN_MIN);
@@ -345,18 +345,18 @@ void Ent_DamageInfo(float isNew)
        if(!DEATH_ISSPECIAL(w_deathtype))
        if(!hitplayer || rad) // don't show ground impacts for hitscan weapons if a player was hit
        {
-               int hitwep = DEATH_WEAPONOFWEAPONDEATH(w_deathtype);
+               Weapon hitwep = DEATH_WEAPONOF(w_deathtype);
                w_random = prandom();
 
                traceline(w_org - normalize(force) * 16, w_org + normalize(force) * 16, MOVE_NOMONSTERS, world);
-               if(trace_fraction < 1 && hitwep != WEP_VORTEX.m_id && hitwep != WEP_VAPORIZER.m_id)
+               if(trace_fraction < 1 && hitwep != WEP_VORTEX && hitwep != WEP_VAPORIZER)
                        w_backoff = trace_plane_normal;
                else
                        w_backoff = -1 * normalize(force);
                setorigin(self, w_org + w_backoff * 2); // for sound() calls
 
                if(!(trace_dphitq3surfaceflags & Q3SURFACEFLAG_SKY)) {
-                       Weapon w = get_weaponinfo(hitwep); w.wr_impacteffect(w);
+                       hitwep.wr_impacteffect(hitwep);
                }
        }
 }
index eb577f46bf02bfba42d26d5f5579ad1c391fe9e3..97119b881605e0af12b9bdd44c49892268db775f 100644 (file)
@@ -11,7 +11,7 @@
 
 #include "../common/buffs/all.qh"
 #include "../common/constants.qh"
-#include "../common/deathtypes.qh"
+#include "../common/deathtypes/all.qh"
 #include "../common/items/all.qc"
 #include "../common/mapinfo.qh"
 #include "../common/nades/all.qh"
@@ -1477,7 +1477,7 @@ void HUD_HealthArmor(void)
        if(autocvar_hud_panel_healtharmor == 2) // combined health and armor display
        {
                vector v;
-               v = healtharmor_maxdamage(health, armor, armorblockpercent, DEATH_WEAPON);
+               v = healtharmor_maxdamage(health, armor, armorblockpercent, DEATH_WEAPON.m_id);
 
                float x;
                x = floor(v.x + 1);
index bc3fb43d6820af3bee49ddf3aa1b9c2e029b3874..1138155021ae71c16c9bbc747beebdd8bb867fb4 100644 (file)
@@ -26,7 +26,7 @@
 #include "weapons/projectile.qh"
 
 #include "../common/buffs/all.qh"
-#include "../common/deathtypes.qh"
+#include "../common/deathtypes/all.qh"
 #include "../common/effects/effects.qh"
 #include "../common/mapinfo.qh"
 #include "../common/monsters/all.qh"
@@ -148,8 +148,6 @@ void CSQC_Init(void)
 
        // needs to be done so early because of the constants they create
        static_init();
-       CALL_ACCUMULATED_FUNCTION(RegisterNotifications);
-       CALL_ACCUMULATED_FUNCTION(RegisterDeathtypes);
        CALL_ACCUMULATED_FUNCTION(RegisterHUD_Panels);
 
        // precaches
index ec5c31844af9a57657c608ce25ad5efdce45e963..ec19dd5b2d3c3275fcfd0f23fb0b8335bd40c488 100644 (file)
@@ -52,6 +52,7 @@
 #include "../common/minigames/cl_minigames.qc"
 
 #include "../common/buffs/all.qc"
+#include "../common/deathtypes/all.qc"
 #include "../common/items/all.qc"
 #include "../common/monsters/all.qc"
 #include "../common/mutators/all.qc"
diff --git a/qcsrc/common/deathtypes.qh b/qcsrc/common/deathtypes.qh
deleted file mode 100644 (file)
index c1e8bd2..0000000
+++ /dev/null
@@ -1,139 +0,0 @@
-#ifndef DEATHTYPES_H
-#define DEATHTYPES_H
-
-#include "notifications.qh"
-
-// ================================
-//  Deathtypes, reworked by Samual
-// ================================
-
-int DEATH_SPECIAL_START;
-int NORMAL_POS;
-int DEATH_MONSTER_FIRST;
-int DEATH_MONSTER_LAST;
-int DEATH_TURRET_FIRST;
-int DEATH_TURRET_LAST;
-int DEATH_VHFIRST;
-int DEATH_VHLAST;
-
-#define DEATHTYPES \
-       DEATHTYPE(DEATH_AUTOTEAMCHANGE,         DEATH_SELF_AUTOTEAMCHANGE,          NO_MSG,                        DEATH_SPECIAL_START) \
-       DEATHTYPE(DEATH_BUFF,                   NO_MSG,                             DEATH_MURDER_BUFF,             NORMAL_POS) \
-       DEATHTYPE(DEATH_CAMP,                   DEATH_SELF_CAMP,                    NO_MSG,                        NORMAL_POS) \
-       DEATHTYPE(DEATH_CHEAT,                  DEATH_SELF_CHEAT,                   DEATH_MURDER_CHEAT,            NORMAL_POS) \
-       DEATHTYPE(DEATH_CUSTOM,                 DEATH_SELF_CUSTOM,                  NO_MSG,                        NORMAL_POS) \
-       DEATHTYPE(DEATH_DROWN,                  DEATH_SELF_DROWN,                   DEATH_MURDER_DROWN,            NORMAL_POS) \
-       DEATHTYPE(DEATH_FALL,                   DEATH_SELF_FALL,                    DEATH_MURDER_FALL,             NORMAL_POS) \
-       DEATHTYPE(DEATH_FIRE,                   DEATH_SELF_FIRE,                    DEATH_MURDER_FIRE,             NORMAL_POS) \
-       DEATHTYPE(DEATH_GENERIC,                DEATH_SELF_GENERIC,                 NO_MSG,                        NORMAL_POS) \
-       DEATHTYPE(DEATH_HURTTRIGGER,            DEATH_SELF_VOID,                    DEATH_MURDER_VOID,             NORMAL_POS) \
-       DEATHTYPE(DEATH_KILL,                   DEATH_SELF_SUICIDE,                 NO_MSG,                        NORMAL_POS) \
-       DEATHTYPE(DEATH_LAVA,                   DEATH_SELF_LAVA,                    DEATH_MURDER_LAVA,             NORMAL_POS) \
-       DEATHTYPE(DEATH_MIRRORDAMAGE,           DEATH_SELF_BETRAYAL,                NO_MSG,                        NORMAL_POS) \
-       DEATHTYPE(DEATH_MONSTER_MAGE,                   DEATH_SELF_MON_MAGE,                            DEATH_MURDER_MONSTER,              DEATH_MONSTER_FIRST) \
-       DEATHTYPE(DEATH_MONSTER_SHAMBLER_CLAW,  DEATH_SELF_MON_SHAMBLER_CLAW,           DEATH_MURDER_MONSTER,              NORMAL_POS) \
-       DEATHTYPE(DEATH_MONSTER_SHAMBLER_SMASH, DEATH_SELF_MON_SHAMBLER_SMASH,          DEATH_MURDER_MONSTER,              NORMAL_POS) \
-       DEATHTYPE(DEATH_MONSTER_SHAMBLER_ZAP,   DEATH_SELF_MON_SHAMBLER_ZAP,            DEATH_MURDER_MONSTER,              NORMAL_POS) \
-       DEATHTYPE(DEATH_MONSTER_SPIDER,                 DEATH_SELF_MON_SPIDER,                          DEATH_MURDER_MONSTER,              NORMAL_POS) \
-       DEATHTYPE(DEATH_MONSTER_WYVERN,                 DEATH_SELF_MON_WYVERN,                          DEATH_MURDER_MONSTER,              NORMAL_POS) \
-       DEATHTYPE(DEATH_MONSTER_ZOMBIE_JUMP,    DEATH_SELF_MON_ZOMBIE_JUMP,                     DEATH_MURDER_MONSTER,              NORMAL_POS) \
-       DEATHTYPE(DEATH_MONSTER_ZOMBIE_MELEE,   DEATH_SELF_MON_ZOMBIE_MELEE,            DEATH_MURDER_MONSTER,              DEATH_MONSTER_LAST) \
-       DEATHTYPE(DEATH_NADE,                   DEATH_SELF_NADE,                    DEATH_MURDER_NADE,             NORMAL_POS) \
-       DEATHTYPE(DEATH_NADE_NAPALM,            DEATH_SELF_NADE_NAPALM,             DEATH_MURDER_NADE_NAPALM,      NORMAL_POS) \
-       DEATHTYPE(DEATH_NADE_ICE,               DEATH_SELF_NADE_ICE,                DEATH_MURDER_NADE_ICE,         NORMAL_POS) \
-       DEATHTYPE(DEATH_NADE_ICE_FREEZE,        DEATH_SELF_NADE_ICE_FREEZE,         DEATH_MURDER_NADE_ICE_FREEZE,  NORMAL_POS) \
-       DEATHTYPE(DEATH_NADE_HEAL,              DEATH_SELF_NADE_HEAL,               DEATH_MURDER_NADE_HEAL,        NORMAL_POS) \
-       DEATHTYPE(DEATH_NOAMMO,                 DEATH_SELF_NOAMMO,                  NO_MSG,                        NORMAL_POS) \
-       DEATHTYPE(DEATH_ROT,                    DEATH_SELF_ROT,                     NO_MSG,                        NORMAL_POS) \
-       DEATHTYPE(DEATH_SHOOTING_STAR,          DEATH_SELF_SHOOTING_STAR,           DEATH_MURDER_SHOOTING_STAR,    NORMAL_POS) \
-       DEATHTYPE(DEATH_SLIME,                  DEATH_SELF_SLIME,                   DEATH_MURDER_SLIME,            NORMAL_POS) \
-       DEATHTYPE(DEATH_SWAMP,                  DEATH_SELF_SWAMP,                   DEATH_MURDER_SWAMP,            NORMAL_POS) \
-       DEATHTYPE(DEATH_TEAMCHANGE,             DEATH_SELF_TEAMCHANGE,              NO_MSG,                        NORMAL_POS) \
-       DEATHTYPE(DEATH_TELEFRAG,               NO_MSG,                             DEATH_MURDER_TELEFRAG,         NORMAL_POS) \
-       DEATHTYPE(DEATH_TOUCHEXPLODE,           DEATH_SELF_TOUCHEXPLODE,            DEATH_MURDER_TOUCHEXPLODE,     NORMAL_POS) \
-       DEATHTYPE(DEATH_TURRET,                 DEATH_SELF_TURRET,                  NO_MSG,                        DEATH_TURRET_FIRST) \
-       DEATHTYPE(DEATH_TURRET_EWHEEL,          DEATH_SELF_TURRET_EWHEEL,           NO_MSG,                        NORMAL_POS) \
-       DEATHTYPE(DEATH_TURRET_FLAC,            DEATH_SELF_TURRET_FLAC,             NO_MSG,                        NORMAL_POS) \
-       DEATHTYPE(DEATH_TURRET_HELLION,         DEATH_SELF_TURRET_HELLION,          NO_MSG,                        NORMAL_POS) \
-       DEATHTYPE(DEATH_TURRET_HK,              DEATH_SELF_TURRET_HK,               NO_MSG,                        NORMAL_POS) \
-       DEATHTYPE(DEATH_TURRET_MACHINEGUN,      DEATH_SELF_TURRET_MACHINEGUN,       NO_MSG,                        NORMAL_POS) \
-       DEATHTYPE(DEATH_TURRET_MLRS,            DEATH_SELF_TURRET_MLRS,             NO_MSG,                        NORMAL_POS) \
-       DEATHTYPE(DEATH_TURRET_PHASER,          DEATH_SELF_TURRET_PHASER,           NO_MSG,                        NORMAL_POS) \
-       DEATHTYPE(DEATH_TURRET_PLASMA,          DEATH_SELF_TURRET_PLASMA,           NO_MSG,                        NORMAL_POS) \
-       DEATHTYPE(DEATH_TURRET_TESLA,           DEATH_SELF_TURRET_TESLA,            NO_MSG,                        NORMAL_POS) \
-       DEATHTYPE(DEATH_TURRET_WALK_GUN,        DEATH_SELF_TURRET_WALK_GUN,         NO_MSG,                        NORMAL_POS) \
-       DEATHTYPE(DEATH_TURRET_WALK_MELEE,      DEATH_SELF_TURRET_WALK_MELEE,       NO_MSG,                        NORMAL_POS) \
-       DEATHTYPE(DEATH_TURRET_WALK_ROCKET,     DEATH_SELF_TURRET_WALK_ROCKET,      NO_MSG,                        DEATH_TURRET_LAST) \
-       DEATHTYPE(DEATH_VH_BUMB_DEATH,          DEATH_SELF_VH_BUMB_DEATH,           DEATH_MURDER_VH_BUMB_DEATH,    DEATH_VHFIRST) \
-       DEATHTYPE(DEATH_VH_BUMB_GUN,            NO_MSG,                             DEATH_MURDER_VH_BUMB_GUN,      NORMAL_POS) \
-       DEATHTYPE(DEATH_VH_CRUSH,               DEATH_SELF_VH_CRUSH,                DEATH_MURDER_VH_CRUSH,         NORMAL_POS) \
-       DEATHTYPE(DEATH_VH_RAPT_BOMB,           DEATH_SELF_VH_RAPT_BOMB,            DEATH_MURDER_VH_RAPT_BOMB,     NORMAL_POS) \
-       DEATHTYPE(DEATH_VH_RAPT_CANNON,         NO_MSG,                             DEATH_MURDER_VH_RAPT_CANNON,   NORMAL_POS) \
-       DEATHTYPE(DEATH_VH_RAPT_DEATH,          DEATH_SELF_VH_RAPT_DEATH,           DEATH_MURDER_VH_RAPT_DEATH,    NORMAL_POS) \
-       DEATHTYPE(DEATH_VH_RAPT_FRAGMENT,       DEATH_SELF_VH_RAPT_BOMB,            DEATH_MURDER_VH_RAPT_BOMB,     NORMAL_POS) \
-       DEATHTYPE(DEATH_VH_SPID_DEATH,          DEATH_SELF_VH_SPID_DEATH,           DEATH_MURDER_VH_SPID_DEATH,    NORMAL_POS) \
-       DEATHTYPE(DEATH_VH_SPID_MINIGUN,        NO_MSG,                             DEATH_MURDER_VH_SPID_MINIGUN,  NORMAL_POS) \
-       DEATHTYPE(DEATH_VH_SPID_ROCKET,         DEATH_SELF_VH_SPID_ROCKET,          DEATH_MURDER_VH_SPID_ROCKET,   NORMAL_POS) \
-       DEATHTYPE(DEATH_VH_WAKI_DEATH,          DEATH_SELF_VH_WAKI_DEATH,           DEATH_MURDER_VH_WAKI_DEATH,    NORMAL_POS) \
-       DEATHTYPE(DEATH_VH_WAKI_GUN,            NO_MSG,                             DEATH_MURDER_VH_WAKI_GUN,      NORMAL_POS) \
-       DEATHTYPE(DEATH_VH_WAKI_ROCKET,         DEATH_SELF_VH_WAKI_ROCKET,          DEATH_MURDER_VH_WAKI_ROCKET,   DEATH_VHLAST) \
-       DEATHTYPE(DEATH_WEAPON,                 NO_MSG,                             NO_MSG,                        NORMAL_POS)
-
-#define DT_FIRST 10000
-#define DT_MAX 128 // limit of recursive functions with ACCUMULATE_FUNCTION
-int DT_COUNT;
-
-entity deathtypes[DT_MAX];
-.entity death_msgself;
-.entity death_msgmurder;
-
-#define DEATHTYPE(name,msg_death,msg_death_by,position) \
-       int name; \
-       void RegisterDeathtype_##name() \
-       { \
-               SET_FIRST_OR_LAST(position, DT_FIRST, DT_COUNT) \
-               SET_FIELD_COUNT(name, DT_FIRST, DT_COUNT) \
-               CHECK_MAX_COUNT(name, DT_MAX, DT_COUNT, "deathtypes") \
-               \
-               entity deathent = spawn(); \
-               deathtypes[(name - DT_FIRST)] = deathent; \
-               deathent.classname = "deathtype"; \
-               deathent.nent_name = #name; \
-               if (msg_death != NO_MSG) \
-                       deathent.death_msgself = msg_multi_notifs[msg_death - 1]; \
-               if (msg_death_by != NO_MSG) \
-                       deathent.death_msgmurder = msg_multi_notifs[msg_death_by - 1]; \
-       } \
-       ACCUMULATE_FUNCTION(RegisterDeathtypes, RegisterDeathtype_##name)
-
-DEATHTYPES
-#undef DEATHTYPE
-
-#define DEATH_ISSPECIAL(t)            ((t) >= DEATH_SPECIAL_START)
-#define DEATH_ISVEHICLE(t)            ((t) >= DEATH_VHFIRST && (t) <= DEATH_VHLAST)
-#define DEATH_ISTURRET(t)             ((t) >= DEATH_TURRET_FIRST && (t) <= DEATH_TURRET_LAST)
-#define DEATH_ISMONSTER(t)            ((t) >= DEATH_MONSTER_FIRST && (t) <= DEATH_MONSTER_LAST)
-#define DEATH_WEAPONOFWEAPONDEATH(t)  ((t) & DEATH_WEAPONMASK)
-#define DEATH_ISWEAPON(t,w)           (!DEATH_ISSPECIAL(t) && DEATH_WEAPONOFWEAPONDEATH(t) == (w))
-#define DEATH_WEAPONOF(t)             (DEATH_ISSPECIAL(t) ? 0 : DEATH_WEAPONOFWEAPONDEATH(t))
-#define WEP_VALID(w)                  ((w) >= WEP_FIRST && (w) <= WEP_LAST)
-
-string Deathtype_Name(int deathtype)
-{
-       if(DEATH_ISSPECIAL(deathtype))
-       {
-               entity deathent = deathtypes[(deathtype - DT_FIRST)];
-               if (!deathent) { backtrace("Deathtype_Name: Could not find deathtype entity!\n"); return ""; }
-               return deathent.nent_name;
-       }
-       else { return ftos(deathtype); }
-}
-
-const int DEATH_WEAPONMASK = 0xFF;
-const int DEATH_HITTYPEMASK = 0x1F00; // which is WAY below 10000 used for normal deaths
-const int HITTYPE_SECONDARY = 0x100;
-const int HITTYPE_SPLASH = 0x200; // automatically set by RadiusDamage
-const int HITTYPE_BOUNCE = 0x400;
-const int HITTYPE_RESERVED2 = 0x800;
-const int HITTYPE_RESERVED = 0x1000; // unused yet
-#endif
diff --git a/qcsrc/common/deathtypes/all.inc b/qcsrc/common/deathtypes/all.inc
new file mode 100644 (file)
index 0000000..32d0631
--- /dev/null
@@ -0,0 +1,61 @@
+REGISTER_DEATHTYPE(AUTOTEAMCHANGE,          DEATH_SELF_AUTOTEAMCHANGE,      NO_MSG,                         "")
+REGISTER_DEATHTYPE(BUFF,                    NO_MSG,                         DEATH_MURDER_BUFF,              "")
+REGISTER_DEATHTYPE(CAMP,                    DEATH_SELF_CAMP,                NO_MSG,                         "")
+REGISTER_DEATHTYPE(CHEAT,                   DEATH_SELF_CHEAT,               DEATH_MURDER_CHEAT,             "")
+REGISTER_DEATHTYPE(CUSTOM,                  DEATH_SELF_CUSTOM,              NO_MSG,                         "")
+REGISTER_DEATHTYPE(DROWN,                   DEATH_SELF_DROWN,               DEATH_MURDER_DROWN,             "")
+REGISTER_DEATHTYPE(FALL,                    DEATH_SELF_FALL,                DEATH_MURDER_FALL,              "")
+REGISTER_DEATHTYPE(FIRE,                    DEATH_SELF_FIRE,                DEATH_MURDER_FIRE,              "")
+REGISTER_DEATHTYPE(GENERIC,                 DEATH_SELF_GENERIC,             NO_MSG,                         "")
+REGISTER_DEATHTYPE(HURTTRIGGER,             DEATH_SELF_VOID,                DEATH_MURDER_VOID,              "")
+REGISTER_DEATHTYPE(KILL,                    DEATH_SELF_SUICIDE,             NO_MSG,                         "")
+REGISTER_DEATHTYPE(LAVA,                    DEATH_SELF_LAVA,                DEATH_MURDER_LAVA,              "")
+REGISTER_DEATHTYPE(MIRRORDAMAGE,            DEATH_SELF_BETRAYAL,            NO_MSG,                         "")
+REGISTER_DEATHTYPE(MONSTER_MAGE,            DEATH_SELF_MON_MAGE,            DEATH_MURDER_MONSTER,           "monster")
+REGISTER_DEATHTYPE(MONSTER_SHAMBLER_CLAW,   DEATH_SELF_MON_SHAMBLER_CLAW,   DEATH_MURDER_MONSTER,           "monster")
+REGISTER_DEATHTYPE(MONSTER_SHAMBLER_SMASH,  DEATH_SELF_MON_SHAMBLER_SMASH,  DEATH_MURDER_MONSTER,           "monster")
+REGISTER_DEATHTYPE(MONSTER_SHAMBLER_ZAP,    DEATH_SELF_MON_SHAMBLER_ZAP,    DEATH_MURDER_MONSTER,           "monster")
+REGISTER_DEATHTYPE(MONSTER_SPIDER,          DEATH_SELF_MON_SPIDER,          DEATH_MURDER_MONSTER,           "monster")
+REGISTER_DEATHTYPE(MONSTER_WYVERN,          DEATH_SELF_MON_WYVERN,          DEATH_MURDER_MONSTER,           "monster")
+REGISTER_DEATHTYPE(MONSTER_ZOMBIE_JUMP,     DEATH_SELF_MON_ZOMBIE_JUMP,     DEATH_MURDER_MONSTER,           "monster")
+REGISTER_DEATHTYPE(MONSTER_ZOMBIE_MELEE,    DEATH_SELF_MON_ZOMBIE_MELEE,    DEATH_MURDER_MONSTER,           "monster")
+REGISTER_DEATHTYPE(NADE,                    DEATH_SELF_NADE,                DEATH_MURDER_NADE,              "")
+REGISTER_DEATHTYPE(NADE_NAPALM,             DEATH_SELF_NADE_NAPALM,         DEATH_MURDER_NADE_NAPALM,       "")
+REGISTER_DEATHTYPE(NADE_ICE,                DEATH_SELF_NADE_ICE,            DEATH_MURDER_NADE_ICE,          "")
+REGISTER_DEATHTYPE(NADE_ICE_FREEZE,         DEATH_SELF_NADE_ICE_FREEZE,     DEATH_MURDER_NADE_ICE_FREEZE,   "")
+REGISTER_DEATHTYPE(NADE_HEAL,               DEATH_SELF_NADE_HEAL,           DEATH_MURDER_NADE_HEAL,         "")
+REGISTER_DEATHTYPE(NOAMMO,                  DEATH_SELF_NOAMMO,              NO_MSG,                         "")
+REGISTER_DEATHTYPE(ROT,                     DEATH_SELF_ROT,                 NO_MSG,                         "")
+REGISTER_DEATHTYPE(SHOOTING_STAR,           DEATH_SELF_SHOOTING_STAR,       DEATH_MURDER_SHOOTING_STAR,     "")
+REGISTER_DEATHTYPE(SLIME,                   DEATH_SELF_SLIME,               DEATH_MURDER_SLIME,             "")
+REGISTER_DEATHTYPE(SWAMP,                   DEATH_SELF_SWAMP,               DEATH_MURDER_SWAMP,             "")
+REGISTER_DEATHTYPE(TEAMCHANGE,              DEATH_SELF_TEAMCHANGE,          NO_MSG,                         "")
+REGISTER_DEATHTYPE(TELEFRAG,                NO_MSG,                         DEATH_MURDER_TELEFRAG,          "")
+REGISTER_DEATHTYPE(TOUCHEXPLODE,            DEATH_SELF_TOUCHEXPLODE,        DEATH_MURDER_TOUCHEXPLODE,      "")
+REGISTER_DEATHTYPE(TURRET,                  DEATH_SELF_TURRET,              NO_MSG,                         "turret")
+REGISTER_DEATHTYPE(TURRET_EWHEEL,           DEATH_SELF_TURRET_EWHEEL,       NO_MSG,                         "turret")
+REGISTER_DEATHTYPE(TURRET_FLAC,             DEATH_SELF_TURRET_FLAC,         NO_MSG,                         "turret")
+REGISTER_DEATHTYPE(TURRET_HELLION,          DEATH_SELF_TURRET_HELLION,      NO_MSG,                         "turret")
+REGISTER_DEATHTYPE(TURRET_HK,               DEATH_SELF_TURRET_HK,           NO_MSG,                         "turret")
+REGISTER_DEATHTYPE(TURRET_MACHINEGUN,       DEATH_SELF_TURRET_MACHINEGUN,   NO_MSG,                         "turret")
+REGISTER_DEATHTYPE(TURRET_MLRS,             DEATH_SELF_TURRET_MLRS,         NO_MSG,                         "turret")
+REGISTER_DEATHTYPE(TURRET_PHASER,           DEATH_SELF_TURRET_PHASER,       NO_MSG,                         "turret")
+REGISTER_DEATHTYPE(TURRET_PLASMA,           DEATH_SELF_TURRET_PLASMA,       NO_MSG,                         "turret")
+REGISTER_DEATHTYPE(TURRET_TESLA,            DEATH_SELF_TURRET_TESLA,        NO_MSG,                         "turret")
+REGISTER_DEATHTYPE(TURRET_WALK_GUN,         DEATH_SELF_TURRET_WALK_GUN,     NO_MSG,                         "turret")
+REGISTER_DEATHTYPE(TURRET_WALK_MELEE,       DEATH_SELF_TURRET_WALK_MELEE,   NO_MSG,                         "turret")
+REGISTER_DEATHTYPE(TURRET_WALK_ROCKET,      DEATH_SELF_TURRET_WALK_ROCKET,  NO_MSG,                         "turret")
+REGISTER_DEATHTYPE(VH_BUMB_DEATH,           DEATH_SELF_VH_BUMB_DEATH,       DEATH_MURDER_VH_BUMB_DEATH,     "vehicle")
+REGISTER_DEATHTYPE(VH_BUMB_GUN,             NO_MSG,                         DEATH_MURDER_VH_BUMB_GUN,       "vehicle")
+REGISTER_DEATHTYPE(VH_CRUSH,                DEATH_SELF_VH_CRUSH,            DEATH_MURDER_VH_CRUSH,          "vehicle")
+REGISTER_DEATHTYPE(VH_RAPT_BOMB,            DEATH_SELF_VH_RAPT_BOMB,        DEATH_MURDER_VH_RAPT_BOMB,      "vehicle")
+REGISTER_DEATHTYPE(VH_RAPT_CANNON,          NO_MSG,                         DEATH_MURDER_VH_RAPT_CANNON,    "vehicle")
+REGISTER_DEATHTYPE(VH_RAPT_DEATH,           DEATH_SELF_VH_RAPT_DEATH,       DEATH_MURDER_VH_RAPT_DEATH,     "vehicle")
+REGISTER_DEATHTYPE(VH_RAPT_FRAGMENT,        DEATH_SELF_VH_RAPT_BOMB,        DEATH_MURDER_VH_RAPT_BOMB,      "vehicle")
+REGISTER_DEATHTYPE(VH_SPID_DEATH,           DEATH_SELF_VH_SPID_DEATH,       DEATH_MURDER_VH_SPID_DEATH,     "vehicle")
+REGISTER_DEATHTYPE(VH_SPID_MINIGUN,         NO_MSG,                         DEATH_MURDER_VH_SPID_MINIGUN,   "vehicle")
+REGISTER_DEATHTYPE(VH_SPID_ROCKET,          DEATH_SELF_VH_SPID_ROCKET,      DEATH_MURDER_VH_SPID_ROCKET,    "vehicle")
+REGISTER_DEATHTYPE(VH_WAKI_DEATH,           DEATH_SELF_VH_WAKI_DEATH,       DEATH_MURDER_VH_WAKI_DEATH,     "vehicle")
+REGISTER_DEATHTYPE(VH_WAKI_GUN,             NO_MSG,                         DEATH_MURDER_VH_WAKI_GUN,       "vehicle")
+REGISTER_DEATHTYPE(VH_WAKI_ROCKET,          DEATH_SELF_VH_WAKI_ROCKET,      DEATH_MURDER_VH_WAKI_ROCKET,    "vehicle")
+REGISTER_DEATHTYPE(WEAPON,                  NO_MSG,                         NO_MSG,                         "")
diff --git a/qcsrc/common/deathtypes/all.qc b/qcsrc/common/deathtypes/all.qc
new file mode 100644 (file)
index 0000000..4fdafa9
--- /dev/null
@@ -0,0 +1,11 @@
+#include "all.qh"
+
+string Deathtype_Name(int deathtype)
+{
+       if (DEATH_ISSPECIAL(deathtype)) {
+               entity deathent = Deathtypes[deathtype - DT_FIRST];
+               if (!deathent) { backtrace("Deathtype_Name: Could not find deathtype entity!\n"); return ""; }
+               return deathent.nent_name;
+       }
+       return ftos(deathtype);
+}
diff --git a/qcsrc/common/deathtypes/all.qh b/qcsrc/common/deathtypes/all.qh
new file mode 100644 (file)
index 0000000..2bf1169
--- /dev/null
@@ -0,0 +1,47 @@
+#ifndef DEATHTYPES_ALL_H
+#define DEATHTYPES_ALL_H
+
+#include "../notifications.qh"
+
+REGISTRY(Deathtypes, BIT(6))
+REGISTER_REGISTRY(RegisterDeathtypes)
+
+.entity death_msgself;
+.entity death_msgmurder;
+.string death_msgextra;
+
+#define REGISTER_DEATHTYPE(id, msg_death, msg_death_by, extra) \
+    REGISTER(RegisterDeathtypes, DEATH, Deathtypes, id, m_id, new(deathtype)) { \
+        this.m_id += DT_FIRST; \
+        this.nent_name = #id; \
+        this.death_msgextra = extra; \
+        if (msg_death       != NO_MSG) this.death_msgself   = msg_multi_notifs[msg_death    - 1]; \
+        if (msg_death_by    != NO_MSG) this.death_msgmurder = msg_multi_notifs[msg_death_by - 1]; \
+    }
+
+const int DEATH_WEAPONMASK = BITS(8);
+const int HITTYPE_SECONDARY = BITS(1) << 8;
+/** automatically set by RadiusDamage */
+const int HITTYPE_SPLASH = BITS(1) << 9;
+const int HITTYPE_BOUNCE = BITS(1) << 10;
+// unused yet
+const int HITTYPE_RESERVED = BITS(1) << 11;
+const int HITTYPE_RESERVED2 = BITS(1) << 12;
+const int DEATH_HITTYPEMASK = HITTYPE_SECONDARY | HITTYPE_SPLASH | HITTYPE_BOUNCE | HITTYPE_RESERVED | HITTYPE_RESERVED2;
+// normal deaths begin
+const int DT_FIRST = BIT(13);
+
+#define DEATH_ISSPECIAL(t)      (t >= DT_FIRST)
+#define DEATH_IS(t, dt)         (DEATH_ISSPECIAL(t) && (Deathtypes[t - DT_FIRST]) == dt)
+#define DEATH_ENT(t)            (DEATH_ISSPECIAL(t) ?  (Deathtypes[t - DT_FIRST]) : NULL)
+#define DEATH_ISVEHICLE(t)      (DEATH_ISSPECIAL(t) && (Deathtypes[t - DT_FIRST]).death_msgextra == "vehicle")
+#define DEATH_ISTURRET(t)       (DEATH_ISSPECIAL(t) && (Deathtypes[t - DT_FIRST]).death_msgextra == "turret")
+#define DEATH_ISMONSTER(t)      (DEATH_ISSPECIAL(t) && (Deathtypes[t - DT_FIRST]).death_msgextra == "monster")
+#define DEATH_WEAPONOF(t)       (DEATH_ISSPECIAL(t) ? WEP_Null : get_weaponinfo((t) & DEATH_WEAPONMASK))
+#define DEATH_ISWEAPON(t, w)    (DEATH_WEAPONOF(t) == (w))
+
+string Deathtype_Name(int deathtype);
+
+#include "all.inc"
+
+#endif
index 9952063f60133e5fe4845ffd5f76e66ae7065d30..356b47dbc41bf5b815f741386d43d7a81c38a4fc 100644 (file)
@@ -150,7 +150,7 @@ void M_Mage_Attack_Spike_Explode()
        self.realowner.mage_spike = world;
 
        Send_Effect(EFFECT_EXPLOSION_SMALL, self.origin, '0 0 0', 1);
-       RadiusDamage (self, self.realowner, (autocvar_g_monster_mage_attack_spike_damage), (autocvar_g_monster_mage_attack_spike_damage) * 0.5, (autocvar_g_monster_mage_attack_spike_radius), world, world, 0, DEATH_MONSTER_MAGE, other);
+       RadiusDamage (self, self.realowner, (autocvar_g_monster_mage_attack_spike_damage), (autocvar_g_monster_mage_attack_spike_damage) * 0.5, (autocvar_g_monster_mage_attack_spike_radius), world, world, 0, DEATH_MONSTER_MAGE.m_id, other);
 
        remove (self);
 }
@@ -302,7 +302,7 @@ void M_Mage_Defend_Heal()
 void M_Mage_Attack_Push()
 {SELFPARAM();
        sound(self, CH_SHOTS, SND_TAGEXP1, 1, ATTEN_NORM);
-       RadiusDamage (self, self, (autocvar_g_monster_mage_attack_push_damage), (autocvar_g_monster_mage_attack_push_damage), (autocvar_g_monster_mage_attack_push_radius), world, world, (autocvar_g_monster_mage_attack_push_force), DEATH_MONSTER_MAGE, self.enemy);
+       RadiusDamage (self, self, (autocvar_g_monster_mage_attack_push_damage), (autocvar_g_monster_mage_attack_push_damage), (autocvar_g_monster_mage_attack_push_radius), world, world, (autocvar_g_monster_mage_attack_push_force), DEATH_MONSTER_MAGE.m_id, self.enemy);
        Send_Effect(EFFECT_TE_EXPLOSION, self.origin, '0 0 0', 1);
 
        setanim(self, self.anim_shoot, true, true, true);
index 937c83c9edbe868b7f2f3c25f5d3d4caaab628cf..8a84eeec39e721141a5da3969d8d32bba477d43b 100644 (file)
@@ -68,13 +68,13 @@ void M_Shambler_Attack_Smash()
        tracebox(self.origin + v_forward * 50, self.mins * 0.5, self.maxs * 0.5, self.origin + v_forward * autocvar_g_monster_shambler_attack_smash_range, MOVE_NORMAL, self);
 
        if(trace_ent.takedamage)
-               Damage(trace_ent, self, self, (autocvar_g_monster_shambler_attack_smash_damage) * MONSTER_SKILLMOD(self), DEATH_MONSTER_SHAMBLER_SMASH, trace_ent.origin, normalize(trace_ent.origin - self.origin));
+               Damage(trace_ent, self, self, (autocvar_g_monster_shambler_attack_smash_damage) * MONSTER_SKILLMOD(self), DEATH_MONSTER_SHAMBLER_SMASH.m_id, trace_ent.origin, normalize(trace_ent.origin - self.origin));
 }
 
 void M_Shambler_Attack_Swing()
 {SELFPARAM();
        float r = (random() < 0.5);
-       if(r && Monster_Attack_Melee(self.enemy, (autocvar_g_monster_shambler_attack_claw_damage), ((r) ? self.anim_melee2 : self.anim_melee3), self.attack_range, 0.8, DEATH_MONSTER_SHAMBLER_CLAW, true))
+       if(r && Monster_Attack_Melee(self.enemy, (autocvar_g_monster_shambler_attack_claw_damage), ((r) ? self.anim_melee2 : self.anim_melee3), self.attack_range, 0.8, DEATH_MONSTER_SHAMBLER_CLAW.m_id, true))
        {
                Monster_Delay(1, 0, 0.5, M_Shambler_Attack_Swing);
                self.attack_finished_single += 0.5;
@@ -102,7 +102,7 @@ void M_Shambler_Attack_Lightning_Explode()
        for(head = findradius(self.origin, (autocvar_g_monster_shambler_attack_lightning_radius_zap)); head; head = head.chain) if(head != self.realowner) if(head.takedamage)
        {
                te_csqc_lightningarc(self.origin, head.origin);
-               Damage(head, self, self.realowner, (autocvar_g_monster_shambler_attack_lightning_damage_zap) * MONSTER_SKILLMOD(self), DEATH_MONSTER_SHAMBLER_ZAP, head.origin, '0 0 0');
+               Damage(head, self, self.realowner, (autocvar_g_monster_shambler_attack_lightning_damage_zap) * MONSTER_SKILLMOD(self), DEATH_MONSTER_SHAMBLER_ZAP.m_id, head.origin, '0 0 0');
        }
 
        self.think = SUB_Remove;
@@ -154,7 +154,7 @@ void M_Shambler_Attack_Lightning()
        gren.bot_dodgerating = (autocvar_g_monster_shambler_attack_lightning_damage);
        gren.movetype = MOVETYPE_BOUNCE;
        PROJECTILE_MAKETRIGGER(gren);
-       gren.projectiledeathtype = DEATH_MONSTER_SHAMBLER_ZAP;
+       gren.projectiledeathtype = DEATH_MONSTER_SHAMBLER_ZAP.m_id;
        setorigin(gren, CENTER_OR_VIEWOFS(self));
        setsize(gren, '-8 -8 -8', '8 8 8');
        gren.scale = 2.5;
index 35a320b9d50908b6209927e604db3f6004f57397..c8daa037e9b2ccd7e7642189dbfc7644d1a2910f 100644 (file)
@@ -73,7 +73,7 @@ METHOD(SpiderAttack, wr_think, void(SpiderAttack thiswep, entity actor, bool fir
                actor.enemy = Monster_FindTarget(actor);
                actor.attack_range = 60;
        }
-       Monster_Attack_Melee(actor.enemy, (autocvar_g_monster_spider_attack_bite_damage), ((random() > 0.5) ? self.anim_melee : self.anim_shoot), self.attack_range, (autocvar_g_monster_spider_attack_bite_delay), DEATH_MONSTER_SPIDER, true);
+       Monster_Attack_Melee(actor.enemy, (autocvar_g_monster_spider_attack_bite_damage), ((random() > 0.5) ? self.anim_melee : self.anim_shoot), self.attack_range, (autocvar_g_monster_spider_attack_bite_delay), DEATH_MONSTER_SPIDER.m_id, true);
         weapon_thinkf(actor, WFRAME_FIRE2, 0, w_ready);
     }
 }
@@ -128,7 +128,7 @@ void M_Spider_Attack_Web()
        proj.bot_dodgerating = 0;
        proj.nextthink = time + 5;
        PROJECTILE_MAKETRIGGER(proj);
-       proj.projectiledeathtype = DEATH_MONSTER_SPIDER;
+       proj.projectiledeathtype = DEATH_MONSTER_SPIDER.m_id;
        setorigin(proj, CENTER_OR_VIEWOFS(self));
 
        //proj.glow_size = 50;
index 102fd6a5c1fdfb1aa4a58bcc320c195f645ce03f..d709e4514e9645fd79a165faa79fcf7a2205cab6 100644 (file)
@@ -62,7 +62,7 @@ METHOD(WyvernAttack, wr_think, void(WyvernAttack thiswep, entity actor, bool fir
                missile.owner = missile.realowner = actor;
                missile.solid = SOLID_TRIGGER;
                missile.movetype = MOVETYPE_FLYMISSILE;
-               missile.projectiledeathtype = DEATH_MONSTER_WYVERN;
+               missile.projectiledeathtype = DEATH_MONSTER_WYVERN.m_id;
                setsize(missile, '-6 -6 -6', '6 6 6');
                setorigin(missile, actor.origin + actor.view_ofs + v_forward * 14);
                missile.flags = FL_PROJECTILE;
index 8425a123add60d29469b219c2d0f3b191a34b7de..ef9aa06cb009df05b57891b7c7c49c129353484a 100644 (file)
@@ -84,7 +84,7 @@ void M_Zombie_Attack_Leap_Touch()
        {
                angles_face = vectoangles(self.moveto - self.origin);
                angles_face = normalize(angles_face) * (autocvar_g_monster_zombie_attack_leap_force);
-               Damage(other, self, self, (autocvar_g_monster_zombie_attack_leap_damage) * MONSTER_SKILLMOD(self), DEATH_MONSTER_ZOMBIE_JUMP, other.origin, angles_face);
+               Damage(other, self, self, (autocvar_g_monster_zombie_attack_leap_damage) * MONSTER_SKILLMOD(self), DEATH_MONSTER_ZOMBIE_JUMP.m_id, other.origin, angles_face);
                self.touch = Monster_Touch; // instantly turn it off to stop damage spam
                self.state = 0;
        }
@@ -137,7 +137,7 @@ float M_Zombie_Attack(float attack_type, entity targ)
                        else
                                chosen_anim = self.anim_melee3;
 
-                       return Monster_Attack_Melee(self.enemy, (autocvar_g_monster_zombie_attack_melee_damage), chosen_anim, self.attack_range, (autocvar_g_monster_zombie_attack_melee_delay), DEATH_MONSTER_ZOMBIE_MELEE, true);
+                       return Monster_Attack_Melee(self.enemy, (autocvar_g_monster_zombie_attack_melee_damage), chosen_anim, self.attack_range, (autocvar_g_monster_zombie_attack_melee_delay), DEATH_MONSTER_ZOMBIE_MELEE.m_id, true);
                }
                case MONSTER_ATTACK_RANGED:
                {
index 8b05f781d2e395b44a3893474fdc6788501dd40e..940b30f008cc407034af45d70c44108d42f1d4e0 100644 (file)
@@ -12,7 +12,7 @@
     #include "../weapons/all.qh"
     #include "../../server/autocvars.qh"
     #include "../../server/defs.qh"
-    #include "../deathtypes.qh"
+    #include "../deathtypes/all.qh"
     #include "../../server/mutators/mutators_include.qh"
        #include "../../server/steerlib.qh"
        #include "../turrets/sv_turrets.qh"
@@ -744,7 +744,7 @@ void Monster_Move(float runspeed, float walkspeed, float stpspeed)
                        Unfreeze(self);
                        self.health = 0;
                        if(self.event_damage)
-                               self.event_damage(self, self.frozen_by, 1, DEATH_NADE_ICE_FREEZE, self.origin, '0 0 0');
+                               self.event_damage(self, self.frozen_by, 1, DEATH_NADE_ICE_FREEZE.m_id, self.origin, '0 0 0');
                }
 
                else if ( self.revive_progress <= 0 )
@@ -761,7 +761,7 @@ void Monster_Move(float runspeed, float walkspeed, float stpspeed)
                        {
                                self.last_trace = time + 0.4;
 
-                               Damage (self, world, world, 2, DEATH_DROWN, self.origin, '0 0 0');
+                               Damage (self, world, world, 2, DEATH_DROWN.m_id, self.origin, '0 0 0');
                                self.angles = '90 90 0';
                                if(random() < 0.5)
                                {
@@ -1048,19 +1048,19 @@ void Monster_Dead(entity attacker, float gibbed)
 
 void Monster_Damage(entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force)
 {SELFPARAM();
-       if((self.spawnflags & MONSTERFLAG_INVINCIBLE) && deathtype != DEATH_KILL && !ITEM_DAMAGE_NEEDKILL(deathtype))
+       if((self.spawnflags & MONSTERFLAG_INVINCIBLE) && deathtype != DEATH_KILL.m_id && !ITEM_DAMAGE_NEEDKILL(deathtype))
                return;
 
-       if(self.frozen && deathtype != DEATH_KILL && deathtype != DEATH_NADE_ICE_FREEZE)
+       if(self.frozen && deathtype != DEATH_KILL.m_id && deathtype != DEATH_NADE_ICE_FREEZE.m_id)
                return;
 
-       //if(time < self.pain_finished && deathtype != DEATH_KILL)
+       //if(time < self.pain_finished && deathtype != DEATH_KILL.m_id)
                //return;
 
-       if(time < self.spawnshieldtime && deathtype != DEATH_KILL)
+       if(time < self.spawnshieldtime && deathtype != DEATH_KILL.m_id)
                return;
 
-       if(deathtype == DEATH_FALL && self.draggedby != world)
+       if(deathtype == DEATH_FALL.m_id && self.draggedby != world)
                return;
 
        vector v;
@@ -1088,12 +1088,12 @@ void Monster_Damage(entity inflictor, entity attacker, float damage, int deathty
 
        self.dmg_time = time;
 
-       if(sound_allowed(MSG_BROADCAST, attacker) && deathtype != DEATH_DROWN)
+       if(sound_allowed(MSG_BROADCAST, attacker) && deathtype != DEATH_DROWN.m_id)
                spamsound (self, CH_PAIN, SND(BODYIMPACT1), VOL_BASE, ATTEN_NORM);  // FIXME: PLACEHOLDER
 
        self.velocity += force * self.damageforcescale;
 
-       if(deathtype != DEATH_DROWN && take)
+       if(deathtype != DEATH_DROWN.m_id && take)
        {
                Violence_GibSplash_At(hitloc, force, 2, bound(0, take, 200) / 16, self, attacker);
                if (take > 50)
@@ -1104,7 +1104,7 @@ void Monster_Damage(entity inflictor, entity attacker, float damage, int deathty
 
        if(self.health <= 0)
        {
-               if(deathtype == DEATH_KILL)
+               if(deathtype == DEATH_KILL.m_id)
                        self.candrop = false; // killed by mobkill command
 
                // TODO: fix this?
@@ -1113,14 +1113,14 @@ void Monster_Damage(entity inflictor, entity attacker, float damage, int deathty
                SUB_UseTargets();
                self.target2 = self.oldtarget2; // reset to original target on death, incase we respawn
 
-               Monster_Dead(attacker, (self.health <= -100 || deathtype == DEATH_KILL));
+               Monster_Dead(attacker, (self.health <= -100 || deathtype == DEATH_KILL.m_id));
 
                WaypointSprite_Kill(self.sprite);
 
                frag_target = self;
                MUTATOR_CALLHOOK(MonsterDies, attacker);
 
-               if(self.health <= -100 || deathtype == DEATH_KILL) // check if we're already gibbed
+               if(self.health <= -100 || deathtype == DEATH_KILL.m_id) // check if we're already gibbed
                {
                        Violence_GibSplash(self, 1, 0.5, attacker);
 
@@ -1231,7 +1231,7 @@ void Monster_Think()
        if(self.monster_lifetime)
        if(time >= self.monster_lifetime)
        {
-               Damage(self, self, self, self.health + self.max_health, DEATH_KILL, self.origin, self.origin);
+               Damage(self, self, self, self.health + self.max_health, DEATH_KILL.m_id, self.origin, self.origin);
                return;
        }
 
index 9adf1a95bac36b74e3a5dbd046ae630b820c77db..91dd76b0b5c483c8456b4fe05b79391c777ddd85 100644 (file)
@@ -1110,8 +1110,8 @@ entity WaypointSprite_AttachCarrier(
     entity e = WaypointSprite_Spawn(spr, 0, 0, carrier, '0 0 64', world, carrier.team, carrier, waypointsprite_attachedforcarrier, false, icon);
     if (e)
     {
-        WaypointSprite_UpdateMaxHealth(e, '1 0 0' * healtharmor_maxdamage(start_health, start_armorvalue, autocvar_g_balance_armor_blockpercent, DEATH_WEAPON) * 2);
-        WaypointSprite_UpdateHealth(e, '1 0 0' * healtharmor_maxdamage(carrier.health, carrier.armorvalue, autocvar_g_balance_armor_blockpercent, DEATH_WEAPON));
+        WaypointSprite_UpdateMaxHealth(e, '1 0 0' * healtharmor_maxdamage(start_health, start_armorvalue, autocvar_g_balance_armor_blockpercent, DEATH_WEAPON.m_id) * 2);
+        WaypointSprite_UpdateHealth(e, '1 0 0' * healtharmor_maxdamage(carrier.health, carrier.armorvalue, autocvar_g_balance_armor_blockpercent, DEATH_WEAPON.m_id));
     }
     return e;
 }
index 01d6cbe5538e2207c295c08906ca543aa8c40acf..e5e43100427743853e1817ff0751aaf1d367d728 100644 (file)
@@ -886,4 +886,6 @@ ACCUMULATE_FUNCTION(RegisterNotifications, RegisterNotifications_First)
 #include "notifications.inc"
 ACCUMULATE_FUNCTION(RegisterNotifications, RegisterNotifications_Done)
 
+STATIC_INIT(RegisterNotifications) { CALL_ACCUMULATED_FUNCTION(RegisterNotifications); }
+
 #endif
index af9a6b4233124190ad4ab1a417d8f6562739190b..9875dc78ea7134983eda17ec7e5586239bb45d0e 100644 (file)
@@ -210,7 +210,7 @@ void func_breakable_destroy()
                _sound (self, CH_TRIGGER, self.noise, VOL_BASE, ATTEN_NORM);
 
        if(self.dmg)
-               RadiusDamage(self, activator, self.dmg, self.dmg_edge, self.dmg_radius, self, world, self.dmg_force, DEATH_HURTTRIGGER, world);
+               RadiusDamage(self, activator, self.dmg, self.dmg_edge, self.dmg_radius, self, world, self.dmg_force, DEATH_HURTTRIGGER.m_id, world);
 
        if(self.cnt) // TODO
                pointparticles(self.cnt, self.absmin * 0.5 + self.absmax * 0.5, '0 0 0', self.count);
index c55754bdbe30f2fe03b47e76cbf0a60c3fb73769..439d131e7b6ce381005701ccaf0165ce81805676 100644 (file)
@@ -36,14 +36,14 @@ void door_blocked()
        )
        { // KIll Kill Kill!!
 #ifdef SVQC
-               Damage (other, self, self, 10000, DEATH_HURTTRIGGER, other.origin, '0 0 0');
+               Damage (other, self, self, 10000, DEATH_HURTTRIGGER.m_id, other.origin, '0 0 0');
 #endif
        }
        else
        {
 #ifdef SVQC
                if((self.dmg) && (other.takedamage == DAMAGE_YES))    // Shall we bite?
-                       Damage (other, self, self, self.dmg, DEATH_HURTTRIGGER, other.origin, '0 0 0');
+                       Damage (other, self, self, self.dmg, DEATH_HURTTRIGGER.m_id, other.origin, '0 0 0');
 #endif
 
                 // don't change direction for dead or dying stuff
@@ -78,7 +78,7 @@ void door_blocked()
                {
                        //gib dying stuff just to make sure
                        if((self.dmg) && (other.takedamage != DAMAGE_NO))    // Shall we bite?
-                               Damage (other, self, self, 10000, DEATH_HURTTRIGGER, other.origin, '0 0 0');
+                               Damage (other, self, self, 10000, DEATH_HURTTRIGGER.m_id, other.origin, '0 0 0');
                }
 #endif
        }
@@ -331,7 +331,7 @@ void door_generic_plat_blocked()
 
        if((self.spawnflags & 8) && (other.takedamage != DAMAGE_NO)) { // KIll Kill Kill!!
 #ifdef SVQC
-               Damage (other, self, self, 10000, DEATH_HURTTRIGGER, other.origin, '0 0 0');
+               Damage (other, self, self, 10000, DEATH_HURTTRIGGER.m_id, other.origin, '0 0 0');
 #endif
        }
        else
@@ -339,7 +339,7 @@ void door_generic_plat_blocked()
 
 #ifdef SVQC
                if((self.dmg) && (other.takedamage == DAMAGE_YES))    // Shall we bite?
-                       Damage (other, self, self, self.dmg, DEATH_HURTTRIGGER, other.origin, '0 0 0');
+                       Damage (other, self, self, self.dmg, DEATH_HURTTRIGGER.m_id, other.origin, '0 0 0');
 #endif
 
                 //Dont chamge direction for dead or dying stuff
@@ -358,7 +358,7 @@ void door_generic_plat_blocked()
                {
                        //gib dying stuff just to make sure
                        if((self.dmg) && (other.takedamage != DAMAGE_NO))    // Shall we bite?
-                               Damage (other, self, self, 10000, DEATH_HURTTRIGGER, other.origin, '0 0 0');
+                               Damage (other, self, self, 10000, DEATH_HURTTRIGGER.m_id, other.origin, '0 0 0');
                }
 #endif
        }
index 3b9996db6daea61a447dfa6005827d9f2cb1ff00..62af1094637cd4464af60c2763be17699d041dc8 100644 (file)
@@ -119,7 +119,7 @@ void misc_laser_think()
                        if(((self.spawnflags & 8) == 0) == (self.team != hitent.team))
                                return;
                if(hitent.takedamage)
-                       Damage(hitent, self, self, ((self.dmg < 0) ? 100000 : (self.dmg * frametime)), DEATH_HURTTRIGGER, hitloc, '0 0 0');
+                       Damage(hitent, self, self, ((self.dmg < 0) ? 100000 : (self.dmg * frametime)), DEATH_HURTTRIGGER.m_id, hitloc, '0 0 0');
        }
 }
 
index dc568cae09224c001b4b1ba5c61f48bb5dede01a..1c8a8bbad45766a10538139667d0bf5061077eaa 100644 (file)
@@ -5,13 +5,13 @@ void generic_plat_blocked()
        {
                if(self.dmgtime2 < time)
                {
-                       Damage (other, self, self, self.dmg, DEATH_HURTTRIGGER, other.origin, '0 0 0');
+                       Damage (other, self, self, self.dmg, DEATH_HURTTRIGGER.m_id, other.origin, '0 0 0');
                        self.dmgtime2 = time + self.dmgtime;
                }
 
                // Gib dead/dying stuff
                if(other.deadflag != DEAD_NO)
-                       Damage (other, self, self, 10000, DEATH_HURTTRIGGER, other.origin, '0 0 0');
+                       Damage (other, self, self, 10000, DEATH_HURTTRIGGER.m_id, other.origin, '0 0 0');
        }
 #endif
 }
@@ -150,7 +150,7 @@ void plat_crush()
        if((self.spawnflags & 4) && (other.takedamage != DAMAGE_NO))
        { // KIll Kill Kill!!
 #ifdef SVQC
-               Damage (other, self, self, 10000, DEATH_HURTTRIGGER, other.origin, '0 0 0');
+               Damage (other, self, self, 10000, DEATH_HURTTRIGGER.m_id, other.origin, '0 0 0');
 #endif
        }
        else
@@ -158,10 +158,10 @@ void plat_crush()
 #ifdef SVQC
                if((self.dmg) && (other.takedamage != DAMAGE_NO))
                {   // Shall we bite?
-                       Damage (other, self, self, self.dmg, DEATH_HURTTRIGGER, other.origin, '0 0 0');
+                       Damage (other, self, self, self.dmg, DEATH_HURTTRIGGER.m_id, other.origin, '0 0 0');
                        // Gib dead/dying stuff
                        if(other.deadflag != DEAD_NO)
-                               Damage (other, self, self, 10000, DEATH_HURTTRIGGER, other.origin, '0 0 0');
+                               Damage (other, self, self, 10000, DEATH_HURTTRIGGER.m_id, other.origin, '0 0 0');
                }
 #endif
 
index 94f2bd26bc99b897a88a45002f27a6a83a7b3f78..4cfa12ea51a3d35757357f00569b89deb728f452 100644 (file)
@@ -14,7 +14,7 @@
     #include "../../server/autocvars.qh"
     #include "../../server/constants.qh"
     #include "../../server/defs.qh"
-    #include "../deathtypes.qh"
+    #include "../deathtypes/all.qh"
     #include "../turrets/sv_turrets.qh"
     #include "../vehicles/all.qh"
     #include "../mapinfo.qh"
@@ -49,11 +49,11 @@ void tdeath(entity player, entity teleporter, entity telefragger, vector telefra
                                if(IS_PLAYER(head))
                                        if(head.health >= 1)
                                                ++tdeath_hit;
-                               Damage (head, teleporter, telefragger, 10000, DEATH_TELEFRAG, head.origin, '0 0 0');
+                               Damage (head, teleporter, telefragger, 10000, DEATH_TELEFRAG.m_id, head.origin, '0 0 0');
                        }
                }
                else // dead bodies and monsters gib themselves instead of telefragging
-                       Damage (telefragger, teleporter, telefragger, 10000, DEATH_TELEFRAG, telefragger.origin, '0 0 0');
+                       Damage (telefragger, teleporter, telefragger, 10000, DEATH_TELEFRAG.m_id, telefragger.origin, '0 0 0');
        }
 }
 
index 535ba8500d29743d138a27aca5ea980132110644..771b4f0648d0c0cc42b636135cadf564312ca78a 100644 (file)
@@ -34,7 +34,7 @@ void trigger_hurt_touch()
                                self.enemy = world; // I still hate you all
                        }
 
-                       Damage (other, self, own, self.dmg, DEATH_HURTTRIGGER, other.origin, '0 0 0');
+                       Damage (other, self, own, self.dmg, DEATH_HURTTRIGGER.m_id, other.origin, '0 0 0');
                }
        }
        else if(other.damagedbytriggers)
@@ -42,7 +42,7 @@ void trigger_hurt_touch()
                if(other.takedamage)
                {
                        EXACTTRIGGER_TOUCH;
-                       Damage(other, self, self, self.dmg, DEATH_HURTTRIGGER, other.origin, '0 0 0');
+                       Damage(other, self, self, self.dmg, DEATH_HURTTRIGGER.m_id, other.origin, '0 0 0');
                }
        }
 
index 2ae068d824f648bd3a98c776a708fbd23e1c018a..5e44c8077ffcd9f75c13f92431c7ffe43ac92b89 100644 (file)
@@ -5,7 +5,7 @@
     #include "../../../warpzonelib/util_server.qh"
     #include "../../weapons/all.qh"
     #include "../../../server/defs.qh"
-    #include "../../deathtypes.qh"
+    #include "../../deathtypes/all.qh"
 #endif
 
 /*
@@ -55,7 +55,7 @@ void swampslug_think(void)
        // Or we have exited it very recently.
        // Do the damage and renew the timer.
 #ifdef SVQC
-       Damage (self.owner, self, self, self.dmg, DEATH_SWAMP, other.origin, '0 0 0');
+       Damage (self.owner, self, self, self.dmg, DEATH_SWAMP.m_id, other.origin, '0 0 0');
 #endif
 
        self.nextthink = time + self.swamp_interval;
index 86444bb486a5c972faf03c8fc3d38b807a09c026..34e5a598689d7fd9e8d0e00163b48d2ffc397c22 100644 (file)
@@ -31,7 +31,7 @@ METHOD(EWheelAttack, wr_think, void(entity thiswep, entity actor, bool fire1, bo
 
         turret_do_updates(actor);
 
-        entity missile = turret_projectile(SND(LASERGUN_FIRE), 1, 0, DEATH_TURRET_EWHEEL, PROJECTILE_BLASTER, true, true);
+        entity missile = turret_projectile(SND(LASERGUN_FIRE), 1, 0, DEATH_TURRET_EWHEEL.m_id, PROJECTILE_BLASTER, true, true);
         missile.missile_flags = MIF_SPLASH;
 
         Send_Effect(EFFECT_BLASTER_MUZZLEFLASH, actor.tur_shotorg, actor.tur_shotdir_updated * 1000, 1);
index 4c60805d266c77d19b3e71df6d3a31e30d6cc456..834f255dae95375d5cd7232f5dc43598d26be223 100644 (file)
@@ -32,7 +32,7 @@ METHOD(FlacAttack, wr_think, void(entity thiswep, entity actor, bool fire1, bool
 
         turret_tag_fire_update();
 
-        entity proj = turret_projectile(SND(HAGAR_FIRE), 5, 0, DEATH_TURRET_FLAC, PROJECTILE_HAGAR, true, true);
+        entity proj = turret_projectile(SND(HAGAR_FIRE), 5, 0, DEATH_TURRET_FLAC.m_id, PROJECTILE_HAGAR, true, true);
         proj.missile_flags = MIF_SPLASH | MIF_PROXY;
         proj.think       = turret_flac_projectile_think_explode;
         proj.nextthink  = time + actor.tur_impacttime + (random() * 0.01 - random() * 0.01);
index 491fa734ed61b750172cdb8d00954c9cdef27221..2d754e877d0396951cc5173c125bcefe269c3c96 100644 (file)
@@ -39,7 +39,7 @@ METHOD(HellionAttack, wr_think, void(entity thiswep, entity actor, bool fire1, b
                 actor.tur_shotorg = gettaginfo(actor.tur_head, gettagindex(actor.tur_head, "tag_fire2"));
         }
 
-        entity missile = turret_projectile(SND(ROCKET_FIRE), 6, 10, DEATH_TURRET_HELLION, PROJECTILE_ROCKET, FALSE, FALSE);
+        entity missile = turret_projectile(SND(ROCKET_FIRE), 6, 10, DEATH_TURRET_HELLION.m_id, PROJECTILE_ROCKET, FALSE, FALSE);
         te_explosion (missile.origin);
         missile.think          = turret_hellion_missile_think;
         missile.nextthink      = time;
index 9fe73f830631a8d1353b02e7fbf2422899dcbffa..98bff57575a181011906ceeedfb8c31742bfc3bb 100644 (file)
@@ -36,7 +36,7 @@ METHOD(HunterKillerAttack, wr_think, void(entity thiswep, entity actor, bool fir
             actor.tur_head = actor;
             weapon_thinkf(actor, WFRAME_FIRE1, WEP_CVAR_PRI(electro, animtime), w_ready);
         }
-        entity missile = turret_projectile(SND(ROCKET_FIRE), 6, 10, DEATH_TURRET_HK, PROJECTILE_ROCKET, FALSE, FALSE);
+        entity missile = turret_projectile(SND(ROCKET_FIRE), 6, 10, DEATH_TURRET_HK.m_id, PROJECTILE_ROCKET, FALSE, FALSE);
         te_explosion (missile.origin);
 
         missile.think = turret_hk_missile_think;
index 9b14898298b6c2202c667d83f1ad77e045c5313f..a20bdb22cf051cb3446bf6728a7514e17a940fd1 100644 (file)
@@ -30,7 +30,7 @@ METHOD(MachineGunTurretAttack, wr_think, void(entity thiswep, entity actor, bool
             actor.tur_head = actor;
             weapon_thinkf(actor, WFRAME_FIRE1, 0, w_ready);
         }
-        fireBullet (actor.tur_shotorg, actor.tur_shotdir_updated, actor.shot_spread, 0, actor.shot_dmg, actor.shot_force, DEATH_TURRET_MACHINEGUN, 0);
+        fireBullet (actor.tur_shotorg, actor.tur_shotdir_updated, actor.shot_spread, 0, actor.shot_dmg, actor.shot_force, DEATH_TURRET_MACHINEGUN.m_id, 0);
         W_MachineGun_MuzzleFlash();
         setattachment(actor.muzzle_flash, actor.tur_head, "tag_fire");
     }
index 3b420f32916fac2297d1031a49bd695fbd5d2e2d..05933591364da90799e92292d5e8471bd241e8b5 100644 (file)
@@ -30,7 +30,7 @@ METHOD(MLRSTurretAttack, wr_think, void(entity thiswep, entity actor, bool fire1
             weapon_thinkf(actor, WFRAME_FIRE1, 0, w_ready);
         }
         turret_tag_fire_update();
-        entity missile = turret_projectile(SND(ROCKET_FIRE), 6, 10, DEATH_TURRET_MLRS, PROJECTILE_ROCKET, TRUE, TRUE);
+        entity missile = turret_projectile(SND(ROCKET_FIRE), 6, 10, DEATH_TURRET_MLRS.m_id, PROJECTILE_ROCKET, TRUE, TRUE);
         missile.nextthink = time + max(actor.tur_impacttime,(actor.shot_radius * 2) / actor.shot_speed);
         missile.missile_flags = MIF_SPLASH;
         te_explosion (missile.origin);
index 2cb036bc557582cc1dca9ef80da2c21f0f7f5d77..c4529ae267b872c47da45fda096208d4331a8d21 100644 (file)
@@ -95,7 +95,7 @@ void beam_think()
                     self.shot_force,
                     this.shot_dmg,
                     0.75,
-                    DEATH_TURRET_PHASER);
+                    DEATH_TURRET_PHASER.m_id);
     setself(this);
     self.scale = vlen(self.owner.tur_shotorg - trace_endpos) / 256;
 
index 7c40299aa3a55ea139aedec8bc23b721384dbaf1..318f4e8ae69e2e31f28d33434fb26dde9e1841c2 100644 (file)
@@ -31,7 +31,7 @@ METHOD(PlasmaTurret, tr_attack, void(PlasmaTurret this))
     if(g_instagib)
     {
         FireRailgunBullet (self.tur_shotorg, self.tur_shotorg + self.tur_shotdir_updated * MAX_SHOT_DISTANCE, 10000000000,
-                           800, 0, 0, 0, 0, DEATH_TURRET_PLASMA);
+                           800, 0, 0, 0, 0, DEATH_TURRET_PLASMA.m_id);
 
         Send_Effect(EFFECT_VORTEX_MUZZLEFLASH, self.tur_shotorg, self.tur_shotdir_updated * 1000, 1);
 
index e1143bc04803ea6877599567d76ad94e97e3ffcb..387ae44a594dc8f851b06d85834f119d092ca5a5 100644 (file)
@@ -32,7 +32,7 @@ METHOD(DualPlasmaTurret, tr_attack, void(DualPlasmaTurret this))
 {
     if (g_instagib) {
         FireRailgunBullet (self.tur_shotorg, self.tur_shotorg + self.tur_shotdir_updated * MAX_SHOT_DISTANCE, 10000000000,
-                           800, 0, 0, 0, 0, DEATH_TURRET_PLASMA);
+                           800, 0, 0, 0, 0, DEATH_TURRET_PLASMA.m_id);
 
 
         Send_Effect(EFFECT_VORTEX_MUZZLEFLASH, self.tur_shotorg, self.tur_shotdir_updated * 1000, 1);
index 65a663057402da9b8fcf7162d25c5a4800544809..2141fe64f287daed129b5de618f1b6fdf5e56a66 100644 (file)
@@ -27,7 +27,7 @@ METHOD(PlasmaAttack, wr_think, void(entity thiswep, entity actor, bool fire1, bo
             actor.tur_head = actor;
             weapon_thinkf(actor, WFRAME_FIRE1, WEP_CVAR_PRI(electro, animtime), w_ready);
         }
-        entity missile = turret_projectile(SND(HAGAR_FIRE), 1, 0, DEATH_TURRET_PLASMA, PROJECTILE_ELECTRO_BEAM, true, true);
+        entity missile = turret_projectile(SND(HAGAR_FIRE), 1, 0, DEATH_TURRET_PLASMA.m_id, PROJECTILE_ELECTRO_BEAM, true, true);
         missile.missile_flags = MIF_SPLASH;
         Send_Effect(EFFECT_BLASTER_MUZZLEFLASH, actor.tur_shotorg, actor.tur_shotdir_updated * 1000, 1);
        }
index 3a8eb1d52bb84426527f695af313bf261c8ac835..4391472f739b06e7c97c6b3e7f9cb781e2cfa96a 100644 (file)
@@ -96,7 +96,7 @@ entity toast(entity from, float range, float damage)
     if (etarget)
     {
         te_csqc_lightningarc(from.origin,etarget.origin);
-        Damage(etarget, self, self, damage, DEATH_TURRET_TESLA, etarget.origin, '0 0 0');
+        Damage(etarget, self, self, damage, DEATH_TURRET_TESLA.m_id, etarget.origin, '0 0 0');
         etarget.railgunhit = 1;
     }
 
index e629ada79853f2a31a96aa27ee334d9f84fa6de0..cbdeb5e8e704e3b08fe36c856b7f5500164d2207 100644 (file)
@@ -88,7 +88,7 @@ void walker_melee_do_dmg()
     {
         if (turret_validate_target(self, e, self.target_validate_flags))
             if (e != self && e.owner != self)
-                Damage(e, self, self, (autocvar_g_turrets_unit_walker_melee_damage), DEATH_TURRET_WALK_MELEE, '0 0 0', v_forward * (autocvar_g_turrets_unit_walker_melee_force));
+                Damage(e, self, self, (autocvar_g_turrets_unit_walker_melee_damage), DEATH_TURRET_WALK_MELEE.m_id, '0 0 0', v_forward * (autocvar_g_turrets_unit_walker_melee_force));
 
         e = e.chain;
     }
@@ -101,7 +101,7 @@ void walker_setnoanim()
 }
 void walker_rocket_explode()
 {SELFPARAM();
-    RadiusDamage (self, self.owner, (autocvar_g_turrets_unit_walker_rocket_damage), 0, (autocvar_g_turrets_unit_walker_rocket_radius), self, world, (autocvar_g_turrets_unit_walker_rocket_force), DEATH_TURRET_WALK_ROCKET, world);
+    RadiusDamage (self, self.owner, (autocvar_g_turrets_unit_walker_rocket_damage), 0, (autocvar_g_turrets_unit_walker_rocket_radius), self, world, (autocvar_g_turrets_unit_walker_rocket_force), DEATH_TURRET_WALK_ROCKET.m_id, world);
     remove (self);
 }
 
index 9a54f810f55237cb95bc3b16dcc700234be2c47f..4da45df7fd203ecf894c5b8d990cb086b36a1ae9 100644 (file)
@@ -28,7 +28,7 @@ METHOD(WalkerTurretAttack, wr_think, void(entity thiswep, entity actor, bool fir
             weapon_thinkf(actor, WFRAME_FIRE1, WEP_CVAR_PRI(electro, animtime), w_ready);
         }
         sound (actor, CH_WEAPON_A, SND_UZI_FIRE, VOL_BASE, ATTEN_NORM);
-        fireBullet (actor.tur_shotorg, actor.tur_shotdir_updated, actor.shot_spread, 0, actor.shot_dmg, actor.shot_force, DEATH_TURRET_WALK_GUN, 0);
+        fireBullet (actor.tur_shotorg, actor.tur_shotdir_updated, actor.shot_spread, 0, actor.shot_dmg, actor.shot_force, DEATH_TURRET_WALK_GUN.m_id, 0);
         Send_Effect(EFFECT_BLASTER_MUZZLEFLASH, actor.tur_shotorg, actor.tur_shotdir_updated * 1000, 1);
     }
 }
index ad9be12cbab8b5bf7773429f72d30ba6733a3d88..d1267460c0a43b90622b2490f2a337d056a189b6 100644 (file)
 #define GETTER(type, name) type GET(name)() { return name; }
 
 #define BIT(n) (1 << (n))
+#define BITS(n) (BIT(n) - 1)
 #ifndef BRANCHLESS_BITSET
     #define BITSET(var, mask, flag) (flag ? (var) | (mask) : (var) &~ (mask))
 #else
index 4b6a346ff34af56b9766b9088d1b98c9818c01bd..123dc5062d46ed1e7cc80e3c517649c3120edc3c 100644 (file)
@@ -7,7 +7,7 @@
        #include "../client/mutators/events.qh"
     #include "mapinfo.qh"
     #include "notifications.qh"
-    #include "deathtypes.qh"
+    #include "deathtypes/all.qh"
 #elif defined(MENUQC)
 #elif defined(SVQC)
        #include "../dpdefs/progsdefs.qh"
@@ -17,7 +17,7 @@
     #include "../server/defs.qh"
        #include "../server/mutators/events.qh"
     #include "notifications.qh"
-    #include "deathtypes.qh"
+    #include "deathtypes/all.qh"
     #include "mapinfo.qh"
 #endif
 
@@ -1766,7 +1766,7 @@ vector healtharmor_maxdamage(float h, float a, float armorblock, int deathtype)
 {
        // NOTE: we'll always choose the SMALLER value...
        float healthdamage, armordamage, armorideal;
-       if (deathtype == DEATH_DROWN)  // Why should armor help here...
+       if (DEATH_IS(deathtype, DEATH_DROWN))  // Why should armor help here...
                armorblock = 0;
        vector v;
        healthdamage = (h - 1) / (1 - armorblock); // damage we can take if we could use more health
@@ -1789,7 +1789,7 @@ vector healtharmor_maxdamage(float h, float a, float armorblock, int deathtype)
 vector healtharmor_applydamage(float a, float armorblock, int deathtype, float damage)
 {
        vector v;
-       if (deathtype == DEATH_DROWN)  // Why should armor help here...
+       if (DEATH_IS(deathtype, DEATH_DROWN))  // Why should armor help here...
                armorblock = 0;
        v.y = bound(0, damage * armorblock, a); // save
        v.x = bound(0, damage - v.y, damage); // take
index c2e41dd9417a8857444f91b68cf24926dfc02b77..8727298991371aba37755ee0c2e049f83e2291af 100644 (file)
@@ -654,22 +654,22 @@ void vehicles_damage(entity inflictor, entity attacker, float damage, int deatht
        self.dmg_time = time;
 
        // WEAPONTODO
-       if(DEATH_ISWEAPON(deathtype, WEP_VORTEX.m_id))
+       if(DEATH_ISWEAPON(deathtype, WEP_VORTEX))
                damage *= autocvar_g_vehicles_vortex_damagerate;
 
-       if(DEATH_ISWEAPON(deathtype, WEP_MACHINEGUN.m_id))
+       if(DEATH_ISWEAPON(deathtype, WEP_MACHINEGUN))
                damage *= autocvar_g_vehicles_machinegun_damagerate;
 
-       if(DEATH_ISWEAPON(deathtype, WEP_RIFLE.m_id))
+       if(DEATH_ISWEAPON(deathtype, WEP_RIFLE))
                damage *= autocvar_g_vehicles_rifle_damagerate;
 
-       if(DEATH_ISWEAPON(deathtype, WEP_VAPORIZER.m_id))
+       if(DEATH_ISWEAPON(deathtype, WEP_VAPORIZER))
                damage *= autocvar_g_vehicles_vaporizer_damagerate;
 
-       if(DEATH_ISWEAPON(deathtype, WEP_SEEKER.m_id))
+       if(DEATH_ISWEAPON(deathtype, WEP_SEEKER))
                damage *= autocvar_g_vehicles_tag_damagerate;
 
-       if(DEATH_WEAPONOFWEAPONDEATH(deathtype))
+       if(DEATH_WEAPONOF(deathtype) != WEP_Null)
                damage *= autocvar_g_vehicles_weapon_damagerate;
 
        self.enemy = attacker;
@@ -767,7 +767,7 @@ void vehicles_impact(float _minspeed, float _speedfac, float _maxpain)
                if(_minspeed < wc)
                {
                        float take = min(_speedfac * wc, _maxpain);
-                       Damage (self, world, world, take, DEATH_FALL, self.origin, '0 0 0');
+                       Damage (self, world, world, take, DEATH_FALL.m_id, self.origin, '0 0 0');
                        self.play_time = time + 0.25;
 
                        //dprint("wc: ", ftos(wc), "\n");
@@ -938,7 +938,7 @@ void vehicles_touch()
                if(vehicles_crushable(other))
                {
                        if(vlen(self.velocity) >= 30)
-                               Damage(other, self, self.owner, autocvar_g_vehicles_crush_dmg, DEATH_VH_CRUSH, '0 0 0', normalize(other.origin - self.origin) * autocvar_g_vehicles_crush_force);
+                               Damage(other, self, self.owner, autocvar_g_vehicles_crush_dmg, DEATH_VH_CRUSH.m_id, '0 0 0', normalize(other.origin - self.origin) * autocvar_g_vehicles_crush_force);
 
                        return; // Dont do selfdamage when hitting "soft targets".
                }
index b64ac0203171753c8c1e2a2e6944716d2ebadbc1..45003cb296be367db3ebdf7c597add364db397d0 100644 (file)
@@ -557,7 +557,7 @@ float bumblebee_pilot_frame()
                {
                        if(autocvar_g_vehicle_bumblebee_raygun)
                        {
-                               Damage(trace_ent, vehic, pilot, autocvar_g_vehicle_bumblebee_raygun_dps * sys_frametime, DEATH_GENERIC, trace_endpos, v_forward * autocvar_g_vehicle_bumblebee_raygun_fps * sys_frametime);
+                               Damage(trace_ent, vehic, pilot, autocvar_g_vehicle_bumblebee_raygun_dps * sys_frametime, DEATH_GENERIC.m_id, trace_endpos, v_forward * autocvar_g_vehicle_bumblebee_raygun_fps * sys_frametime);
                                vehic.vehicle_energy -= autocvar_g_vehicle_bumblebee_raygun_aps * sys_frametime;
                        }
                        else
@@ -698,7 +698,7 @@ void bumblebee_blowup()
                                 autocvar_g_vehicle_bumblebee_blowup_edgedamage,
                                 autocvar_g_vehicle_bumblebee_blowup_radius, self, world,
                                 autocvar_g_vehicle_bumblebee_blowup_forceintensity,
-                                DEATH_VH_BUMB_DEATH, world);
+                                DEATH_VH_BUMB_DEATH.m_id, world);
 
        sound(self, CH_SHOTS, SND_ROCKET_IMPACT, VOL_BASE, ATTEN_NORM);
        Send_Effect(EFFECT_EXPLOSION_BIG, (self.origin + '0 0 100') + (randomvec() * 80), '0 0 0', 1);
index 79252e13cbb2401c5557d405625e16f8bf2c2381..722c6852e7ddf56d66844cdcc14b8de294c95a7e 100644 (file)
@@ -25,7 +25,7 @@ void bumblebee_fire_cannon(entity _gun, string _tagname, entity _owner)
     vehicles_projectile(EFFECT_BIGPLASMA_MUZZLEFLASH.eent_eff_name, SND(VEH_BUMBLEBEE_FIRE),
                         v, normalize(v_forward + randomvec() * autocvar_g_vehicle_bumblebee_cannon_spread) * autocvar_g_vehicle_bumblebee_cannon_speed,
                         autocvar_g_vehicle_bumblebee_cannon_damage, autocvar_g_vehicle_bumblebee_cannon_radius, autocvar_g_vehicle_bumblebee_cannon_force,  0,
-                        DEATH_VH_BUMB_GUN, PROJECTILE_BUMBLE_GUN, 0, true, true, _owner);
+                        DEATH_VH_BUMB_GUN.m_id, PROJECTILE_BUMBLE_GUN, 0, true, true, _owner);
 }
 
 bool bumble_raygun_send(entity this, entity to, float sf)
index 2b5950a259e8e780c6ae3a12fec2c654105a464e..d860dba11061533968ee88862480d2ab9d1efa31 100644 (file)
@@ -482,7 +482,7 @@ void racer_blowup()
                                        autocvar_g_vehicle_racer_blowup_edgedamage,
                                        autocvar_g_vehicle_racer_blowup_radius, world, world,
                                        autocvar_g_vehicle_racer_blowup_forceintensity,
-                                       DEATH_VH_WAKI_DEATH, world);
+                                       DEATH_VH_WAKI_DEATH.m_id, world);
 
        self.nextthink  = time + autocvar_g_vehicle_racer_respawntime;
        self.think        = vehicles_spawn;
index d5a4c1231089ae846c2fe06be2ee4f5ed5646421..6a2339f1e3a4878bee67a59657113595064faae7 100644 (file)
@@ -59,7 +59,7 @@ METHOD(RacerAttack, wr_think, void(entity thiswep, entity actor, bool fire1, boo
         entity bolt = vehicles_projectile(EFFECT_RACER_MUZZLEFLASH.eent_eff_name, SND(LASERGUN_FIRE),
                                org, normalize(v_forward + randomvec() * autocvar_g_vehicle_racer_cannon_spread) * autocvar_g_vehicle_racer_cannon_speed,
                                autocvar_g_vehicle_racer_cannon_damage, autocvar_g_vehicle_racer_cannon_radius, autocvar_g_vehicle_racer_cannon_force,  0,
-                               DEATH_VH_WAKI_GUN, PROJECTILE_WAKICANNON, 0, true, true, player);
+                               DEATH_VH_WAKI_GUN.m_id, PROJECTILE_WAKICANNON, 0, true, true, player);
         bolt.velocity = normalize(dir) * autocvar_g_vehicle_racer_cannon_speed;
         weapon_thinkf(player, WFRAME_FIRE1, 0, w_ready);
     }
@@ -88,7 +88,7 @@ void racer_fire_rocket(vector org, vector dir, entity trg)
     entity rocket = vehicles_projectile(EFFECT_RACER_ROCKETLAUNCH.eent_eff_name, SND(ROCKET_FIRE),
                            org, dir * autocvar_g_vehicle_racer_rocket_speed,
                            autocvar_g_vehicle_racer_rocket_damage, autocvar_g_vehicle_racer_rocket_radius, autocvar_g_vehicle_racer_rocket_force, 3,
-                           DEATH_VH_WAKI_ROCKET, PROJECTILE_WAKIROCKET, 20, false, false, self.owner);
+                           DEATH_VH_WAKI_ROCKET.m_id, PROJECTILE_WAKIROCKET, 20, false, false, self.owner);
 
     rocket.lip                   = autocvar_g_vehicle_racer_rocket_accel * sys_frametime;
     rocket.wait                         = autocvar_g_vehicle_racer_rocket_turnrate;
index 1f623379e55d1c1d50224bb0e66278e655caadea..1c5c85b8d7a1bc3fd0865b1c4f83516b9214d432 100644 (file)
@@ -524,7 +524,7 @@ void raptor_blowup()
 {SELFPARAM();
        self.deadflag   = DEAD_DEAD;
        self.vehicle_exit(VHEF_NORMAL);
-       RadiusDamage (self, self.enemy, 250, 15, 250, world, world, 250, DEATH_VH_RAPT_DEATH, world);
+       RadiusDamage (self, self.enemy, 250, 15, 250, world, world, 250, DEATH_VH_RAPT_DEATH.m_id, world);
 
        self.alpha                = -1;
        self.movetype      = MOVETYPE_NONE;
index 9c2fd0e5f15a0e4c4212edc71aca6e34ff3c82e1..c53002bd4480516a6d7aa5284e3195661b6160c9 100644 (file)
@@ -73,7 +73,7 @@ METHOD(RaptorCannon, wr_think, void(entity thiswep, entity actor, bool fire1, bo
         vehicles_projectile(EFFECT_RAPTOR_MUZZLEFLASH.eent_eff_name, SND(LASERGUN_FIRE),
                                org, normalize(dir + randomvec() * autocvar_g_vehicle_raptor_cannon_spread) * autocvar_g_vehicle_raptor_cannon_speed,
                                autocvar_g_vehicle_raptor_cannon_damage, autocvar_g_vehicle_raptor_cannon_radius, autocvar_g_vehicle_raptor_cannon_force,  0,
-                               DEATH_VH_RAPT_CANNON, PROJECTILE_RAPTORCANNON, 0, true, true, veh ? veh : player);
+                               DEATH_VH_RAPT_CANNON.m_id, PROJECTILE_RAPTORCANNON, 0, true, true, veh ? veh : player);
         weapon_thinkf(player, WFRAME_FIRE1, 0, w_ready);
     }
 }
@@ -144,7 +144,7 @@ void raptor_bomblet_boom()
     RadiusDamage (self, self.realowner, autocvar_g_vehicle_raptor_bomblet_damage,
                                     autocvar_g_vehicle_raptor_bomblet_edgedamage,
                                     autocvar_g_vehicle_raptor_bomblet_radius, world, world,
-                                    autocvar_g_vehicle_raptor_bomblet_force, DEATH_VH_RAPT_BOMB, world);
+                                    autocvar_g_vehicle_raptor_bomblet_force, DEATH_VH_RAPT_BOMB.m_id, world);
     remove(self);
 }
 
@@ -175,7 +175,7 @@ void raptor_bomb_burst()
     entity bomblet;
     float i;
 
-    Damage_DamageInfo(self.origin, 0, 0, 0, '0 0 0', DEATH_VH_RAPT_FRAGMENT, 0, self);
+    Damage_DamageInfo(self.origin, 0, 0, 0, '0 0 0', DEATH_VH_RAPT_FRAGMENT.m_id, 0, self);
 
     for(i = 0; i < autocvar_g_vehicle_raptor_bomblets; ++i)
     {
index ee79966ef3ae81cd0ea5b0aabd7cd839226440c9..cf1be2432c92e339b12c914d75bc62131a834ea9 100644 (file)
@@ -291,7 +291,7 @@ float spiderbot_frame()
                        v += v_forward * 50;
 
                        fireBullet(v, v_forward, autocvar_g_vehicle_spiderbot_minigun_spread, autocvar_g_vehicle_spiderbot_minigun_solidpenetration,
-                                autocvar_g_vehicle_spiderbot_minigun_damage, autocvar_g_vehicle_spiderbot_minigun_force, DEATH_VH_SPID_MINIGUN, 0);
+                                autocvar_g_vehicle_spiderbot_minigun_damage, autocvar_g_vehicle_spiderbot_minigun_force, DEATH_VH_SPID_MINIGUN.m_id, 0);
 
                        sound (gun, CH_WEAPON_A, SND_UZI_FIRE, VOL_BASE, ATTEN_NORM);
                        //trailparticles(self, _particleeffectnum("spiderbot_minigun_trail"), v, trace_endpos);
@@ -483,7 +483,7 @@ void spiderbot_blowup()
        SUB_SetFade(g1, time, min(self.respawntime, 10));
        SUB_SetFade(g2, time, min(self.respawntime, 10));
 
-       RadiusDamage (self, self.enemy, 250, 15, 250, world, world, 250, DEATH_VH_SPID_DEATH, world);
+       RadiusDamage (self, self.enemy, 250, 15, 250, world, world, 250, DEATH_VH_SPID_DEATH.m_id, world);
 
        self.alpha = self.tur_head.alpha = self.gun1.alpha = self.gun2.alpha = -1;
        self.movetype = MOVETYPE_NONE;
index 0960fca2a6c7b99ba30560f7beaaec94ecd7812e..421a15a910b1cbdd700ab346db89fa67241b2427 100644 (file)
@@ -219,7 +219,7 @@ void spiderbot_rocket_do()
             rocket = vehicles_projectile(EFFECT_SPIDERBOT_ROCKETLAUNCH.eent_eff_name, SND(ROCKET_FIRE),
                                    v, normalize(randomvec() * autocvar_g_vehicle_spiderbot_rocket_spread + v_forward) * autocvar_g_vehicle_spiderbot_rocket_speed,
                                    autocvar_g_vehicle_spiderbot_rocket_damage, autocvar_g_vehicle_spiderbot_rocket_radius, autocvar_g_vehicle_spiderbot_rocket_force, 1,
-                                   DEATH_VH_SPID_ROCKET, PROJECTILE_SPIDERROCKET, autocvar_g_vehicle_spiderbot_rocket_health, false, true, self.owner);
+                                   DEATH_VH_SPID_ROCKET.m_id, PROJECTILE_SPIDERROCKET, autocvar_g_vehicle_spiderbot_rocket_health, false, true, self.owner);
             crosshair_trace(self.owner);
             float _dist = (random() * autocvar_g_vehicle_spiderbot_rocket_radius) + vlen(v - trace_endpos);
             _dist -= (random() * autocvar_g_vehicle_spiderbot_rocket_radius) ;
@@ -233,7 +233,7 @@ void spiderbot_rocket_do()
             rocket = vehicles_projectile(EFFECT_SPIDERBOT_ROCKETLAUNCH.eent_eff_name, SND(ROCKET_FIRE),
                                    v, normalize(v_forward) * autocvar_g_vehicle_spiderbot_rocket_speed,
                                    autocvar_g_vehicle_spiderbot_rocket_damage, autocvar_g_vehicle_spiderbot_rocket_radius, autocvar_g_vehicle_spiderbot_rocket_force, 1,
-                                   DEATH_VH_SPID_ROCKET, PROJECTILE_SPIDERROCKET, autocvar_g_vehicle_spiderbot_rocket_health, false, false, self.owner);
+                                   DEATH_VH_SPID_ROCKET.m_id, PROJECTILE_SPIDERROCKET, autocvar_g_vehicle_spiderbot_rocket_health, false, false, self.owner);
             crosshair_trace(self.owner);
             rocket.pos1           = trace_endpos;
             rocket.nextthink  = time;
@@ -245,7 +245,7 @@ void spiderbot_rocket_do()
             rocket = vehicles_projectile(EFFECT_SPIDERBOT_ROCKETLAUNCH.eent_eff_name, SND(ROCKET_FIRE),
                                    v, normalize(v_forward) * autocvar_g_vehicle_spiderbot_rocket_speed,
                                    autocvar_g_vehicle_spiderbot_rocket_damage, autocvar_g_vehicle_spiderbot_rocket_radius, autocvar_g_vehicle_spiderbot_rocket_force, 1,
-                                   DEATH_VH_SPID_ROCKET, PROJECTILE_SPIDERROCKET, autocvar_g_vehicle_spiderbot_rocket_health, false, true, self.owner);
+                                   DEATH_VH_SPID_ROCKET.m_id, PROJECTILE_SPIDERROCKET, autocvar_g_vehicle_spiderbot_rocket_health, false, true, self.owner);
 
             crosshair_trace(self.owner);
 
index 2c72d380fcc8db9274203062ce8685de3882fad6..57e46bd5c3e49ad511f37c8104e490038a1c3f9f 100644 (file)
@@ -14,7 +14,7 @@
        #include "../util.qh"
        #include "../buffs/all.qh"
        #include "../../client/autocvars.qh"
-       #include "../deathtypes.qh"
+       #include "../deathtypes/all.qh"
        #include "../../csqcmodellib/interpolate.qh"
        #include "../movetypes/movetypes.qh"
        #include "../../client/main.qh"
@@ -41,7 +41,7 @@
     #include "../../server/constants.qh"
     #include "../../server/defs.qh"
     #include "../notifications.qh"
-    #include "../deathtypes.qh"
+    #include "../deathtypes/all.qh"
     #include "../../server/mutators/mutators_include.qh"
     #include "../mapinfo.qh"
     #include "../../server/command/common.qh"
index 9912174dd8d17a5a024fd8ac9e77f5340e839b49..7ecacb29a1f0828b7813c5956589138990ae3613 100644 (file)
@@ -10,7 +10,7 @@
 #include "weapons/tracing.qh"
 
 #include "../common/constants.qh"
-#include "../common/deathtypes.qh"
+#include "../common/deathtypes/all.qh"
 #include "../common/effects/effects.qh"
 #include "../common/util.qh"
 
@@ -287,7 +287,7 @@ float CheatImpulse(float i)
 
                        e2 = spawn();
                        setorigin(e2, e.origin);
-                       RadiusDamage(e2, self, 1000, 0, 128, world, world, 500, DEATH_CHEAT, e);
+                       RadiusDamage(e2, self, 1000, 0, 128, world, world, 500, DEATH_CHEAT.m_id, e);
                        remove(e2);
 
                        LOG_INFO("404 Sportsmanship not found.\n");
index 0d0d356a9da379ad579963386d814a4608c7bae3..5611807342424ca0a70efba6d731a30a5a9f8027 100644 (file)
@@ -811,7 +811,7 @@ void ClientKill_Now()
            if(!self.killindicator_teamchange)
            {
             self.vehicle_health = -1;
-            Damage(self, self, self, 1 , DEATH_KILL, self.origin, '0 0 0');
+            Damage(self, self, self, 1 , DEATH_KILL.m_id, self.origin, '0 0 0');
            }
        }
 
@@ -824,7 +824,7 @@ void ClientKill_Now()
                ClientKill_Now_TeamChange();
 
        if(IS_PLAYER(self))
-               Damage(self, self, self, 100000, DEATH_KILL, self.origin, '0 0 0');
+               Damage(self, self, self, 100000, DEATH_KILL.m_id, self.origin, '0 0 0');
 
        // now I am sure the player IS dead
 }
@@ -1658,7 +1658,7 @@ void player_regen (void)
        {
                if(self.vehicle)
                        vehicles_exit(VHEF_RELEASE);
-               self.event_damage(self, self, 1, DEATH_ROT, self.origin, '0 0 0');
+               self.event_damage(self, self, 1, DEATH_ROT.m_id, self.origin, '0 0 0');
        }
 
        if (!(self.items & IT_UNLIMITED_WEAPON_AMMO))
@@ -2358,7 +2358,7 @@ void PlayerPreThink (void)
                {
                        if(self.vehicle)
                                vehicles_exit(VHEF_RELEASE);
-                       self.event_damage(self, self.frozen_by, 1, DEATH_NADE_ICE_FREEZE, self.origin, '0 0 0');
+                       self.event_damage(self, self.frozen_by, 1, DEATH_NADE_ICE_FREEZE.m_id, self.origin, '0 0 0');
                }
                else if ( self.revive_progress <= 0 )
                        Unfreeze(self);
@@ -2714,7 +2714,7 @@ void PlayerPostThink (void)
        */
 
        if(self.waypointsprite_attachedforcarrier)
-               WaypointSprite_UpdateHealth(self.waypointsprite_attachedforcarrier, '1 0 0' * healtharmor_maxdamage(self.health, self.armorvalue, autocvar_g_balance_armor_blockpercent, DEATH_WEAPON));
+               WaypointSprite_UpdateHealth(self.waypointsprite_attachedforcarrier, '1 0 0' * healtharmor_maxdamage(self.health, self.armorvalue, autocvar_g_balance_armor_blockpercent, DEATH_WEAPON.m_id));
 
        playerdemo_write();
 
index e94ba628323711d0b469eaa0af9ba060788ebdfd..9e7f8a14b695e0f3c339c3db8d87568c9a3dc9c4 100644 (file)
@@ -13,7 +13,7 @@
 #include "command/common.qh"
 #include "../common/animdecide.qh"
 #include "../common/csqcmodel_settings.qh"
-#include "../common/deathtypes.qh"
+#include "../common/deathtypes/all.qh"
 #include "../common/triggers/subs.qh"
 #include "../common/playerstats.qh"
 #include "../csqcmodellib/sv_model.qh"
@@ -323,7 +323,7 @@ void PlayerDamage (entity inflictor, entity attacker, float damage, int deathtyp
                        damage /= sqrt(bound(1.0, attacker.cvar_cl_handicap, 100.0));
        }
 
-       if(DEATH_ISWEAPON(deathtype, WEP_TUBA.m_id))
+       if(DEATH_ISWEAPON(deathtype, WEP_TUBA))
        {
                // tuba causes blood to come out of the ears
                vector ear1, ear2;
@@ -434,11 +434,11 @@ void PlayerDamage (entity inflictor, entity attacker, float damage, int deathtyp
                                        }
 
                                        if(sound_allowed(MSG_BROADCAST, attacker))
-                                       if((self.health < 2 * WEP_CVAR_PRI(blaster, damage) * autocvar_g_balance_selfdamagepercent + 1) || !((get_weaponinfo(DEATH_WEAPONOF(deathtype))).spawnflags & WEP_FLAG_CANCLIMB) || attacker != self) // WEAPONTODO: create separate limit for pain notification with laser
+                                       if((self.health < 2 * WEP_CVAR_PRI(blaster, damage) * autocvar_g_balance_selfdamagepercent + 1) || !(DEATH_WEAPONOF(deathtype).spawnflags & WEP_FLAG_CANCLIMB) || attacker != self) // WEAPONTODO: create separate limit for pain notification with laser
                                        if(self.health > 1)
                                        // exclude pain sounds for laserjumps as long as you aren't REALLY low on health and would die of the next two
                                        {
-                                               if(deathtype == DEATH_FALL)
+                                               if(deathtype == DEATH_FALL.m_id)
                                                        PlayerSound(playersound_fall, CH_PAIN, VOICETYPE_PLAYERSOUND);
                                                else if(self.health > 75) // TODO make a "gentle" version?
                                                        PlayerSound(playersound_pain100, CH_PAIN, VOICETYPE_PLAYERSOUND);
@@ -469,12 +469,12 @@ void PlayerDamage (entity inflictor, entity attacker, float damage, int deathtyp
        self.dmg_take = self.dmg_take + take;//max(take - 10, 0);
        self.dmg_inflictor = inflictor;
 
-       float abot, vbot, awep;
+       float abot, vbot;
        abot = (IS_BOT_CLIENT(attacker));
        vbot = (IS_BOT_CLIENT(self));
 
        valid_damage_for_weaponstats = 0;
-       awep = 0;
+       Weapon awep = WEP_Null;
 
        if(vbot || IS_REAL_CLIENT(self))
        if(abot || IS_REAL_CLIENT(attacker))
@@ -482,7 +482,7 @@ void PlayerDamage (entity inflictor, entity attacker, float damage, int deathtyp
        if(DIFF_TEAM(self, attacker))
        {
                if(DEATH_ISSPECIAL(deathtype))
-                       awep = attacker.weapon;
+                       awep = get_weaponinfo(attacker.weapon);
                else
                        awep = DEATH_WEAPONOF(deathtype);
                valid_damage_for_weaponstats = 1;
@@ -492,7 +492,7 @@ void PlayerDamage (entity inflictor, entity attacker, float damage, int deathtyp
        {
                dh = dh - max(self.health, 0);
                da = da - max(self.armorvalue, 0);
-               WeaponStats_LogDamage(awep, abot, self.weapon, vbot, dh + da);
+               WeaponStats_LogDamage(awep.m_id, abot, self.weapon, vbot, dh + da);
                MUTATOR_CALLHOOK(PlayerDamaged, attacker, self, dh, da, hitloc);
        }
 
@@ -508,12 +508,12 @@ void PlayerDamage (entity inflictor, entity attacker, float damage, int deathtyp
                }
 
                if(valid_damage_for_weaponstats)
-                       WeaponStats_LogKill(awep, abot, self.weapon, vbot);
+                       WeaponStats_LogKill(awep.m_id, abot, self.weapon, vbot);
 
                if(autocvar_sv_gentle < 1) // TODO make a "gentle" version?
                if(sound_allowed(MSG_BROADCAST, attacker))
                {
-                       if(deathtype == DEATH_DROWN)
+                       if(deathtype == DEATH_DROWN.m_id)
                                PlayerSound(playersound_drown, CH_PAIN, VOICETYPE_PLAYERSOUND);
                        else
                                PlayerSound(playersound_death, CH_PAIN, VOICETYPE_PLAYERSOUND);
@@ -528,7 +528,7 @@ void PlayerDamage (entity inflictor, entity attacker, float damage, int deathtyp
                                defer_ClientKill_Now_TeamChange = true;
 
                        if(self.classname == "body")
-                       if(deathtype == DEATH_KILL)
+                       if(deathtype == DEATH_KILL.m_id)
                        {
                                // for the lemmings fans, a small harmless explosion
                                Send_Effect(EFFECT_ROCKET_EXPLODE, self.origin, '0 0 0', 1);
@@ -540,10 +540,10 @@ void PlayerDamage (entity inflictor, entity attacker, float damage, int deathtyp
                        Obituary (attacker, inflictor, self, deathtype);
 
         // increment frag counter for used weapon type
-        int w = DEATH_WEAPONOF(deathtype);
-        if(WEP_VALID(w))
+        Weapon w = DEATH_WEAPONOF(deathtype);
+        if(w != WEP_Null)
        if(accuracy_isgooddamage(attacker, self))
-        attacker.accuracy.(accuracy_frags[w-1]) += 1;
+        attacker.accuracy.(accuracy_frags[w.m_id-1]) += 1;
 
                MUTATOR_CALLHOOK(PlayerDies, inflictor, attacker, self, deathtype);
                excess = frag_damage;
@@ -1273,7 +1273,7 @@ void MoveToTeam(entity client, float team_colour, float type)
 
        TeamchangeFrags(client);  // move the players frags
        SetPlayerColors(client, team_colour - 1);  // set the players colour
-       Damage(client, client, client, 100000, DEATH_AUTOTEAMCHANGE, client.origin, '0 0 0');  // kill the player
+       Damage(client, client, client, 100000, DEATH_AUTOTEAMCHANGE.m_id, client.origin, '0 0 0');  // kill the player
 
        lockteams = lockteams_backup;  // restore the team lock
 
index f849deb6a878119056aca16a3cfe81fd1995c89e..c10518232bc8367f67ebd96daab2ac7b308ea7cb 100644 (file)
@@ -20,7 +20,7 @@
 #endif
 
 #include "../../common/constants.qh"
-#include "../../common/deathtypes.qh"
+#include "../../common/deathtypes/all.qh"
 #include "../../common/mapinfo.qh"
 #include "../../common/notifications.qh"
 #include "../../common/teams.qh"
index 5ddea150a974103a04946359bcc5dcf6b22638e1..56ad6445906b94578821d73ad2b291cc754468ec 100644 (file)
@@ -392,7 +392,7 @@ void CommonCommand_editmob(int request, entity caller, int argc)
                                        if(mon.realowner != caller && autocvar_g_monsters_edit < 2) { print_to(caller, "This monster does not belong to you"); return; }
                                        if(!is_visible) { print_to(caller, "You must look at your monster to edit it"); return; }
 
-                                       Damage (mon, world, world, mon.health + mon.max_health + 200, DEATH_KILL, mon.origin, '0 0 0');
+                                       Damage (mon, world, world, mon.health + mon.max_health + 200, DEATH_KILL.m_id, mon.origin, '0 0 0');
                                        print_to(caller, strcat("Your pet '", mon.monster_name, "' has been brutally mutilated"));
                                        return;
                                }
index 5cae69239ddfb084153e706e5867a8f91d460565..ca715c722800f22787f164e7af18837fb5f6eb37 100644 (file)
@@ -12,7 +12,7 @@
 #include "weapons/selection.qh"
 #include "../common/buffs/all.qh"
 #include "../common/constants.qh"
-#include "../common/deathtypes.qh"
+#include "../common/deathtypes/all.qh"
 #include "../common/notifications.qh"
 #include "../common/movetypes/movetypes.qh"
 #include "../common/playerstats.qh"
@@ -98,14 +98,13 @@ void GiveFrags (entity attacker, entity targ, float f, int deathtype)
        if(g_weaponarena_random)
        {
                // after a frag, exchange the current weapon (or the culprit, if detectable) by a new random weapon
-               float culprit;
-               culprit = DEATH_WEAPONOF(deathtype);
+               Weapon culprit = DEATH_WEAPONOF(deathtype);
                if(!culprit)
-                       culprit = attacker.weapon;
-               else if(!(attacker.weapons & WepSet_FromWeapon(culprit)))
-                       culprit = attacker.weapon;
+                       culprit = get_weaponinfo(attacker.weapon);
+               else if(!(attacker.weapons & WepSet_FromWeapon(culprit.m_id)))
+                       culprit = get_weaponinfo(attacker.weapon);
 
-               if(g_weaponarena_random_with_blaster && culprit == WEP_BLASTER.m_id) // WEAPONTODO: Shouldn't this be in a mutator?
+               if(g_weaponarena_random_with_blaster && culprit == WEP_BLASTER) // WEAPONTODO: Shouldn't this be in a mutator?
                {
                        // no exchange
                }
@@ -124,7 +123,7 @@ void GiveFrags (entity attacker, entity targ, float f, int deathtype)
 
                        // all others (including the culprit): remove
                        GiveFrags_randomweapons.weapons &= ~attacker.weapons;
-                       GiveFrags_randomweapons.weapons &= ~WepSet_FromWeapon(culprit);
+                       GiveFrags_randomweapons.weapons &= ~WepSet_FromWeapon(culprit.m_id);
 
                        // among the remaining ones, choose one by random
                        W_RandomWeapons(GiveFrags_randomweapons, 1);
@@ -132,7 +131,7 @@ void GiveFrags (entity attacker, entity targ, float f, int deathtype)
                        if(GiveFrags_randomweapons.weapons)
                        {
                                attacker.weapons |= GiveFrags_randomweapons.weapons;
-                               attacker.weapons &= ~WepSet_FromWeapon(culprit);
+                               attacker.weapons &= ~WepSet_FromWeapon(culprit.m_id);
                        }
                }
 
@@ -203,7 +202,7 @@ void Obituary_SpecialDeath(
 {
        if(DEATH_ISSPECIAL(deathtype))
        {
-               entity deathent = deathtypes[(deathtype - DT_FIRST)];
+               entity deathent = Deathtypes[deathtype - DT_FIRST];
                if (!deathent) { backtrace("Obituary_SpecialDeath: Could not find deathtype entity!\n"); return; }
 
                if(murder)
@@ -261,12 +260,11 @@ float Obituary_WeaponDeath(
        string s1, string s2, string s3,
        float f1, float f2)
 {
-       float death_weapon = DEATH_WEAPONOF(deathtype);
-       if(death_weapon)
+       Weapon death_weapon = DEATH_WEAPONOF(deathtype);
+       if (death_weapon != WEP_Null)
        {
                w_deathtype = deathtype;
-               Weapon w = get_weaponinfo(death_weapon);
-               int death_message = ((murder) ? w.wr_killmessage : w.wr_suicidemessage)(w);
+               int death_message = ((murder) ? death_weapon.wr_killmessage(death_weapon) : death_weapon.wr_suicidemessage(death_weapon));
                w_deathtype = false;
 
                if (death_message)
@@ -336,13 +334,13 @@ void Obituary(entity attacker, entity inflictor, entity targ, int deathtype)
        {
                if(DEATH_ISSPECIAL(deathtype))
                {
-                       if(deathtype == DEATH_TEAMCHANGE || deathtype == DEATH_AUTOTEAMCHANGE)
+                       if(deathtype == DEATH_TEAMCHANGE.m_id || deathtype == DEATH_AUTOTEAMCHANGE.m_id)
                        {
                                Obituary_SpecialDeath(targ, false, deathtype, targ.netname, deathlocation, "", targ.team, 0, 0);
                        }
                        else
                        {
-                               switch(deathtype)
+                               switch(DEATH_ENT(deathtype))
                                {
                                        case DEATH_MIRRORDAMAGE:
                                        {
@@ -473,7 +471,7 @@ void Obituary(entity attacker, entity inflictor, entity targ, int deathtype)
                        }
 
                        float f3 = 0;
-                       if(deathtype == DEATH_BUFF)
+                       if(deathtype == DEATH_BUFF.m_id)
                                f3 = attacker.buffs;
 
                        if (!Obituary_WeaponDeath(targ, true, deathtype, targ.netname, attacker.netname, deathlocation, targ.killcount, kill_count_to_attacker))
@@ -486,7 +484,7 @@ void Obituary(entity attacker, entity inflictor, entity targ, int deathtype)
        // =============
        else
        {
-               switch(deathtype)
+               switch(DEATH_ENT(deathtype))
                {
                        // For now, we're just forcing HURTTRIGGER to behave as "DEATH_VOID" and giving it no special options...
                        // Later on you will only be able to make custom messages using DEATH_CUSTOM,
@@ -642,7 +640,7 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, int d
                                        RemoveGrapplingHook(targ); // STOP THAT, you parasite!
 
        // special rule: gravity bomb does not hit team mates (other than for disconnecting the hook)
-       if(DEATH_ISWEAPON(deathtype, WEP_HOOK.m_id) || DEATH_ISWEAPON(deathtype, WEP_TUBA.m_id))
+       if(DEATH_ISWEAPON(deathtype, WEP_HOOK) || DEATH_ISWEAPON(deathtype, WEP_TUBA))
        {
                if(IS_PLAYER(targ))
                        if(SAME_TEAM(targ, attacker))
@@ -652,7 +650,7 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, int d
                        }
        }
 
-       if(deathtype == DEATH_KILL || deathtype == DEATH_TEAMCHANGE || deathtype == DEATH_AUTOTEAMCHANGE)
+       if(deathtype == DEATH_KILL.m_id || deathtype == DEATH_TEAMCHANGE.m_id || deathtype == DEATH_AUTOTEAMCHANGE.m_id)
        {
                // exit the vehicle before killing (fixes a crash)
                if(IS_PLAYER(targ) && targ.vehicle)
@@ -667,14 +665,14 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, int d
                targ.flags -= targ.flags & FL_GODMODE;
                damage = 100000;
        }
-       else if(deathtype == DEATH_MIRRORDAMAGE || deathtype == DEATH_NOAMMO)
+       else if(deathtype == DEATH_MIRRORDAMAGE.m_id || deathtype == DEATH_NOAMMO.m_id)
        {
                // no processing
        }
        else
        {
                // nullify damage if teamplay is on
-               if(deathtype != DEATH_TELEFRAG)
+               if(deathtype != DEATH_TELEFRAG.m_id)
                if(IS_PLAYER(attacker))
                {
                        if(IS_PLAYER(targ) && targ != attacker && (IS_INDEPENDENT_PLAYER(attacker) || IS_INDEPENDENT_PLAYER(targ)))
@@ -746,10 +744,10 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, int d
                force = frag_force;
 
                if(targ.frozen)
-               if(deathtype != DEATH_HURTTRIGGER && deathtype != DEATH_TEAMCHANGE && deathtype != DEATH_AUTOTEAMCHANGE)
+               if(deathtype != DEATH_HURTTRIGGER.m_id && deathtype != DEATH_TEAMCHANGE.m_id && deathtype != DEATH_AUTOTEAMCHANGE.m_id)
                {
                        if(autocvar_g_freezetag_revive_falldamage > 0)
-                       if(deathtype == DEATH_FALL)
+                       if(deathtype == DEATH_FALL.m_id)
                        if(damage >= autocvar_g_freezetag_revive_falldamage)
                        {
                                Unfreeze(targ);
@@ -763,7 +761,7 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, int d
                        force *= autocvar_g_freezetag_frozen_force;
                }
 
-               if(targ.frozen && deathtype == DEATH_HURTTRIGGER && !autocvar_g_freezetag_frozen_damage_trigger)
+               if(targ.frozen && deathtype == DEATH_HURTTRIGGER.m_id && !autocvar_g_freezetag_frozen_damage_trigger)
                {
                        Send_Effect(EFFECT_TELEPORT, targ.origin, '0 0 0', 1);
 
@@ -828,7 +826,7 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, int d
                // count the damage
                if(attacker)
                if(!targ.deadflag)
-               if(deathtype != DEATH_BUFF)
+               if(deathtype != DEATH_BUFF.m_id)
                if(targ.takedamage == DAMAGE_AIM)
                if(targ != attacker)
                {
@@ -844,7 +842,7 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, int d
                                {
                                        if(damage > 0)
                                        {
-                                               if(deathtype != DEATH_FIRE)
+                                               if(deathtype != DEATH_FIRE.m_id)
                                                {
                                                        if(victim.BUTTON_CHAT)
                                                                attacker.typehitsound += 1;
@@ -865,7 +863,7 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, int d
                                }
                                else
                                {
-                                       if(deathtype != DEATH_FIRE)
+                                       if(deathtype != DEATH_FIRE.m_id)
                                        {
                                                attacker.typehitsound += 1;
                                        }
@@ -922,7 +920,7 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, int d
                attacker = attacker_save;
 
                force = normalize(attacker.origin + attacker.view_ofs - hitloc) * mirrorforce;
-               Damage(attacker, inflictor, attacker, mirrordamage, DEATH_MIRRORDAMAGE, attacker.origin, force);
+               Damage(attacker, inflictor, attacker, mirrordamage, DEATH_MIRRORDAMAGE.m_id, attacker.origin, force);
        }
 }
 
@@ -952,7 +950,7 @@ float RadiusDamageForSource (entity inflictor, vector inflictororigin, vector in
        total_damage_to_creatures = 0;
 
        if(deathtype != (WEP_HOOK.m_id | HITTYPE_SECONDARY | HITTYPE_BOUNCE)) // only send gravity bomb damage once
-               if(DEATH_WEAPONOF(deathtype) != WEP_TUBA.m_id) // do not send tuba damage (bandwidth hog)
+               if(DEATH_WEAPONOF(deathtype) != WEP_TUBA) // do not send tuba damage (bandwidth hog)
                {
                        force = inflictorvelocity;
                        if(vlen(force) == 0)
@@ -1110,7 +1108,7 @@ float RadiusDamageForSource (entity inflictor, vector inflictororigin, vector in
        RadiusDamage_running = 0;
 
        if(!DEATH_ISSPECIAL(deathtype))
-               accuracy_add(attacker, DEATH_WEAPONOF(deathtype), 0, min(coredamage, stat_damagedone));
+               accuracy_add(attacker, DEATH_WEAPONOF(deathtype).m_id, 0, min(coredamage, stat_damagedone));
 
        return total_damage_to_creatures;
 }
@@ -1226,7 +1224,7 @@ float Fire_AddDamage(entity e, entity o, float d, float t, float dt)
                                }
                        }
                        if(accuracy_isgooddamage(o, e))
-                               accuracy_add(o, DEATH_WEAPONOF(dt), 0, max(0, totaldamage - mindamage));
+                               accuracy_add(o, DEATH_WEAPONOF(dt).m_id, 0, max(0, totaldamage - mindamage));
                        return max(0, totaldamage - mindamage); // can never be negative, but to make sure
                }
                else
@@ -1240,7 +1238,7 @@ float Fire_AddDamage(entity e, entity o, float d, float t, float dt)
                e.fire_owner = o;
                e.fire_hitsound = false;
                if(accuracy_isgooddamage(o, e))
-                       accuracy_add(o, DEATH_WEAPONOF(dt), 0, d);
+                       accuracy_add(o, DEATH_WEAPONOF(dt).m_id, 0, d);
                return d;
        }
 }
@@ -1290,7 +1288,7 @@ void Fire_ApplyDamage(entity e)
                {
                        t = autocvar_g_balance_firetransfer_time * (e.fire_endtime - time);
                        d = autocvar_g_balance_firetransfer_damage * e.fire_damagepersec * t;
-                       Fire_AddDamage(other, o, d, t, DEATH_FIRE);
+                       Fire_AddDamage(other, o, d, t, DEATH_FIRE.m_id);
                }
        }
 }
index e7430690e4be3f157c9cfeca32b77a07cec285eb..4df5303b255eef04c5477d14e49669669bcb4b58 100644 (file)
@@ -19,7 +19,7 @@
     #include "constants.qh"
     #include "defs.qh"
     #include "../common/notifications.qh"
-    #include "../common/deathtypes.qh"
+    #include "../common/deathtypes/all.qh"
     #include "mutators/mutators_include.qh"
     #include "../common/turrets/sv_turrets.qh"
     #include "../common/vehicles/all.qh"
index d6ffeeb5d12dcee38fbcc12591879e4de84db5c3..f72ebc02f548c0a9e2a4d96a7975768452e8a102 100644 (file)
@@ -21,7 +21,7 @@
 #include "weapons/weaponstats.qh"
 #include "../common/buffs/all.qh"
 #include "../common/constants.qh"
-#include "../common/deathtypes.qh"
+#include "../common/deathtypes/all.qh"
 #include "../common/effects/effects.qh"
 #include "../common/mapinfo.qh"
 #include "../common/monsters/all.qh"
@@ -557,8 +557,6 @@ spawnfunc(__init_dedicated_server)
 
        // needs to be done so early because of the constants they create
        static_init();
-       CALL_ACCUMULATED_FUNCTION(RegisterNotifications);
-       CALL_ACCUMULATED_FUNCTION(RegisterDeathtypes);
 
        MapInfo_Enumerate();
        MapInfo_FilterGametype(MapInfo_CurrentGametype(), MapInfo_CurrentFeatures(), MapInfo_RequiredFlags(), MapInfo_ForbiddenFlags(), 0);
@@ -604,7 +602,6 @@ spawnfunc(worldspawn)
        // needs to be done so early because of the constants they create
        static_init();
        CALL_ACCUMULATED_FUNCTION(RegisterNotifications);
-       CALL_ACCUMULATED_FUNCTION(RegisterDeathtypes);
 
        ServerProgsDB = db_load(strcat("server.db", autocvar_sessionid));
 
index 57bbd51d0e1f1c17cf8966c10e3a3c1276b8c2f6..875cdc412d51943cdf3b7006256730e8d8e9d456 100644 (file)
@@ -12,7 +12,7 @@
 #include "weapons/selection.qh"
 #include "../common/command/generic.qh"
 #include "../common/constants.qh"
-#include "../common/deathtypes.qh"
+#include "../common/deathtypes/all.qh"
 #include "../common/mapinfo.qh"
 #include "../common/notifications.qh"
 #include "../common/playerstats.qh"
index 007de3cac6c35e501b727e135e09896f83888263..ca8c41e9bfc02de784a3de5db23bb483c79ce841 100644 (file)
@@ -135,7 +135,7 @@ void WarpZone_traceline_antilag (entity source, vector v1, vector v2, float nomo
 
 
 #define ITEM_TOUCH_NEEDKILL() (((trace_dpstartcontents | trace_dphitcontents) & DPCONTENTS_NODROP) || (trace_dphitq3surfaceflags & Q3SURFACEFLAG_SKY))
-#define ITEM_DAMAGE_NEEDKILL(dt) (((dt) == DEATH_HURTTRIGGER) || ((dt) == DEATH_SLIME) || ((dt) == DEATH_LAVA) || ((dt) == DEATH_SWAMP))
+#define ITEM_DAMAGE_NEEDKILL(dt) (((dt) == DEATH_HURTTRIGGER.m_id) || ((dt) == DEATH_SLIME.m_id) || ((dt) == DEATH_LAVA.m_id) || ((dt) == DEATH_SWAMP.m_id))
 
 #define PROJECTILE_TOUCH if(WarpZone_Projectile_Touch()) return
 
index d2066b9abde1a14fdee774df9168b86d17347373..77b959ed7ee614b68aa4ad4f60e321e075521cde 100644 (file)
@@ -29,7 +29,7 @@
 #include "../weapons/tracing.qh"
 #include "../weapons/weaponsystem.qh"
 
-#include "../../common/deathtypes.qh"
+#include "../../common/deathtypes/all.qh"
 #include "../../common/notifications.qh"
 #include "../../common/triggers/teleporters.qh"
 #include "../../common/triggers/subs.qh"
index 570fc38016ca43cca22568cab450e85e969dc583..a368fff7809eead10caa1d9c464ecd55420da1e7 100644 (file)
@@ -319,7 +319,7 @@ MUTATOR_HOOKFUNCTION(ca_PlayerDamage)
 {
        if(IS_PLAYER(frag_target))
        if(frag_target.deadflag == DEAD_NO)
-       if(frag_target == frag_attacker || SAME_TEAM(frag_target, frag_attacker) || frag_deathtype == DEATH_FALL)
+       if(frag_target == frag_attacker || SAME_TEAM(frag_target, frag_attacker) || frag_deathtype == DEATH_FALL.m_id)
                frag_damage = 0;
 
        frag_mirrordamage = 0;
index 108b8dda6f369b10163cdc376d968e90e6d65a49..da2e76f8b205047d3da6ee6c1d5349d31063697a 100644 (file)
@@ -53,8 +53,8 @@ void ctf_CaptureRecord(entity flag, entity player)
 void ctf_FlagcarrierWaypoints(entity player)
 {
        WaypointSprite_Spawn(WP_FlagCarrier, 0, 0, player, FLAG_WAYPOINT_OFFSET, world, player.team, player, wps_flagcarrier, true, RADARICON_FLAG);
-       WaypointSprite_UpdateMaxHealth(player.wps_flagcarrier, '1 0 0' * healtharmor_maxdamage(start_health, start_armorvalue, autocvar_g_balance_armor_blockpercent, DEATH_WEAPON) * 2);
-       WaypointSprite_UpdateHealth(player.wps_flagcarrier, '1 0 0' * healtharmor_maxdamage(player.health, player.armorvalue, autocvar_g_balance_armor_blockpercent, DEATH_WEAPON));
+       WaypointSprite_UpdateMaxHealth(player.wps_flagcarrier, '1 0 0' * healtharmor_maxdamage(start_health, start_armorvalue, autocvar_g_balance_armor_blockpercent, DEATH_WEAPON.m_id) * 2);
+       WaypointSprite_UpdateHealth(player.wps_flagcarrier, '1 0 0' * healtharmor_maxdamage(player.health, player.armorvalue, autocvar_g_balance_armor_blockpercent, DEATH_WEAPON.m_id));
        WaypointSprite_UpdateTeamRadar(player.wps_flagcarrier, RADARICON_FLAGCARRIER, WPCOLOR_FLAGCARRIER(player.team));
 }
 
@@ -194,7 +194,7 @@ void ctf_CaptureShield_Touch()
        vector mymid = (self.absmin + self.absmax) * 0.5;
        vector othermid = (other.absmin + other.absmax) * 0.5;
 
-       Damage(other, self, self, 0, DEATH_HURTTRIGGER, mymid, normalize(othermid - mymid) * ctf_captureshield_force);
+       Damage(other, self, self, 0, DEATH_HURTTRIGGER.m_id, mymid, normalize(othermid - mymid) * ctf_captureshield_force);
        if(IS_REAL_CLIENT(other)) { Send_Notification(NOTIF_ONE, other, MSG_CENTER, CENTER_CTF_CAPTURESHIELD_SHIELDED); }
 }
 
@@ -1518,7 +1518,7 @@ void havocbot_role_ctf_carrier()
                {
                        // Can't navigate to my own base, suicide!
                        // TODO: drop it and wander around
-                       Damage(self, self, self, 100000, DEATH_KILL, self.origin, '0 0 0');
+                       Damage(self, self, self, 100000, DEATH_KILL.m_id, self.origin, '0 0 0');
                        return;
                }
        }
@@ -1936,7 +1936,7 @@ MUTATOR_HOOKFUNCTION(ctf_PlayerPreThink)
 
        // update the health of the flag carrier waypointsprite
        if(self.wps_flagcarrier)
-               WaypointSprite_UpdateHealth(self.wps_flagcarrier, '1 0 0' * healtharmor_maxdamage(self.health, self.armorvalue, autocvar_g_balance_armor_blockpercent, DEATH_WEAPON));
+               WaypointSprite_UpdateHealth(self.wps_flagcarrier, '1 0 0' * healtharmor_maxdamage(self.health, self.armorvalue, autocvar_g_balance_armor_blockpercent, DEATH_WEAPON.m_id));
 
        return false;
 }
@@ -1958,7 +1958,7 @@ MUTATOR_HOOKFUNCTION(ctf_PlayerDamage) // for changing damage and force values t
        }
        else if(frag_target.flagcarried && (frag_target.deadflag == DEAD_NO) && CTF_DIFFTEAM(frag_target, frag_attacker)) // if the target is a flagcarrier
        {
-               if(autocvar_g_ctf_flagcarrier_auto_helpme_damage > ('1 0 0' * healtharmor_maxdamage(frag_target.health, frag_target.armorvalue, autocvar_g_balance_armor_blockpercent, DEATH_WEAPON)))
+               if(autocvar_g_ctf_flagcarrier_auto_helpme_damage > ('1 0 0' * healtharmor_maxdamage(frag_target.health, frag_target.armorvalue, autocvar_g_balance_armor_blockpercent, DEATH_WEAPON.m_id)))
                if(time > frag_target.wps_helpme_time + autocvar_g_ctf_flagcarrier_auto_helpme_time)
                {
                        frag_target.wps_helpme_time = time;
index f9b478232aee988a6cd636fd2f652bdc62794c1a..04357de9cc4d970cf1dea858da74044fecf0cfff 100644 (file)
@@ -267,7 +267,7 @@ MUTATOR_HOOKFUNCTION(cts_FilterItem)
 
 MUTATOR_HOOKFUNCTION(cts_PlayerDamage)
 {
-       if(frag_target == frag_attacker || frag_deathtype == DEATH_FALL)
+       if(frag_target == frag_attacker || frag_deathtype == DEATH_FALL.m_id)
        if(!autocvar_g_cts_selfdamage)
                frag_damage = 0;
 
index e7790c974d435776dee2da7ddd8344bf7e453d6e..d8d792ad6c56f9a14c97d0a1fbbd4550b2233792 100644 (file)
@@ -342,7 +342,7 @@ MUTATOR_HOOKFUNCTION(freezetag_PlayerDies)
        // Cases DEATH_TEAMCHANGE and DEATH_AUTOTEAMCHANGE are needed to fix a bug whe
        // you succeed changing team through the menu: you both really die (gibbing) and get frozen
        if(ITEM_DAMAGE_NEEDKILL(frag_deathtype)
-               || frag_deathtype == DEATH_TEAMCHANGE || frag_deathtype == DEATH_AUTOTEAMCHANGE)
+               || frag_deathtype == DEATH_TEAMCHANGE.m_id || frag_deathtype == DEATH_AUTOTEAMCHANGE.m_id)
        {
                // let the player die, he will be automatically frozen when he respawns
                if(self.frozen != 1)
index ebfc22bb5f9ceb82ebb58c297632ad867eadc7c6..e0415af3c18df308a986b9afc3454714812e235e 100644 (file)
@@ -27,7 +27,7 @@ void ons_CaptureShield_Touch()
        vector mymid = (self.absmin + self.absmax) * 0.5;
        vector othermid = (other.absmin + other.absmax) * 0.5;
 
-       Damage(other, self, self, 0, DEATH_HURTTRIGGER, mymid, normalize(othermid - mymid) * ons_captureshield_force);
+       Damage(other, self, self, 0, DEATH_HURTTRIGGER.m_id, mymid, normalize(othermid - mymid) * ons_captureshield_force);
 
        if(IS_REAL_CLIENT(other))
        {
@@ -1100,7 +1100,7 @@ bool Onslaught_CheckWinner()
                        else
                                d = d * tmp_entity.max_health / max(30, 60 * autocvar_timelimit_suddendeath);
 
-                       Damage(tmp_entity, tmp_entity, tmp_entity, d, DEATH_HURTTRIGGER, tmp_entity.origin, '0 0 0');
+                       Damage(tmp_entity, tmp_entity, tmp_entity, d, DEATH_HURTTRIGGER.m_id, tmp_entity.origin, '0 0 0');
 
                        tmp_entity.sprite.SendFlags |= 16;
 
index 39adb175c86a6a587ab0f8de146facc82d9bcce6..8721a2d678bf3571f67d22283878c777c7879526 100644 (file)
@@ -29,7 +29,7 @@
 #include "../weapons/throwing.qh"
 #include "../weapons/weaponsystem.qh"
 
-#include "../../common/deathtypes.qh"
+#include "../../common/deathtypes/all.qh"
 #include "../../common/notifications.qh"
 #include "../../common/triggers/teleporters.qh"
 #include "../../common/triggers/subs.qh"
index da9a608f0156a6bc047aebf8bf98886921673830..6c50612a91a8e96ae409b1e66923ca2cb1ac4230 100644 (file)
@@ -16,7 +16,7 @@ MUTATOR_HOOKFUNCTION(bloodloss_PlayerThink)
                        if(self.vehicle)
                                vehicles_exit(VHEF_RELEASE);
                        if(self.event_damage)
-                               self.event_damage(self, self, 1, DEATH_ROT, self.origin, '0 0 0');
+                               self.event_damage(self, self, 1, DEATH_ROT.m_id, self.origin, '0 0 0');
                        self.bloodloss_timer = time + 0.5 + random() * 0.5;
                }
        }
index da47be4159c0a1accf0f4e4b336e57923dc55400..49e7f39e373d50cc4313800dd875941935c230af 100644 (file)
@@ -401,7 +401,7 @@ void buff_SpawnReplacement(entity ent, entity old)
 void buff_Vengeance_DelayedDamage()
 {SELFPARAM();
        if(self.enemy)
-               Damage(self.enemy, self.owner, self.owner, self.dmg, DEATH_BUFF, self.enemy.origin, '0 0 0');
+               Damage(self.enemy, self.owner, self.owner, self.dmg, DEATH_BUFF.m_id, self.enemy.origin, '0 0 0');
 
        remove(self);
        return;
@@ -415,7 +415,7 @@ float buff_Inferno_CalculateTime(float x, float offset_x, float offset_y, float
 // mutator hooks
 MUTATOR_HOOKFUNCTION(buffs_PlayerDamage_SplitHealthArmor)
 {
-       if(frag_deathtype == DEATH_BUFF) { return false; }
+       if(frag_deathtype == DEATH_BUFF.m_id) { return false; }
 
        if(frag_target.buffs & BUFF_RESISTANCE.m_itemid)
        {
@@ -429,7 +429,7 @@ MUTATOR_HOOKFUNCTION(buffs_PlayerDamage_SplitHealthArmor)
 
 MUTATOR_HOOKFUNCTION(buffs_PlayerDamage_Calculate)
 {
-       if(frag_deathtype == DEATH_BUFF) { return false; }
+       if(frag_deathtype == DEATH_BUFF.m_id) { return false; }
 
        if(frag_target.buffs & BUFF_SPEED.m_itemid)
        if(frag_target != frag_attacker)
@@ -443,7 +443,7 @@ MUTATOR_HOOKFUNCTION(buffs_PlayerDamage_Calculate)
                frag_damage = max(5, frag_target.health - autocvar_g_buffs_medic_survive_health);
 
        if(frag_target.buffs & BUFF_JUMP.m_itemid)
-       if(frag_deathtype == DEATH_FALL)
+       if(frag_deathtype == DEATH_FALL.m_id)
                frag_damage = 0;
 
        if(frag_target.buffs & BUFF_VENGEANCE.m_itemid)
@@ -477,7 +477,7 @@ MUTATOR_HOOKFUNCTION(buffs_PlayerDamage_Calculate)
                frag_target.buff_disability_time = time + autocvar_g_buffs_disability_slowtime;
 
        if(frag_attacker.buffs & BUFF_MEDIC.m_itemid)
-       if(DEATH_WEAPONOF(frag_deathtype) != WEP_ARC.m_id)
+       if(DEATH_WEAPONOF(frag_deathtype) != WEP_ARC)
        if(SAME_TEAM(frag_attacker, frag_target))
        if(frag_attacker != frag_target)
        {
@@ -495,13 +495,13 @@ MUTATOR_HOOKFUNCTION(buffs_PlayerDamage_Calculate)
                        autocvar_g_buffs_inferno_burntime_target_time,
                        autocvar_g_buffs_inferno_burntime_factor
                );
-               Fire_AddDamage(frag_target, frag_attacker, (frag_damage * autocvar_g_buffs_inferno_damagemultiplier) * time, time, DEATH_BUFF);
+               Fire_AddDamage(frag_target, frag_attacker, (frag_damage * autocvar_g_buffs_inferno_damagemultiplier) * time, time, DEATH_BUFF.m_id);
        }
 
        // this... is ridiculous (TODO: fix!)
        if(frag_attacker.buffs & BUFF_VAMPIRE.m_itemid)
        if(!frag_target.vehicle)
-       if(DEATH_WEAPONOF(frag_deathtype) != WEP_ARC.m_id)
+       if(DEATH_WEAPONOF(frag_deathtype) != WEP_ARC)
        if(!ITEM_DAMAGE_NEEDKILL(frag_deathtype))
        if(frag_target.deadflag == DEAD_NO)
        if(IS_PLAYER(frag_target) || IS_MONSTER(frag_target))
index e4ad5ba19854f13851fb987bca87c111f189e1cf..3b04c43cc132a2b53259610c9b1e509ae35a84b9 100644 (file)
@@ -58,9 +58,9 @@ MUTATOR_HOOKFUNCTION(campcheck_PlayerThink)
                        {
                                Send_Notification(NOTIF_ONE, self, MSG_CENTER, CENTER_CAMPCHECK);
                                if(self.vehicle)
-                                       Damage(self.vehicle, self, self, autocvar_g_campcheck_damage * 2, DEATH_CAMP, self.vehicle.origin, '0 0 0');
+                                       Damage(self.vehicle, self, self, autocvar_g_campcheck_damage * 2, DEATH_CAMP.m_id, self.vehicle.origin, '0 0 0');
                                else
-                                       Damage(self, self, self, bound(0, autocvar_g_campcheck_damage, self.health + self.armorvalue * autocvar_g_balance_armor_blockpercent + 5), DEATH_CAMP, self.origin, '0 0 0');
+                                       Damage(self, self, self, bound(0, autocvar_g_campcheck_damage, self.health + self.armorvalue * autocvar_g_balance_armor_blockpercent + 5), DEATH_CAMP.m_id, self.origin, '0 0 0');
                        }
                        self.campcheck_nextcheck = time + autocvar_g_campcheck_interval;
                        self.campcheck_traveled_distance = 0;
index 9f88b2b6e8d40638bf96346da31f399929dd94e6..f6c85d9c107d8f5aec5c22a56ee4a239bfc733f4 100644 (file)
@@ -65,59 +65,59 @@ void instagib_ammocheck()
                self.instagib_needammo = true;
                if (self.health <= 5)
                {
-                       Damage(self, self, self, 5, DEATH_NOAMMO, self.origin, '0 0 0');
+                       Damage(self, self, self, 5, DEATH_NOAMMO.m_id, self.origin, '0 0 0');
                        Send_Notification(NOTIF_ONE, self, MSG_ANNCE, ANNCE_INSTAGIB_TERMINATED);
                }
                else if (self.health <= 10)
                {
-                       Damage(self, self, self, 5, DEATH_NOAMMO, self.origin, '0 0 0');
+                       Damage(self, self, self, 5, DEATH_NOAMMO.m_id, self.origin, '0 0 0');
                        Send_Notification(NOTIF_ONE, self, MSG_ANNCE, ANNCE_NUM_1);
                }
                else if (self.health <= 20)
                {
-                       Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
+                       Damage(self, self, self, 10, DEATH_NOAMMO.m_id, self.origin, '0 0 0');
                        Send_Notification(NOTIF_ONE, self, MSG_ANNCE, ANNCE_NUM_2);
                }
                else if (self.health <= 30)
                {
-                       Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
+                       Damage(self, self, self, 10, DEATH_NOAMMO.m_id, self.origin, '0 0 0');
                        Send_Notification(NOTIF_ONE, self, MSG_ANNCE, ANNCE_NUM_3);
                }
                else if (self.health <= 40)
                {
-                       Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
+                       Damage(self, self, self, 10, DEATH_NOAMMO.m_id, self.origin, '0 0 0');
                        Send_Notification(NOTIF_ONE, self, MSG_ANNCE, ANNCE_NUM_4);
                }
                else if (self.health <= 50)
                {
-                       Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
+                       Damage(self, self, self, 10, DEATH_NOAMMO.m_id, self.origin, '0 0 0');
                        Send_Notification(NOTIF_ONE, self, MSG_ANNCE, ANNCE_NUM_5);
                }
                else if (self.health <= 60)
                {
-                       Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
+                       Damage(self, self, self, 10, DEATH_NOAMMO.m_id, self.origin, '0 0 0');
                        Send_Notification(NOTIF_ONE, self, MSG_ANNCE, ANNCE_NUM_6);
                }
                else if (self.health <= 70)
                {
-                       Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
+                       Damage(self, self, self, 10, DEATH_NOAMMO.m_id, self.origin, '0 0 0');
                        Send_Notification(NOTIF_ONE, self, MSG_ANNCE, ANNCE_NUM_7);
                }
                else if (self.health <= 80)
                {
-                       Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
+                       Damage(self, self, self, 10, DEATH_NOAMMO.m_id, self.origin, '0 0 0');
                        Send_Notification(NOTIF_ONE, self, MSG_ANNCE, ANNCE_NUM_8);
                }
                else if (self.health <= 90)
                {
                        Send_Notification(NOTIF_ONE_ONLY, self, MSG_CENTER, CENTER_INSTAGIB_FINDAMMO);
-                       Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
+                       Damage(self, self, self, 10, DEATH_NOAMMO.m_id, self.origin, '0 0 0');
                        Send_Notification(NOTIF_ONE, self, MSG_ANNCE, ANNCE_NUM_9);
                }
                else
                {
                        Send_Notification(NOTIF_ONE_ONLY, self, MSG_MULTI, MULTI_INSTAGIB_FINDAMMO);
-                       Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
+                       Damage(self, self, self, 10, DEATH_NOAMMO.m_id, self.origin, '0 0 0');
                }
        }
        self.instagib_nextthink = time + 1;
@@ -259,11 +259,11 @@ MUTATOR_HOOKFUNCTION(instagib_PlayerDamage)
 
        if(IS_PLAYER(frag_target))
        {
-               if(frag_deathtype == DEATH_FALL)
+               if(frag_deathtype == DEATH_FALL.m_id)
                        frag_damage = 0; // never count fall damage
 
                if(!autocvar_g_instagib_damagedbycontents)
-               switch(frag_deathtype)
+               switch(DEATH_ENT(frag_deathtype))
                {
                        case DEATH_DROWN:
                        case DEATH_SLIME:
@@ -273,7 +273,7 @@ MUTATOR_HOOKFUNCTION(instagib_PlayerDamage)
                }
 
                if(IS_PLAYER(frag_attacker))
-               if(DEATH_ISWEAPON(frag_deathtype, WEP_VAPORIZER.m_id))
+               if(DEATH_ISWEAPON(frag_deathtype, WEP_VAPORIZER))
                {
                        if(frag_target.armorvalue)
                        {
@@ -285,7 +285,7 @@ MUTATOR_HOOKFUNCTION(instagib_PlayerDamage)
                        }
                }
 
-               if(IS_PLAYER(frag_attacker) && DEATH_ISWEAPON(frag_deathtype, WEP_BLASTER.m_id))
+               if(IS_PLAYER(frag_attacker) && DEATH_ISWEAPON(frag_deathtype, WEP_BLASTER))
                {
                        if(frag_deathtype & HITTYPE_SECONDARY)
                        {
@@ -388,7 +388,7 @@ MUTATOR_HOOKFUNCTION(instagib_CustomizeWaypoint)
 
 MUTATOR_HOOKFUNCTION(instagib_PlayerDies)
 {
-       if(DEATH_ISWEAPON(frag_deathtype, WEP_VAPORIZER.m_id))
+       if(DEATH_ISWEAPON(frag_deathtype, WEP_VAPORIZER))
                frag_damage = 1000; // always gib if it was a vaporizer death
 
        return FALSE;
index 4fdbbd353dbf4ef70e4d9dbed1cfd3f608585215..ec5a649ddf02d5fe4b73767de5cca972e1e52974 100644 (file)
@@ -131,7 +131,7 @@ void nade_napalm_ball()
        proj.bot_dodge = true;
        proj.bot_dodgerating = autocvar_g_nades_napalm_ball_damage;
        proj.movetype = MOVETYPE_BOUNCE;
-       proj.projectiledeathtype = DEATH_NADE_NAPALM;
+       proj.projectiledeathtype = DEATH_NADE_NAPALM.m_id;
        PROJECTILE_MAKETRIGGER(proj);
        setmodel(proj, MDL_Null);
        proj.scale = 1;//0.5;
@@ -214,7 +214,7 @@ void nade_napalm_boom()
        fountain.pushltime = fountain.ltime;
        fountain.team = self.team;
        fountain.movetype = MOVETYPE_TOSS;
-       fountain.projectiledeathtype = DEATH_NADE_NAPALM;
+       fountain.projectiledeathtype = DEATH_NADE_NAPALM.m_id;
        fountain.bot_dodge = true;
        fountain.bot_dodgerating = autocvar_g_nades_napalm_fountain_damage;
        fountain.nade_special_time = time;
@@ -315,7 +315,7 @@ void nade_ice_boom()
        fountain.pushltime = fountain.wait = fountain.ltime;
        fountain.team = self.team;
        fountain.movetype = MOVETYPE_TOSS;
-       fountain.projectiledeathtype = DEATH_NADE_ICE;
+       fountain.projectiledeathtype = DEATH_NADE_ICE.m_id;
        fountain.bot_dodge = false;
        setsize(fountain, '-16 -16 -16', '16 16 16');
        fountain.nade_special_time = time+0.3;
@@ -424,7 +424,7 @@ void nade_heal_touch()
                }
                else if ( health_factor < 0 )
                {
-                       Damage(other,self,self.realowner,-health_factor,DEATH_NADE_HEAL,other.origin,'0 0 0');
+                       Damage(other,self,self.realowner,-health_factor,DEATH_NADE_HEAL.m_id,other.origin,'0 0 0');
                }
 
        }
@@ -597,28 +597,28 @@ void nade_damage(entity inflictor, entity attacker, float damage, int deathtype,
        if(self.nade_type == NADE_TYPE_TRANSLOCATE.m_id || self.nade_type == NADE_TYPE_SPAWN.m_id)
                return;
 
-       if(DEATH_ISWEAPON(deathtype, WEP_BLASTER.m_id))
+       if(DEATH_ISWEAPON(deathtype, WEP_BLASTER))
        {
                force *= 1.5;
                damage = 0;
        }
 
-       if(DEATH_ISWEAPON(deathtype, WEP_VAPORIZER.m_id) && (deathtype & HITTYPE_SECONDARY))
+       if(DEATH_ISWEAPON(deathtype, WEP_VAPORIZER) && (deathtype & HITTYPE_SECONDARY))
        {
                force *= 0.5; // too much
                frag_damage = 0;
        }
 
-       if(DEATH_ISWEAPON(deathtype, WEP_VORTEX.m_id) || DEATH_ISWEAPON(deathtype, WEP_VAPORIZER.m_id))
+       if(DEATH_ISWEAPON(deathtype, WEP_VORTEX) || DEATH_ISWEAPON(deathtype, WEP_VAPORIZER))
        {
                force *= 6;
                damage = self.max_health * 0.55;
        }
 
-       if(DEATH_ISWEAPON(deathtype, WEP_MACHINEGUN.m_id) || DEATH_ISWEAPON(deathtype, WEP_HMG.m_id))
+       if(DEATH_ISWEAPON(deathtype, WEP_MACHINEGUN) || DEATH_ISWEAPON(deathtype, WEP_HMG))
                damage = self.max_health * 0.1;
 
-       if(DEATH_ISWEAPON(deathtype, WEP_SHOCKWAVE.m_id) || DEATH_ISWEAPON(deathtype, WEP_SHOTGUN.m_id)) // WEAPONTODO
+       if(DEATH_ISWEAPON(deathtype, WEP_SHOCKWAVE) || DEATH_ISWEAPON(deathtype, WEP_SHOTGUN)) // WEAPONTODO
        if(deathtype & HITTYPE_SECONDARY)
        {
                damage = self.max_health * 0.1;
@@ -709,7 +709,7 @@ void toss_nade(entity e, vector _velocity, float _time)
        _nade.damagedbycontents = true;
        _nade.angles = vectoangles(_nade.velocity);
        _nade.flags = FL_PROJECTILE;
-       _nade.projectiledeathtype = DEATH_NADE;
+       _nade.projectiledeathtype = DEATH_NADE.m_id;
        _nade.toss_time = time;
        _nade.solid = SOLID_CORPSE; //((_nade.nade_type == NADE_TYPE_TRANSLOCATE) ? SOLID_CORPSE : SOLID_BBOX);
 
@@ -825,7 +825,7 @@ void nade_prime()
        n.nade_time_primed = time;
        n.think = nade_beep;
        n.nextthink = max(n.wait - 3, time);
-       n.projectiledeathtype = DEATH_NADE;
+       n.projectiledeathtype = DEATH_NADE.m_id;
 
        setmodel(fn, MDL_NADE_VIEW);
        setattachment(fn, self.weaponentity, "");
@@ -1119,7 +1119,7 @@ MUTATOR_HOOKFUNCTION(nades_PlayerDamage)
        if(frag_target.frozen)
        if(autocvar_g_freezetag_revive_nade)
        if(frag_attacker == frag_target)
-       if(frag_deathtype == DEATH_NADE)
+       if(frag_deathtype == DEATH_NADE.m_id)
        if(time - frag_inflictor.toss_time <= 0.1)
        {
                Unfreeze(frag_target);
index d2086215f931dc94143c9c1e71958e8932d14a0b..d5b59d26ad9b31cc940d023c63abfb5563592db4 100644 (file)
@@ -46,7 +46,7 @@ float ok_CheckWeaponCharge(entity ent, int wep)
 MUTATOR_HOOKFUNCTION(ok_PlayerDamage_Calculate)
 {
        if(IS_PLAYER(frag_attacker) && IS_PLAYER(frag_target))
-       if(DEATH_ISWEAPON(frag_deathtype, WEP_BLASTER.m_id))
+       if(DEATH_ISWEAPON(frag_deathtype, WEP_BLASTER))
        {
                frag_damage = 0;
 
index 07148cc58d02fa455c39c97210e248108ad9ce31..7f333d9dfc30e2fce6d7b5007cc8984b3b54e416 100644 (file)
@@ -5,12 +5,12 @@ MUTATOR_HOOKFUNCTION(rm, PlayerDamage_Calculate)
        // we do it this way, so rm can be toggled during the match
        if(!autocvar_g_rm) { return false; }
 
-       if(DEATH_ISWEAPON(frag_deathtype, WEP_DEVASTATOR.m_id))
+       if(DEATH_ISWEAPON(frag_deathtype, WEP_DEVASTATOR))
        if(frag_attacker == frag_target || frag_target.classname == "nade")
                frag_damage = 0;
 
        if(autocvar_g_rm_laser)
-       if(DEATH_ISWEAPON(frag_deathtype, WEP_ELECTRO.m_id))
+       if(DEATH_ISWEAPON(frag_deathtype, WEP_ELECTRO))
        if(frag_attacker == frag_target || (round_handler_IsActive() && !round_handler_IsRoundStarted()))
                frag_damage = 0;
 
@@ -22,7 +22,7 @@ MUTATOR_HOOKFUNCTION(rm, PlayerDies)
        // we do it this way, so rm can be toggled during the match
        if(!autocvar_g_rm) { return false; }
 
-       if(DEATH_ISWEAPON(frag_deathtype, WEP_DEVASTATOR.m_id) || DEATH_ISWEAPON(frag_deathtype, WEP_ELECTRO.m_id))
+       if(DEATH_ISWEAPON(frag_deathtype, WEP_DEVASTATOR) || DEATH_ISWEAPON(frag_deathtype, WEP_ELECTRO))
                frag_damage = 1000; // always gib if it was a vaporizer death
 
        return false;
index faa74bb1dcf74e989eeb50311e1b83c82bd1fba6..baf41dedbf8414003fd5c002539c642f4060897f 100644 (file)
@@ -16,7 +16,7 @@ void PlayerTouchExplode(entity p1, entity p2)
        entity e;
        e = spawn();
        setorigin(e, org);
-       RadiusDamage(e, world, autocvar_g_touchexplode_damage, autocvar_g_touchexplode_edgedamage, autocvar_g_touchexplode_radius, world, world, autocvar_g_touchexplode_force, DEATH_TOUCHEXPLODE, world);
+       RadiusDamage(e, world, autocvar_g_touchexplode_damage, autocvar_g_touchexplode_edgedamage, autocvar_g_touchexplode_radius, world, world, autocvar_g_touchexplode_force, DEATH_TOUCHEXPLODE.m_id, world);
        remove(e);
 }
 
index 8564d34c59cb2a0b06e31df6bc93a78dd84f0d69..d5e47c62f845cecd29cff0afd1de0e151a6c21e3 100644 (file)
@@ -39,7 +39,7 @@
     #include "../constants.qh"
     #include "../defs.qh"
     #include "../../common/notifications.qh"
-    #include "../../common/deathtypes.qh"
+    #include "../../common/deathtypes/all.qh"
     #include "mutators_include.qh"
     #include "../../common/turrets/sv_turrets.qh"
     #include "../../common/vehicles/all.qh"
index 30fa073849d9f9b5827a050a5b269ce1b7269b03..5132db5729817769657dae6f79c77e4c22c539f7 100644 (file)
@@ -4,7 +4,7 @@
 #include "g_hook.qh"
 #include "mutators/mutators_include.qh"
 #include "../common/constants.qh"
-#include "../common/deathtypes.qh"
+#include "../common/deathtypes/all.qh"
 #include "../common/notifications.qh"
 #include "../common/triggers/teleporters.qh"
 #include "../common/triggers/subs.qh"
@@ -428,7 +428,7 @@ void Portal_Remove(entity portal, float killed)
 
 void Portal_Damage(entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force)
 {SELFPARAM();
-       if(deathtype == DEATH_TELEFRAG)
+       if(deathtype == DEATH_TELEFRAG.m_id)
                return;
        if(attacker != self.aiment)
                if(IS_INDEPENDENT_PLAYER(attacker) || IS_INDEPENDENT_PLAYER(self.aiment))
index adb8cf6323d643006c4c832e44ef7886c782b374..d4a4f17125bb73503bc7df31ebd2a79806325168 100644 (file)
@@ -97,6 +97,7 @@
 #include "../common/triggers/include.qc"
 #include "../common/util.qc"
 
+#include "../common/deathtypes/all.qc"
 #include "../common/buffs/all.qc"
 #include "../common/items/all.qc"
 #include "../common/monsters/all.qc"
index fbf1eaa185af29a2b6a5d3ab61b72410e6763e6c..8f9dccf91a24f3ae0e5e8ea77cbda4f0ca79d437 100644 (file)
@@ -8,7 +8,7 @@
 #include "bot/waypoints.qh"
 #include "bot/navigation.qh"
 #include "command/getreplies.qh"
-#include "../common/deathtypes.qh"
+#include "../common/deathtypes/all.qh"
 #include "../common/notifications.qh"
 #include "../common/mapinfo.qh"
 #include "../warpzonelib/util_server.qh"
@@ -704,7 +704,7 @@ void checkpoint_passed()
        else
        {
                if(self.spawnflags & 4)
-                       Damage (other, self, self, 10000, DEATH_HURTTRIGGER, other.origin, '0 0 0');
+                       Damage (other, self, self, 10000, DEATH_HURTTRIGGER.m_id, other.origin, '0 0 0');
        }
 }
 
index 138051827bcad56fac48d9ed1f993596a8f405cc..43118d926477145a3043aae80e10e9e9d271277b 100644 (file)
@@ -13,7 +13,7 @@
 #include "weapons/csqcprojectile.qh"
 
 #include "../common/constants.qh"
-#include "../common/deathtypes.qh"
+#include "../common/deathtypes/all.qh"
 #include "../common/mapinfo.qh"
 #include "../common/util.qh"
 
@@ -62,7 +62,7 @@ void CreatureFrame (void)
                                        if (!self.deadflag)
                                        if (self.pain_finished < time)
                                        {
-                                               Damage (self, world, world, autocvar_g_balance_contents_playerdamage_drowning * autocvar_g_balance_contents_damagerate, DEATH_DROWN, self.origin, '0 0 0');
+                                               Damage (self, world, world, autocvar_g_balance_contents_playerdamage_drowning * autocvar_g_balance_contents_damagerate, DEATH_DROWN.m_id, self.origin, '0 0 0');
                                                self.pain_finished = time + 0.5;
                                        }
                                }
@@ -76,11 +76,11 @@ void CreatureFrame (void)
                                {
                                        if (self.watertype == CONTENT_LAVA)
                                        {
-                                               Damage (self, world, world, autocvar_g_balance_contents_projectiledamage * autocvar_g_balance_contents_damagerate * self.waterlevel, DEATH_LAVA, self.origin, '0 0 0');
+                                               Damage (self, world, world, autocvar_g_balance_contents_projectiledamage * autocvar_g_balance_contents_damagerate * self.waterlevel, DEATH_LAVA.m_id, self.origin, '0 0 0');
                                        }
                                        else if (self.watertype == CONTENT_SLIME)
                                        {
-                                               Damage (self, world, world, autocvar_g_balance_contents_projectiledamage * autocvar_g_balance_contents_damagerate * self.waterlevel, DEATH_SLIME, self.origin, '0 0 0');
+                                               Damage (self, world, world, autocvar_g_balance_contents_projectiledamage * autocvar_g_balance_contents_damagerate * self.waterlevel, DEATH_SLIME.m_id, self.origin, '0 0 0');
                                        }
                                }
                                else
@@ -92,7 +92,7 @@ void CreatureFrame (void)
                                                        self.watersound_finished = time + 0.5;
                                                        sound (self, CH_PLAYER_SINGLE, SND_LAVA, VOL_BASE, ATTEN_NORM);
                                                }
-                                               Damage (self, world, world, autocvar_g_balance_contents_playerdamage_lava * autocvar_g_balance_contents_damagerate * self.waterlevel, DEATH_LAVA, self.origin, '0 0 0');
+                                               Damage (self, world, world, autocvar_g_balance_contents_playerdamage_lava * autocvar_g_balance_contents_damagerate * self.waterlevel, DEATH_LAVA.m_id, self.origin, '0 0 0');
                                        }
                                        else if (self.watertype == CONTENT_SLIME)
                                        {
@@ -101,7 +101,7 @@ void CreatureFrame (void)
                                                        self.watersound_finished = time + 0.5;
                                                        sound (self, CH_PLAYER_SINGLE, SND_SLIME, VOL_BASE, ATTEN_NORM);
                                                }
-                                               Damage (self, world, world, autocvar_g_balance_contents_playerdamage_slime * autocvar_g_balance_contents_damagerate * self.waterlevel, DEATH_SLIME, self.origin, '0 0 0');
+                                               Damage (self, world, world, autocvar_g_balance_contents_playerdamage_slime * autocvar_g_balance_contents_damagerate * self.waterlevel, DEATH_SLIME.m_id, self.origin, '0 0 0');
                                        }
                                }
                        }
@@ -130,11 +130,11 @@ void CreatureFrame (void)
                                else
                                        dm = min((dm - autocvar_g_balance_falldamage_minspeed) * autocvar_g_balance_falldamage_factor, autocvar_g_balance_falldamage_maxdamage);
                                if (dm > 0)
-                                       Damage (self, world, world, dm, DEATH_FALL, self.origin, '0 0 0');
+                                       Damage (self, world, world, dm, DEATH_FALL.m_id, self.origin, '0 0 0');
                        }
 
                        if(autocvar_g_maxspeed > 0 && velocity_len > autocvar_g_maxspeed)
-                               Damage (self, world, world, 100000, DEATH_SHOOTING_STAR, self.origin, '0 0 0');
+                               Damage (self, world, world, 100000, DEATH_SHOOTING_STAR.m_id, self.origin, '0 0 0');
                        // play stupid sounds
                        if (g_footsteps)
                        if (!gameover)
index e93ee2d7e1fe181b842df30668d93556b22d72fe..90e70171ecbd1ea97ad0533abb46b25f32c3abb8 100644 (file)
@@ -15,7 +15,7 @@
     #include "weapons/weaponsystem.qh"
 
     #include "../common/constants.qh"
-    #include "../common/deathtypes.qh"
+    #include "../common/deathtypes/all.qh"
     #include "../common/notifications.qh"
        #include "../common/triggers/subs.qh"
     #include "../common/util.qh"
index 6defa736f63cdd09327cedb34e35033ff427d714..dc01b545dfc4d19f652bc8ffd8c759a6a18ec7e9 100644 (file)
@@ -12,7 +12,7 @@
 
 #include "mutators/mutators_include.qh"
 
-#include "../common/deathtypes.qh"
+#include "../common/deathtypes/all.qh"
 #include "../common/teams.qh"
 
 void TeamchangeFrags(entity e)
@@ -775,7 +775,7 @@ float JoinBestTeam(entity pl, float only_return_best, float forcebestteam)
                LogTeamchange(pl.playerid, pl.team, 2); // log auto join
 
                if(pl.deadflag == DEAD_NO)
-                       Damage(pl, pl, pl, 100000, DEATH_TEAMCHANGE, pl.origin, '0 0 0');
+                       Damage(pl, pl, pl, 100000, DEATH_TEAMCHANGE.m_id, pl.origin, '0 0 0');
        }
 
        return smallest;
@@ -861,7 +861,7 @@ void SV_ChangeTeam(float _color)
        {
                // kill player when changing teams
                if(self.deadflag == DEAD_NO)
-                       Damage(self, self, self, 100000, DEATH_TEAMCHANGE, self.origin, '0 0 0');
+                       Damage(self, self, self, 100000, DEATH_TEAMCHANGE.m_id, self.origin, '0 0 0');
        }
 }
 
@@ -1002,6 +1002,6 @@ void ShufflePlayerOutOfTeam (float source_team)
        SetPlayerTeam(selected, smallestteam, source_team, false);
 
        if(selected.deadflag == DEAD_NO)
-               Damage(selected, selected, selected, 100000, DEATH_AUTOTEAMCHANGE, selected.origin, '0 0 0');
+               Damage(selected, selected, selected, 100000, DEATH_AUTOTEAMCHANGE.m_id, selected.origin, '0 0 0');
        Send_Notification(NOTIF_ONE, selected, MSG_CENTER, CENTER_DEATH_SELF_AUTOTEAMCHANGE, selected.team);
 }
index f1720757f6607564db7f1a89083570178afac39b..0f1fa9080286dc8094d2f4e0d03dd8906e2d9dc7 100644 (file)
@@ -3,7 +3,7 @@
 
 #include "../t_items.qh"
 #include "../../common/constants.qh"
-#include "../../common/deathtypes.qh"
+#include "../../common/deathtypes/all.qh"
 #include "../../common/notifications.qh"
 #include "../../common/util.qh"
 #include "../../common/weapons/all.qh"
@@ -38,7 +38,7 @@ void W_PlayStrengthSound(entity player) // void W_PlayStrengthSound
 
 float W_CheckProjectileDamage(entity inflictor, entity projowner, int deathtype, float exception)
 {
-       float is_from_contents = (deathtype == DEATH_SLIME || deathtype == DEATH_LAVA);
+       float is_from_contents = (deathtype == DEATH_SLIME.m_id || deathtype == DEATH_LAVA.m_id);
        float is_from_owner = (inflictor == projowner);
        float is_from_exception = (exception != -1);