int nearestbone = 0;
float life;
string effectname;
- entity e;
+ entity e, wep;
if(!autocvar_cl_damageeffect || autocvar_cl_gentle || autocvar_cl_gentle_damage)
return;
life = bound(autocvar_cl_damageeffect_lifetime_min, thedamage * autocvar_cl_damageeffect_lifetime, autocvar_cl_damageeffect_lifetime_max);
- effectname = strcat("damage_", DEATH_WEAPONOF(type).netname);
- if(DEATH_WEAPONOF(type) == WEP_SHOTGUN || DEATH_WEAPONOF(type) == WEP_MACHINEGUN)
+ wep = DEATH_WEAPONOF(type);
+ effectname = strcat("damage_", wep.netname);
+ if((wep.spawnflags & WEP_FLAG_BLEED))
{
+ // if this weapon induces bleeding, use the effect name with the proper species prefix (blood type)
if((this.isplayermodel & ISPLAYER_MODEL))
{
string specstr = species_prefix(specnum);
const int WEP_FLAG_DUALWIELD = BIT(11); // weapon can be dual wielded
const int WEP_FLAG_NODUAL = BIT(12); // weapon doesn't work well with dual wielding (fireball etc just explode on fire), doesn't currently prevent anything
const int WEP_FLAG_PENETRATEWALLS = BIT(13); // weapon has high calibur bullets that can penetrate thick walls (WEAPONTODO)
+const int WEP_FLAG_BLEED = BIT(14); // weapon pierces and causes bleeding (used for damage effects)
// variables:
string weaponorder_byid;
/* spawnfunc */ ATTRIB(MachineGun, m_canonical_spawnfunc, string, "weapon_machinegun");
/* ammotype */ ATTRIB(MachineGun, ammo_type, int, RES_BULLETS);
/* impulse */ ATTRIB(MachineGun, impulse, int, 3);
-/* flags */ ATTRIB(MachineGun, spawnflags, int, WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_TYPE_HITSCAN | WEP_FLAG_PENETRATEWALLS);
+/* flags */ ATTRIB(MachineGun, spawnflags, int, WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_TYPE_HITSCAN | WEP_FLAG_PENETRATEWALLS | WEP_FLAG_BLEED);
/* rating */ ATTRIB(MachineGun, bot_pickupbasevalue, float, 7000);
/* color */ ATTRIB(MachineGun, wpcolor, vector, '1 1 0');
/* modelname */ ATTRIB(MachineGun, mdl, string, "uzi");
/* spawnfunc */ ATTRIB(Shotgun, m_canonical_spawnfunc, string, "weapon_shotgun");
/* ammotype */ ATTRIB(Shotgun, ammo_type, int, RES_SHELLS);
/* impulse */ ATTRIB(Shotgun, impulse, int, 2);
-/* flags */ ATTRIB(Shotgun, spawnflags, int, WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_TYPE_HITSCAN | WEP_TYPE_MELEE_SEC);
+/* flags */ ATTRIB(Shotgun, spawnflags, int, WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_TYPE_HITSCAN | WEP_TYPE_MELEE_SEC | WEP_FLAG_BLEED);
/* rating */ ATTRIB(Shotgun, bot_pickupbasevalue, float, 6000);
/* color */ ATTRIB(Shotgun, wpcolor, vector, '0.5 0.25 0');
/* modelname */ ATTRIB(Shotgun, mdl, string, "shotgun");