#include "../common/vehicles/all.qh"
#include "../common/constants.qh"
-#include "../common/deathtypes.qh"
+#include "../common/deathtypes/all.qh"
#include "../common/effects/effects.qh"
#include "../common/movetypes/movetypes.qh"
#include "../common/util.qh"
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")
{
setorigin(self, w_org + w_backoff * 2); // for sound() calls
- switch(w_deathtype)
+ switch(DEATH_ENT(w_deathtype))
{
case DEATH_VH_CRUSH:
break;
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);
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);
}
}
}
#include "../common/buffs/all.qh"
#include "../common/constants.qh"
-#include "../common/deathtypes.qh"
+#include "../common/deathtypes/all.qh"
#include "../common/items/all.qc"
#include "../common/mapinfo.qh"
#include "../common/nades/all.qh"
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);
#include "weapons/projectile.qh"
#include "../common/buffs/all.qh"
-#include "../common/deathtypes.qh"
+#include "../common/deathtypes/all.qh"
#include "../common/effects/effects.qh"
#include "../common/mapinfo.qh"
#include "../common/monsters/all.qh"
// needs to be done so early because of the constants they create
static_init();
- CALL_ACCUMULATED_FUNCTION(RegisterNotifications);
- CALL_ACCUMULATED_FUNCTION(RegisterDeathtypes);
CALL_ACCUMULATED_FUNCTION(RegisterHUD_Panels);
// precaches
#include "../common/minigames/cl_minigames.qc"
#include "../common/buffs/all.qc"
+#include "../common/deathtypes/all.qc"
#include "../common/items/all.qc"
#include "../common/monsters/all.qc"
#include "../common/mutators/all.qc"
+++ /dev/null
-#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
--- /dev/null
+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, "")
--- /dev/null
+#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);
+}
--- /dev/null
+#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
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);
}
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);
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;
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;
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;
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);
}
}
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;
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;
{
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;
}
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:
{
#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"
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 )
{
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)
{
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;
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)
if(self.health <= 0)
{
- if(deathtype == DEATH_KILL)
+ if(deathtype == DEATH_KILL.m_id)
self.candrop = false; // killed by mobkill command
// TODO: fix this?
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);
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;
}
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;
}
#include "notifications.inc"
ACCUMULATE_FUNCTION(RegisterNotifications, RegisterNotifications_Done)
+STATIC_INIT(RegisterNotifications) { CALL_ACCUMULATED_FUNCTION(RegisterNotifications); }
+
#endif
_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);
)
{ // 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
{
//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
}
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
#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
{
//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
}
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');
}
}
{
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
}
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
#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
#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"
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');
}
}
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)
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');
}
}
#include "../../../warpzonelib/util_server.qh"
#include "../../weapons/all.qh"
#include "../../../server/defs.qh"
- #include "../../deathtypes.qh"
+ #include "../../deathtypes/all.qh"
#endif
/*
// 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;
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);
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);
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;
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;
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");
}
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);
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;
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);
{
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);
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);
}
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;
}
{
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;
}
}
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);
}
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);
}
}
#define GETTER(type, name) type GET(name)() { return name; }
#define BIT(n) (1 << (n))
+#define BITS(n) (BIT(n) - 1)
#ifndef BRANCHLESS_BITSET
#define BITSET(var, mask, flag) (flag ? (var) | (mask) : (var) &~ (mask))
#else
#include "../client/mutators/events.qh"
#include "mapinfo.qh"
#include "notifications.qh"
- #include "deathtypes.qh"
+ #include "deathtypes/all.qh"
#elif defined(MENUQC)
#elif defined(SVQC)
#include "../dpdefs/progsdefs.qh"
#include "../server/defs.qh"
#include "../server/mutators/events.qh"
#include "notifications.qh"
- #include "deathtypes.qh"
+ #include "deathtypes/all.qh"
#include "mapinfo.qh"
#endif
{
// 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
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
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;
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");
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".
}
{
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
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);
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)
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;
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);
}
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;
{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;
vehicles_projectile(EFFECT_RAPTOR_MUZZLEFLASH.eent_eff_name, SND(LASERGUN_FIRE),
org, normalize(dir + randomvec() * autocvar_g_vehicle_raptor_cannon_spread) * autocvar_g_vehicle_raptor_cannon_speed,
autocvar_g_vehicle_raptor_cannon_damage, autocvar_g_vehicle_raptor_cannon_radius, autocvar_g_vehicle_raptor_cannon_force, 0,
- DEATH_VH_RAPT_CANNON, PROJECTILE_RAPTORCANNON, 0, true, true, veh ? veh : player);
+ DEATH_VH_RAPT_CANNON.m_id, PROJECTILE_RAPTORCANNON, 0, true, true, veh ? veh : player);
weapon_thinkf(player, WFRAME_FIRE1, 0, w_ready);
}
}
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);
}
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)
{
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);
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;
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) ;
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;
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);
#include "../util.qh"
#include "../buffs/all.qh"
#include "../../client/autocvars.qh"
- #include "../deathtypes.qh"
+ #include "../deathtypes/all.qh"
#include "../../csqcmodellib/interpolate.qh"
#include "../movetypes/movetypes.qh"
#include "../../client/main.qh"
#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"
#include "weapons/tracing.qh"
#include "../common/constants.qh"
-#include "../common/deathtypes.qh"
+#include "../common/deathtypes/all.qh"
#include "../common/effects/effects.qh"
#include "../common/util.qh"
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");
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');
}
}
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
}
{
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))
{
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);
*/
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();
#include "command/common.qh"
#include "../common/animdecide.qh"
#include "../common/csqcmodel_settings.qh"
-#include "../common/deathtypes.qh"
+#include "../common/deathtypes/all.qh"
#include "../common/triggers/subs.qh"
#include "../common/playerstats.qh"
#include "../csqcmodellib/sv_model.qh"
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;
}
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);
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))
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;
{
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);
}
}
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);
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);
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;
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
#endif
#include "../../common/constants.qh"
-#include "../../common/deathtypes.qh"
+#include "../../common/deathtypes/all.qh"
#include "../../common/mapinfo.qh"
#include "../../common/notifications.qh"
#include "../../common/teams.qh"
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;
}
#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"
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
}
// 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);
if(GiveFrags_randomweapons.weapons)
{
attacker.weapons |= GiveFrags_randomweapons.weapons;
- attacker.weapons &= ~WepSet_FromWeapon(culprit);
+ attacker.weapons &= ~WepSet_FromWeapon(culprit.m_id);
}
}
{
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)
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)
{
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:
{
}
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))
// =============
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,
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))
}
}
- 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)
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)))
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);
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);
// 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)
{
{
if(damage > 0)
{
- if(deathtype != DEATH_FIRE)
+ if(deathtype != DEATH_FIRE.m_id)
{
if(victim.BUTTON_CHAT)
attacker.typehitsound += 1;
}
else
{
- if(deathtype != DEATH_FIRE)
+ if(deathtype != DEATH_FIRE.m_id)
{
attacker.typehitsound += 1;
}
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);
}
}
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)
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;
}
}
}
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
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;
}
}
{
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);
}
}
}
#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"
#include "weapons/weaponstats.qh"
#include "../common/buffs/all.qh"
#include "../common/constants.qh"
-#include "../common/deathtypes.qh"
+#include "../common/deathtypes/all.qh"
#include "../common/effects/effects.qh"
#include "../common/mapinfo.qh"
#include "../common/monsters/all.qh"
// needs to be done so early because of the constants they create
static_init();
- CALL_ACCUMULATED_FUNCTION(RegisterNotifications);
- CALL_ACCUMULATED_FUNCTION(RegisterDeathtypes);
MapInfo_Enumerate();
MapInfo_FilterGametype(MapInfo_CurrentGametype(), MapInfo_CurrentFeatures(), MapInfo_RequiredFlags(), MapInfo_ForbiddenFlags(), 0);
// needs to be done so early because of the constants they create
static_init();
CALL_ACCUMULATED_FUNCTION(RegisterNotifications);
- CALL_ACCUMULATED_FUNCTION(RegisterDeathtypes);
ServerProgsDB = db_load(strcat("server.db", autocvar_sessionid));
#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"
#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
#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"
{
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;
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));
}
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); }
}
{
// 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;
}
}
// 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;
}
}
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;
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;
// 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)
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))
{
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;
#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"
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;
}
}
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;
// 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)
{
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)
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)
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)
{
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))
{
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;
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;
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:
}
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)
{
}
}
- 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)
{
MUTATOR_HOOKFUNCTION(instagib_PlayerDies)
{
- if(DEATH_ISWEAPON(frag_deathtype, WEP_VAPORIZER.m_id))
+ if(DEATH_ISWEAPON(frag_deathtype, WEP_VAPORIZER))
frag_damage = 1000; // always gib if it was a vaporizer death
return FALSE;
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;
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;
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;
}
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');
}
}
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;
_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);
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, "");
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);
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;
// 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;
// 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;
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);
}
#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"
#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"
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))
#include "../common/triggers/include.qc"
#include "../common/util.qc"
+#include "../common/deathtypes/all.qc"
#include "../common/buffs/all.qc"
#include "../common/items/all.qc"
#include "../common/monsters/all.qc"
#include "bot/waypoints.qh"
#include "bot/navigation.qh"
#include "command/getreplies.qh"
-#include "../common/deathtypes.qh"
+#include "../common/deathtypes/all.qh"
#include "../common/notifications.qh"
#include "../common/mapinfo.qh"
#include "../warpzonelib/util_server.qh"
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');
}
}
#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"
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;
}
}
{
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
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)
{
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');
}
}
}
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)
#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"
#include "mutators/mutators_include.qh"
-#include "../common/deathtypes.qh"
+#include "../common/deathtypes/all.qh"
#include "../common/teams.qh"
void TeamchangeFrags(entity e)
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;
{
// 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');
}
}
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);
}
#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"
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);