]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge branch 'master' into TimePath/deathtypes 234/head
authorTimePath <andrew.hardaker1995@gmail.com>
Sun, 11 Oct 2015 22:38:36 +0000 (09:38 +1100)
committerTimePath <andrew.hardaker1995@gmail.com>
Sun, 11 Oct 2015 22:39:59 +0000 (09:39 +1100)
# Conflicts:
# qcsrc/client/damage.qc
# qcsrc/client/hud.qc
# qcsrc/client/main.qc
# qcsrc/client/progs.inc
# qcsrc/common/vehicles/vehicle/raptor_weapons.qc
# qcsrc/common/weapons/all.qc
# qcsrc/server/cheats.qc
# qcsrc/server/g_world.qc
# qcsrc/server/teamplay.qc

80 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/instagib/instagib.qc
qcsrc/common/mutators/mutator/waypoints/waypointsprites.qc
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.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_breakablehook.qc
qcsrc/server/mutators/mutator_buffs.qc
qcsrc/server/mutators/mutator_campcheck.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 48612ba48cfad99914449c9101a3cd30712d6c59..34890e034eaaeb323495e02d606eda203a0eb7af 100644 (file)
@@ -1,7 +1,7 @@
 #include "damage.qh"
 
 #include "gibs.qh"
-#include "../common/deathtypes.qh"
+#include "../common/deathtypes/all.qh"
 #include "../common/movetypes/movetypes.qh"
 #include "../common/vehicles/all.qh"
 #include "../common/weapons/all.qh"
@@ -92,7 +92,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")
        {
@@ -214,7 +214,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;
@@ -288,7 +288,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);
@@ -338,18 +338,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 0e52460435c19a49eab38fa5fd94eb84ce523758..90be935df3b43528717b39aa53e0eefc1404ab4e 100644 (file)
@@ -6,7 +6,7 @@
 #include "teamradar.qh"
 #include "t_items.qh"
 #include "../common/buffs/all.qh"
-#include "../common/deathtypes.qh"
+#include "../common/deathtypes/all.qh"
 #include "../common/items/all.qc"
 #include "../common/mapinfo.qh"
 #include "../common/mutators/mutator/waypoints/all.qh"
@@ -1464,7 +1464,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 05704e5cb4e4eaa4502a4ed010595476dea6a664..c641bf61e0f5911d78310e943b9922e5a321b972 100644 (file)
@@ -20,7 +20,7 @@
 #include "t_items.qh"
 #include "wall.qh"
 #include "weapons/projectile.qh"
-#include "../common/deathtypes.qh"
+#include "../common/deathtypes/all.qh"
 #include "../common/items/all.qh"
 #include "../common/mapinfo.qh"
 #include "../common/minigames/cl_minigames.qh"
@@ -130,7 +130,6 @@ void CSQC_Init(void)
 
        // needs to be done so early because of the constants they create
        static_init();
-       CALL_ACCUMULATED_FUNCTION(RegisterDeathtypes);
 
        // precaches
 
index 61bd8b934fa583591e9744a6c640bc94703eee0d..0c3884f6797a489efb9b1ddb3f0d5fc4d711993a 100644 (file)
@@ -48,6 +48,7 @@
 #include "../common/minigames/cl_minigames.qc"
 
 #include "../common/buffs/all.qc"
+#include "../common/deathtypes/all.qc"
 #include "../common/effects/all.qc"
 #include "../common/gamemodes/all.qc"
 #include "../common/items/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 fd1c9bb85212d136bcee44aebabbad3cb8c1e3f1..7388ee66f5bce70ddc448466967f302ce79b488c 100644 (file)
@@ -151,7 +151,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);
 }
@@ -305,7 +305,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 30e0fe428e4cef803c64f516ac46dd9739b843fd..203b597cc0da2b7ee99d19ce40536f753e84506b 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;
@@ -104,7 +104,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;
@@ -156,7 +156,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 93252a39a2cf03463a26e4e22659efbaaaadcad6..208ae107993480edc0c4c2d3c90d2e4d13323955 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);
     }
 }
@@ -130,7 +130,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 4acf2093b6867c898b47bbfaacaaba5c7c85d12b..ac9f32205dae432e9104065d29957df55dd7debd 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 2300f78f61c19a1771a81722020e462822617b45..e68b7ff5424334b8c979f2c8b6141e2321cda032 100644 (file)
@@ -86,7 +86,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;
        }
@@ -139,7 +139,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 e42908fbd5118f2b4cd27005d98a87c4e26ff91f..1155c6427108eb51320c3c382e3789d3e2b52683 100644 (file)
@@ -10,7 +10,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"
@@ -742,7 +742,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 )
@@ -759,7 +759,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)
                                {
@@ -1046,19 +1046,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;
@@ -1086,12 +1086,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)
@@ -1102,7 +1102,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?
@@ -1111,14 +1111,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);
 
@@ -1229,7 +1229,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 cc6f405e66faadc8702dfd6eb72736a609ab1c54..2acb1839b2ddd65ede7c5dce5f35d7ed440e70b7 100644 (file)
@@ -73,59 +73,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;
@@ -269,11 +269,11 @@ MUTATOR_HOOKFUNCTION(mutator_instagib, PlayerDamage_Calculate)
 
        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:
@@ -283,7 +283,7 @@ MUTATOR_HOOKFUNCTION(mutator_instagib, PlayerDamage_Calculate)
                }
 
                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)
                        {
@@ -295,7 +295,7 @@ MUTATOR_HOOKFUNCTION(mutator_instagib, PlayerDamage_Calculate)
                        }
                }
 
-               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)
                        {
@@ -398,7 +398,7 @@ MUTATOR_HOOKFUNCTION(mutator_instagib, CustomizeWaypoint)
 
 MUTATOR_HOOKFUNCTION(mutator_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 89d1b23740dcf2dbdb65fd0b0bb0f4d1557486cb..b83c96a61679cf413e902ded6fc46182802be533 100644 (file)
@@ -1113,8 +1113,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 2effa16768b777ec6a294ad2b77a2c82a81f00bc..9fda071fd4f005d58870c5d4348361d2c6a278fa 100644 (file)
@@ -208,7 +208,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 54029cd6c26477125b2758ca66ce9e5a5ddc2e68..06ca7054352696b92061a23a1ce3aa52ce61acb3 100644 (file)
@@ -118,7 +118,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 b4b210384e70e038ce8589b531ca34db5a75da7b..92575384f710656c6159e44edce1910213540254 100644 (file)
@@ -13,7 +13,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"
@@ -48,11 +48,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 33241aafd3de5c4ebadec0a78ef69e00eabcc7e0..a906fcd313d53f21eaac86df915fd429bf418491 100644 (file)
@@ -4,7 +4,7 @@
     #include "../../../lib/warpzone/util_server.qh"
     #include "../../weapons/all.qh"
     #include "../../../server/defs.qh"
-    #include "../../deathtypes.qh"
+    #include "../../deathtypes/all.qh"
 #endif
 
 /*
@@ -54,7 +54,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 b687086ba941ed6f51b38910906074d71e3652d4..7ac910f998fa7b0c533840dbdc74d90b98aebb6a 100644 (file)
@@ -6,7 +6,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 "constants.qh"
@@ -14,7 +14,7 @@
     #include "../server/defs.qh"
        #include "../server/mutators/events.qh"
     #include "notifications.qh"
-    #include "deathtypes.qh"
+    #include "deathtypes/all.qh"
     #include "mapinfo.qh"
 #endif
 
@@ -1491,7 +1491,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
@@ -1514,7 +1514,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 500bc60c8cebf0cea22b394456074e163392131c..a00cdcfa343dd4e8b207b2ab3ed06e3370557f36 100644 (file)
@@ -653,22 +653,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;
@@ -766,7 +766,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");
@@ -937,7 +937,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 7bc45c0d5162e45285af95c6a068d572c5342e10..8d87fd760312231a9eef74a741c74920393577f7 100644 (file)
@@ -481,7 +481,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 a5ddb7f6717b4f9d9b891a2e0349005142737f6a..69d981beb3e35c0229ebfcfafe54c4043061bef0 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, player);
+                               DEATH_VH_RAPT_CANNON.m_id, PROJECTILE_RAPTORCANNON, 0, true, true, 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 37d49b2e2de68bee0336b9f1b10e3e2124719264..e603cb16c195a3ce3c3067e1f4f112979f0724b9 100644 (file)
@@ -13,7 +13,7 @@
        #include "../util.qh"
        #include "../buffs/all.qh"
        #include "../../client/autocvars.qh"
-       #include "../deathtypes.qh"
+       #include "../deathtypes/all.qh"
        #include "../../lib/csqcmodel/interpolate.qh"
        #include "../movetypes/movetypes.qh"
        #include "../../client/main.qh"
@@ -38,7 +38,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 0f43d92c0a48d46e3ed1dc4421ec2967aa5aa4d6..64c7cec19e17ea2627faf89f40ca8d91bd95710a 100644 (file)
@@ -9,7 +9,7 @@
 #include "weapons/tracing.qh"
 
 #include "../common/constants.qh"
-#include "../common/deathtypes.qh"
+#include "../common/deathtypes/all.qh"
 #include "../common/util.qh"
 
 #include "../common/monsters/all.qh"
@@ -285,7 +285,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 ddbc18da6eb870ccf64ecde2a511ccf058d5a5cc..c608c5b2c74a78325a2343556b1a679ff4137fd8 100644 (file)
@@ -812,7 +812,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');
            }
        }
 
@@ -825,7 +825,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 dafd7d2a6a18df714d1f8e7170b8e48b17db554f..1b770121e8a8904b18ffe87312d271a8a885d741 100644 (file)
@@ -12,7 +12,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 "../lib/csqcmodel/sv_model.qh"
@@ -325,7 +325,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;
@@ -436,11 +436,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);
@@ -471,12 +471,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))
@@ -484,7 +484,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;
@@ -494,7 +494,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);
        }
 
@@ -510,12 +510,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);
@@ -530,7 +530,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);
@@ -542,10 +542,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;
@@ -1275,7 +1275,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 3cd7f23cff671dd2ba9b7d73160619c5d0786f63..ddfbe57950a0f46ff66ff83532dd89d9c1059bbd 100644 (file)
@@ -19,7 +19,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/physics.qh"
index 4d390e7d960d974e3084fab72cf842b280e63a28..fee82a7e4b5933a4263b191b4e3fb543b9e97e18 100644 (file)
@@ -393,7 +393,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 845fd56f64105ee2efc830ee9c440f4c8bb97522..b005da47a24e48e7a5b70eaa7cd143273eb03f30 100644 (file)
@@ -14,7 +14,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"
@@ -100,14 +100,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
                }
@@ -126,7 +125,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);
@@ -134,7 +133,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);
                        }
                }
 
@@ -205,7 +204,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)
@@ -263,12 +262,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)
@@ -338,13 +336,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:
                                        {
@@ -475,7 +473,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))
@@ -488,7 +486,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,
@@ -644,7 +642,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))
@@ -654,7 +652,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)
@@ -669,14 +667,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)))
@@ -748,10 +746,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);
@@ -765,7 +763,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);
 
@@ -830,7 +828,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)
                {
@@ -846,7 +844,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;
@@ -867,7 +865,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;
                                        }
@@ -924,7 +922,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);
        }
 }
 
@@ -954,7 +952,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)
@@ -1112,7 +1110,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;
 }
@@ -1228,7 +1226,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
@@ -1242,7 +1240,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;
        }
 }
@@ -1292,7 +1290,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 064d31ff9e566ea41ed9f8b144c43cc01b1a0d07..62a74be22d0289087b1fd1f45b6e689fb026e8a9 100644 (file)
@@ -17,7 +17,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 cb9aaa3c11f38544759d74059f07ea3b9e77927a..fc3eed45286cd110e4a697a050d40cbd0f3b63a3 100644 (file)
@@ -20,7 +20,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/mapinfo.qh"
 #include "../common/monsters/all.qh"
 #include "../common/monsters/sv_monsters.qh"
@@ -557,7 +557,6 @@ spawnfunc(__init_dedicated_server)
 
        // needs to be done so early because of the constants they create
        static_init();
-       CALL_ACCUMULATED_FUNCTION(RegisterDeathtypes);
 
        MapInfo_Enumerate();
        MapInfo_FilterGametype(MapInfo_CurrentGametype(), MapInfo_CurrentFeatures(), MapInfo_RequiredFlags(), MapInfo_ForbiddenFlags(), 0);
@@ -602,7 +601,6 @@ spawnfunc(worldspawn)
 
        // needs to be done so early because of the constants they create
        static_init();
-       CALL_ACCUMULATED_FUNCTION(RegisterDeathtypes);
 
        ServerProgsDB = db_load(strcat("server.db", autocvar_sessionid));
 
index 4c8fdeaaf6a9b6a7539ed9a611ddbe3e5778ca98..c864373ad8c6d17cd3320b6f2d061ee180ff43aa 100644 (file)
@@ -11,7 +11,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 9de38eae73f5ede057824df7bf60808d984fb582..da11aefeeb0fbad8b186f1650ae340caa09f5b01 100644 (file)
@@ -30,7 +30,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 e01b6e574970db19a93484c3490db7b4ae3fd38a..42aa4a29e77f000832c406a49620331d9010c850 100644 (file)
@@ -318,7 +318,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 eff581154286530b94f44a5c2e794046911a6535..0c68bbfd0ff122aae3bc048ce595556d8dcf7dc6 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 175950dd8ce438aa5ee41212a9c1e8992c0e9919..06e2ca3fa571ae6f6ec91694740f9a0c5a1b2ecf 100644 (file)
@@ -266,7 +266,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 85ef5119f85e6d85cde9de45be211f351a6b3f5e..6eb2128f3bdaa0a96e6b02437e5947ef189a16cb 100644 (file)
@@ -341,7 +341,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 03de8eb6bf333cf3278771b7034932243d2d4296..8b2e223c041fe0756db6072621e04e73dccb162a 100644 (file)
@@ -28,7 +28,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))
        {
@@ -1103,7 +1103,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 ac60070e5a6fb85bdeaf69402d70efb72a05643a..e8054bc0442bc3efa2ae451298c9bacaaa23c8f4 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 06bf72ea0fe63a580e5497286adc336b7f09bb40..1e54218840ca09679af39d9108c80c27ff9b8d6c 100644 (file)
@@ -15,7 +15,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 b3daba675ad0a55a08575a76fba5f3d1f884936c..3f75e3f9946f42cf9418c6f1bc8c6190ab4ad56a 100644 (file)
@@ -1,4 +1,4 @@
-#include "../../common/deathtypes.qh"
+#include "../../common/deathtypes/all.qh"
 #include "../g_hook.qh"
 
 REGISTER_MUTATOR(bh, cvar("g_breakablehook"));
index e222b7df0a9df24835d3affcede0a9febc8c3247..7c24ea14f205bfc76ccee0e2213ec4fd2b5a2a21 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 8cfb06440e9083cac9f7df951e3be1809e1e80b5..4acc7540502ef433d30e830c6c2ee3ce529ca0d1 100644 (file)
@@ -57,9 +57,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 f665fbc13576a7fcf9ebb3a7d05f2a1004dcf603..40e07b1ea81a387fcfc0e2a04964cb87fab529b0 100644 (file)
@@ -132,7 +132,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;
@@ -215,7 +215,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;
@@ -316,7 +316,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;
@@ -425,7 +425,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');
                }
 
        }
@@ -598,28 +598,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;
@@ -710,7 +710,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);
 
@@ -826,7 +826,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, "");
@@ -1120,7 +1120,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 96376e24b13a1c67053d2c88af56108706624a57..5d1a9cd06dac86590ea3c94940ca29ae5210c5a9 100644 (file)
@@ -45,7 +45,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 4a4daa3c380ac523a7a1dbab07fc8816c037ffb3..b7319cf3e9e510f1d320360213623b0df29bc136 100644 (file)
@@ -1,4 +1,4 @@
-#include "../../common/deathtypes.qh"
+#include "../../common/deathtypes/all.qh"
 #include "../round_handler.qh"
 
 REGISTER_MUTATOR(rm, cvar("g_instagib"));
@@ -8,12 +8,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;
 
@@ -25,7 +25,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 e78b0d78fc09ab1153eb74b5c65c78e98b594a0d..e0dd4cd67e8dc434036ca04cf51b579aa53a59bf 100644 (file)
@@ -15,7 +15,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 9d67e03cebd22e3017f6b734c83be94d5f5dee64..d2ea4688f0a06ccfcf534882a532df7f5e877bf9 100644 (file)
@@ -37,7 +37,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 ec5d688f60ff8219832b6701a4207ee73d419160..ca6442f979dff6515ea38f24018fb89afbdc917f 100644 (file)
@@ -3,7 +3,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"
@@ -430,7 +430,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 6c48f2f71a088ef1dc2a10eaee15e4ca39ac3bb1..ece94bdbefb6ca0d67a5b29309cbbe976b0108cf 100644 (file)
@@ -77,6 +77,7 @@
 #include "../common/triggers/include.qc"
 #include "../common/util.qc"
 
+#include "../common/deathtypes/all.qc"
 #include "../common/buffs/all.qc"
 #include "../common/effects/all.qc"
 #include "../common/gamemodes/all.qc"
index d9d8d55c516ec387591686b7d9d1c4239c23766d..94f3100a40cb7bd76d9d4f710d5e98586e3573c8 100644 (file)
@@ -7,7 +7,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 "../common/triggers/subs.qh"
@@ -706,7 +706,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 8b9e1c8b0b69dfd163b052fe174b56738d640a60..0a9d8f21014dab6571af9b9deb818ae0d7ed1702 100644 (file)
@@ -12,7 +12,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 89d6b06caf07ff80ef2631e2ab1c33f27c75709a..d30a54f020f8d48f4a8399ff22926243ce05da6f 100644 (file)
@@ -14,7 +14,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 b279def2fba9b98bad8c5a27a0e8ba036b23b0de..5a9d2ee3b999f5989482d0375fad17c4c8ca8502 100644 (file)
@@ -11,7 +11,7 @@
 
 #include "mutators/mutators_include.qh"
 
-#include "../common/deathtypes.qh"
+#include "../common/deathtypes/all.qh"
 #include "../common/gamemodes/all.qh"
 #include "../common/teams.qh"
 
@@ -772,7 +772,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;
@@ -858,7 +858,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');
        }
 }
 
@@ -999,6 +999,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 d4e29cb04233182cc63bc83fadd602edbeb160ec..5a5e30bf79c11c92cd217c5e006bf0d399a92c73 100644 (file)
@@ -2,7 +2,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);