-#ifndef DAMAGEEFFECTS_H
-#define DAMAGEEFFECTS_H
-
-#ifdef CSQC
-#include <common/deathtypes/all.qh>
-#include <common/physics/movetypes/movetypes.qh>
-#include <client/mutators/events.qh>
-#include <common/vehicles/all.qh>
-#include <common/weapons/all.qh>
-#endif
-
-#endif
-
-#ifdef IMPLEMENTATION
+#include "damageeffects.qh"
WriteHeader(MSG_ENTITY, ENT_CLIENT_DAMAGEINFO);
WriteShort(MSG_ENTITY, this.projectiledeathtype);
WriteHeader(MSG_ENTITY, ENT_CLIENT_DAMAGEINFO);
WriteShort(MSG_ENTITY, this.projectiledeathtype);
- WriteCoord(MSG_ENTITY, floor(this.origin.x));
- WriteCoord(MSG_ENTITY, floor(this.origin.y));
- WriteCoord(MSG_ENTITY, floor(this.origin.z));
+ WriteVector(MSG_ENTITY, org);
WriteByte(MSG_ENTITY, bound(1, this.dmg, 255));
WriteByte(MSG_ENTITY, bound(0, this.dmg_radius, 255));
WriteByte(MSG_ENTITY, bound(1, this.dmg_edge, 255));
WriteByte(MSG_ENTITY, bound(1, this.dmg, 255));
WriteByte(MSG_ENTITY, bound(0, this.dmg_radius, 255));
WriteByte(MSG_ENTITY, bound(1, this.dmg_edge, 255));
{
// time is up or the player got gibbed / disconnected
this.owner.total_damages = max(0, this.owner.total_damages - 1);
{
// time is up or the player got gibbed / disconnected
this.owner.total_damages = max(0, this.owner.total_damages - 1);
// if the player was dead but is now alive, it means he respawned
// if so, clear his damage effects, or damages from his dead body will be copied back
this.owner.total_damages = max(0, this.owner.total_damages - 1);
// if the player was dead but is now alive, it means he respawned
// if so, clear his damage effects, or damages from his dead body will be copied back
this.owner.total_damages = max(0, this.owner.total_damages - 1);
return; // if we aren't using a third person camera, hide our own effects
// now generate the particles
return; // if we aren't using a third person camera, hide our own effects
// now generate the particles
__pointparticles(this.team, org, '0 0 0', 1);
}
__pointparticles(this.team, org, '0 0 0', 1);
}
life = bound(autocvar_cl_damageeffect_lifetime_min, thedamage * autocvar_cl_damageeffect_lifetime, autocvar_cl_damageeffect_lifetime_max);
life = bound(autocvar_cl_damageeffect_lifetime_min, thedamage * autocvar_cl_damageeffect_lifetime, autocvar_cl_damageeffect_lifetime_max);
- effectname = DEATH_WEAPONOF(type).netname;
-
- if(substring(effectname, strlen(effectname) - 5, 5) == "BLOOD")
+ wep = DEATH_WEAPONOF(type);
+ effectname = strcat("damage_", wep.netname);
+ if((wep.spawnflags & WEP_FLAG_BLEED))
- specstr = species_prefix(specnum);
- specstr = substring(specstr, 0, strlen(specstr) - 1);
- effectname = strreplace("BLOOD", specstr, effectname);
+ string specstr = species_prefix(specnum);
+ effectname = strcat(specstr, effectname);
float thedamage, rad, edge, thisdmg;
bool hitplayer = false;
int species, forcemul;
float thedamage, rad, edge, thisdmg;
bool hitplayer = false;
int species, forcemul;
- it.move_velocity = it.move_velocity + damage_explosion_calcpush(it.damageforcescale * thisforce, it.move_velocity, autocvar_g_balance_damagepush_speedfactor);
- it.move_flags &= ~FL_ONGROUND;
+ it.velocity = it.velocity + damage_explosion_calcpush(it.damageforcescale * thisforce, it.velocity, damagepush_speedfactor);
+ UNSET_ONGROUND(it);
DamageEffect(it, w_org, thisdmg, w_deathtype, species);
DamageEffect(it, w_org, thisdmg, w_deathtype, species);
// TODO spawn particle effects and sounds based on w_deathtype
if(!DEATH_ISSPECIAL(w_deathtype))
if(!hitplayer || rad) // don't show ground impacts for hitscan weapons if a player was hit
// TODO spawn particle effects and sounds based on w_deathtype
if(!DEATH_ISSPECIAL(w_deathtype))
if(!hitplayer || rad) // don't show ground impacts for hitscan weapons if a player was hit
w_random = prandom();
traceline(w_org - normalize(force) * 16, w_org + normalize(force) * 16, MOVE_NOMONSTERS, NULL);
w_random = prandom();
traceline(w_org - normalize(force) * 16, w_org + normalize(force) * 16, MOVE_NOMONSTERS, NULL);