10 WriteHeader(MSG_ENTITY, ENT_CLIENT_DAMAGEINFO);
12 WriteVector(MSG_ENTITY, org);
35 e.projectiledeathtype = deathtype;
37 e.dmg_edge = edgedamage;
39 e.dmg_force =
vlen(force);
42 e.species = bloodtype;
61 void DamageEffect_Think(
entity this)
64 if(autocvar_cl_damageeffect_distribute)
69 if(
time >= this.
cnt || !this.
owner || !this.
owner.modelindex || !
this.owner.drawmask)
72 this.
owner.total_damages =
max(0, this.
owner.total_damages - 1);
80 this.
owner.total_damages =
max(0, this.
owner.total_damages - 1);
90 __pointparticles(this.
team, org,
'0 0 0', 1);
93 string species_prefix(
int specnum)
108 void DamageEffect(
entity this,
vector hitorg,
float thedamage,
int type,
int specnum)
136 nearestbone = tagnum;
144 if(this.total_damages >= autocvar_cl_damageeffect_bones)
149 if(autocvar_cl_damageeffect < 2 || this.total_damages)
153 life =
bound(autocvar_cl_damageeffect_lifetime_min, thedamage * autocvar_cl_damageeffect_lifetime, autocvar_cl_damageeffect_lifetime_max);
156 effectname =
strcat(
"damage_", wep.netname);
162 string specstr = species_prefix(specnum);
163 effectname =
strcat(specstr, effectname);
173 e.team = _particleeffectnum(effectname);
176 this.total_damages += 1;
181 float thedamage, rad, edge, thisdmg;
182 bool hitplayer =
false;
190 w_org = ReadVector();
192 thedamage = ReadByte();
196 species = ReadByte();
212 vector nearest = NearestPointOnBox(it, w_org);
215 thisdmg = ((vlen (nearest - w_org) - bound(MIN_DAMAGEEXTRARADIUS, it.damageextraradius, MAX_DAMAGEEXTRARADIUS)) / rad);
222 thisdmg = thedamage + (edge - thedamage) * thisdmg;
223 thisforce = forcemul * vlen(force) * (thisdmg / thedamage) * normalize(it.origin - w_org);
228 thisforce = forcemul * vlen(force) * normalize(it.origin - w_org);
233 if(vdist((nearest - w_org), >, bound(MIN_DAMAGEEXTRARADIUS, it.damageextraradius, MAX_DAMAGEEXTRARADIUS)))
237 thisforce = forcemul * force;
240 if(it.damageforcescale)
241 if(
vdist(thisforce, !=, 0))
251 it.event_damage(it, thisdmg,
w_deathtype, w_org, thisforce);
253 DamageEffect(it, w_org, thisdmg,
w_deathtype, species);
275 case DEATH_VH_SPID_MINIGUN:
279 case DEATH_VH_SPID_ROCKET:
283 case DEATH_VH_SPID_DEATH:
288 case DEATH_VH_WAKI_GUN:
292 case DEATH_VH_WAKI_ROCKET:
296 case DEATH_VH_WAKI_DEATH:
301 case DEATH_VH_RAPT_CANNON:
305 case DEATH_VH_RAPT_FRAGMENT:
308 for(i = 1; i < 4; ++i)
312 RaptorCBShellfragToss(w_org, vel, ang +
'0 0 1' * (120 * i));
317 case DEATH_VH_RAPT_BOMB:
321 case DEATH_VH_RAPT_DEATH:
325 case DEATH_VH_BUMB_GUN:
345 case DEATH_TURRET_EWHEEL:
350 case DEATH_TURRET_FLAC:
355 case DEATH_TURRET_MLRS:
356 case DEATH_TURRET_HK:
357 case DEATH_TURRET_WALK_ROCKET:
358 case DEATH_TURRET_HELLION:
363 case DEATH_TURRET_MACHINEGUN:
364 case DEATH_TURRET_WALK_GUN:
369 case DEATH_TURRET_PLASMA:
374 case DEATH_TURRET_WALK_MELEE:
379 case DEATH_TURRET_PHASER:
382 case DEATH_TURRET_TESLA:
383 te_smallflash(this.
origin);
393 if(!hitplayer || rad)
408 hitwep.wr_impacteffect(hitwep,
this);
#define DEATH_ISVEHICLE(t)
#define DEATH_ISTURRET(t)
float compressShortVector(vector vec)
#define REGISTER_NET_LINKED(id)
const int SPECIES_ROBOT_RUSTY
float trace_dphitq3surfaceflags
vector damage_explosion_calcpush(vector explosion_f, vector target_v, float speedfactor)
#define NET_HANDLE(id, param)
bool Damage_DamageInfo_SendEntity(entity this, entity to, int sf)
#define UNSET_ONGROUND(s)
#define DEATH_WEAPONOF(t)
#define setmodel(this, m)
int spawnflags
M: flags : WEPSPAWNFLAG_...
const float MOVE_NOMONSTERS
int autocvar_cl_gentle_damage
spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 f1 s1 strcat(_("Level %s: "), "^BG%s\3\, _("^BGPress ^F2%s^BG to enter the game"))
float damagepush_speedfactor
const int SPECIES_ROBOT_SHINY
vector decompressShortVector(int data)
vector(float skel, float bonenum) _skel_get_boneabs_hidden
const int SPECIES_RESERVED
#define vdist(v, cmp, f)
Vector distance comparison, avoids sqrt()
const int SPECIES_ROBOT_SOLID
const float MAX_DAMAGEEXTRARADIUS
#define MUTATOR_CALLHOOK(id,...)
Sound SND_HAGEXP_RANDOM()
void Damage_DamageInfo(vector org, float coredamage, float edgedamage, float rad, vector force, int deathtype, float bloodtype, entity dmgowner)
#define new_pure(class)
purely logical entities (.origin doesn't work)
vector trace_plane_normal
int autocvar_chase_active
#define DEATH_ISSPECIAL(t)
#define sound(e, c, s, v, a)
fields which are explicitly/manually set are marked with "M", fields set automatically are marked wit...
const int WEP_TYPE_HITSCAN