54 this.CopyBody_think(
this);
58 this.CopyBody_think =
getthink(
this);
75 if(clone.damagedbycontents)
77 clone.angles = this.
angles;
83 clone.event_damage = this.event_damage;
84 clone.event_heal = this.event_heal;
103 clone.model = this.
model;
105 clone.skin = this.
skin;
107 clone.move_qcphysics =
false;
109 clone.solid = this.
solid;
112 clone.uncustomizeentityforclient = this.uncustomizeentityforclient;
114 if (keepvelocity == 1)
116 clone.oldvelocity = clone.velocity;
117 clone.alpha = this.
alpha;
121 setorigin(clone, this.
origin);
122 setsize(clone, this.
mins, this.
maxs);
124 clone._ps = this.
_ps;
128 if(clone.colormap <=
maxclients && clone.colormap > 0)
130 clone.sv_entnum =
etof(
this);
133 clone.CopyBody_nextthink = this.
nextthink;
134 clone.CopyBody_think =
getthink(
this);
135 clone.nextthink =
time;
168 int animbits = deadbits;
177 animbits =
M_ARGV(1,
int);
239 float take = 0, save = 0;
246 if (
this != attacker &&
IS_PLAYER(attacker))
261 ear1_z += 0.125 * this.
view_ofs.z + 0.875 * this.
maxs.z;
266 d = inflictor.origin - this.
origin;
313 attacker = attacker.realowner;
322 MUTATOR_CALLHOOK(PlayerDamage_SplitHealthArmor, inflictor, attacker,
this, force, take, save, deathtype, damage);
325 float excess =
max(0, damage - take - save);
329 if (save > 10 && (initial_health - take) > 0)
356 if(autocvar_sv_gentle < 1) {
373 if(deathtype == DEATH_FALL.m_id)
391 shake = damage * 5 / (
bound(0,
skill,100) + 1);
392 this.v_angle_x = this.
v_angle.x + (
random() * 2 - 1) * shake;
393 this.v_angle_y = this.
v_angle.y + (
random() * 2 - 1) * shake;
407 bool valid_damage_for_weaponstats =
false;
413 if(attacker &&
this != attacker)
417 awep = attacker.(weaponentity).
m_weapon;
420 valid_damage_for_weaponstats =
true;
423 float dh = initial_health -
max(
GetResource(
this, RES_HEALTH), 0);
425 if(valid_damage_for_weaponstats)
430 bool forbid_logging_damage =
MUTATOR_CALLHOOK(PlayerDamaged, attacker,
this, dh, da, hitloc, deathtype, damage);
432 if ((dh || da) && !forbid_logging_damage)
434 float realdmg = damage - excess;
435 if ((
this != attacker || deathtype == DEATH_KILL.m_id) && realdmg
443 attacker.score_frame_dmg += realdmg;
452 bool defer_ClientKill_Now_TeamChange =
false;
460 if(valid_damage_for_weaponstats)
463 if(autocvar_sv_gentle < 1)
466 if(deathtype == DEATH_DROWN.m_id)
478 defer_ClientKill_Now_TeamChange =
true;
481 if(deathtype == DEATH_KILL.m_id)
490 Obituary(attacker, inflictor,
this, deathtype, weaponentity);
495 CS(attacker).accuracy.(accuracy_frags[w.
m_id-1]) += 1;
499 damage =
M_ARGV(4,
float);
500 excess =
max(0, damage - take - save);
518 if(defer_ClientKill_Now_TeamChange)
569 STAT(AIR_FINISHED,
this) = 0;
581 this.event_damage(
this, inflictor, attacker, excess, deathtype, weaponentity, hitloc, force);
587 this.CopyBody_think =
getthink(
this);
596 this.event_damage(
this, inflictor, attacker,
autocvar_sv_gibhealth + 1, deathtype, weaponentity, hitloc, force);
604 it.wr_resetplayer(it,
this);
618 if (hlth <= 0 || hlth >= limit)
627 int globhandle, i, n;
651 for (i = 0; i < n; ++i)
662 if (globhandle < 0)
return;
664 for (
int i = 0; i < n; ++i)
void accuracy_add(entity this, Weapon w, float fired, float hit, float real)
update accuracy stats
bool accuracy_isgooddamage(entity attacker, entity targ)
does this damage count towards accuracy stats?
float frame1time
start time of framegroup animation
bool animstate_override
true for one cycle, then changed to false
float frame2time
start time of framegroup animation
float frame2
secondary framegroup animation (strength = lerpfrac)
float frame
primary framegroup animation (strength = 1 - lerpfrac - lerpfrac3 - lerpfrac4)
void animdecide_setimplicitstate(entity e, float onground)
void animdecide_load_if_needed(entity e)
void animdecide_setframes(entity e, float support_blending,.float fld_frame,.float fld_frame1time,.float fld_frame2,.float fld_frame2time)
void animdecide_setstate(entity e, int newstate, float restart)
void animdecide_setaction(entity e, float action, float restart)
const int ANIMSTATE_FROZEN
float anim_lower_implicit_time
const int ANIMSTATE_DEAD1
float anim_upper_implicit_action
float anim_lower_implicit_action
const int ANIMSTATE_FOLLOW
const int ANIMACTION_PAIN2
const int ANIMSTATE_DEAD2
const int ANIMACTION_PAIN1
float anim_upper_implicit_time
#define MUTATOR_CALLHOOK(id,...)
void Drag_MoveDrag(entity from, entity to)
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
float GetResource(entity e, Resource res_type)
Returns the current amount of resource the given entity has.
void TakeResource(entity receiver, Resource res_type, float amount)
Takes an entity some resource.
bool SetResourceExplicit(entity e, Resource res_type, float amount)
Sets the resource amount of an entity without calling any hooks.
fields which are explicitly/manually set are marked with "M", fields set automatically are marked wit...
virtual void wr_playerdeath()
(SERVER) called whenever a player dies
void ClientKill_Now_TeamChange(entity this)
int killindicator_teamchange
#define PHYS_INPUT_BUTTON_CHAT(s)
vector healtharmor_applydamage(float a, float armorblock, int deathtype, float damage)
#define CSQCMODEL_AUTOUPDATE(e)
#define CSQCMODEL_AUTOINIT(e)
void Obituary(entity attacker, entity inflictor, entity targ, int deathtype,.entity weaponentity)
float autocvar_g_balance_armor_blockpercent
IntrusiveList g_damagedbycontents
float autocvar_g_maxpushtime
#define DEATH_ISSPECIAL(t)
#define DEATH_WEAPONOF(t)
void SUB_Remove(entity this)
Remove entity.
void Send_Effect(entity eff, vector eff_loc, vector eff_vel, int eff_cnt)
ERASEABLE bool fexists(string f)
void Violence_GibSplash(entity source, float type, float amount, entity attacker)
void Violence_GibSplash_At(vector org, vector dir, float type, float amount, entity gibowner, entity attacker)
void PrecachePlayerSounds(string f)
#define PlayerSound(this, def, chan, vol, voicetype)
const int VOICETYPE_PLAYERSOUND
float Handicap_GetTotalHandicap(entity player, bool receiving)
Returns the total handicap of the player.
Header file that describes the handicap system.
ERASEABLE void IL_REMOVE(IntrusiveList this, entity it)
Remove any element, anywhere in the list.
ERASEABLE entity IL_PUSH(IntrusiveList this, entity it)
Push to tail.
#define FOREACH_WORD(words, cond, body)
#define FOREACH(list, cond, body)
float uncustomizeentityforclient_set
void set_movetype(entity this, int mt)
const int MOVETYPE_FOLLOW
#define UNSET_ONGROUND(s)
const int MOVETYPE_NOCLIP
strcat(_("^F4Countdown stopped!"), "\n^BG", _("Teams are too unbalanced."))
const string PLAYERSTATS_ALIVETIME
#define PlayerStats_GameReport_Event_Player(ent, eventid, val)
void Portal_ClearAllLater(entity own)
#define round_handler_IsActive()
#define round_handler_IsRoundStarted()
void calculate_player_respawn_time(entity this)
float pauseregen_finished
void RemoveGrapplingHooks(entity pl)
void PlayerDamage(entity this, entity inflictor, entity attacker, float damage, int deathtype,.entity weaponentity, vector hitloc, vector force)
void player_anim(entity this)
void precache_all_playermodels(string pattern)
void PlayerCorpseDamage(entity this, entity inflictor, entity attacker, float damage, int deathtype,.entity weaponentity, vector hitloc, vector force)
void Drop_Special_Items(entity player)
void precache_playermodels(string s)
void precache_playermodel(string m)
bool PlayerHeal(entity targ, entity inflictor, float amount, float limit)
void CopyBody_Think(entity this)
void player_setupanimsformodel(entity this)
void CopyBody(entity this, float keepvelocity)
string autocvar_sv_defaultplayermodel_blue
float score_frame_dmgtaken
string autocvar_sv_defaultplayermodel_yellow
string autocvar_sv_defaultplayermodel_red
bool autocvar_sv_precacheplayermodels
bool autocvar_sv_defaultcharacter
float autocvar_g_spawnshield_blockdamage
string autocvar_sv_defaultplayermodel
float autocvar_sv_gibhealth
string autocvar_sv_defaultplayermodel_pink
#define sound(e, c, s, v, a)
bool sound_allowed(int to, entity e)
ClientState CS(Client this)
#define PRECACHE(func)
directly after STATIC_INIT_LATE
bool StatusEffects_active(StatusEffect this, entity actor)
void SUB_SetFade(entity ent, float vanish_time, float fading_time)
void GiveResourceWithLimit(entity receiver, Resource res_type, float amount, float limit)
Gives an entity some resource but not more than a limit.
float autocvar_g_balance_pause_health_regen
const int TELEPORT_SIMPLE
void SpawnThrownWeapon(entity this, vector org, Weapon wep,.entity weaponentity)
float autocvar_g_ballistics_density_corpse
#define IS_REAL_CLIENT(v)
#define IS_BOT_CLIENT(v)
want: (IS_CLIENT(v) && !IS_REAL_CLIENT(v))
void WaypointSprite_PlayerDead(entity this)
const int WEP_FLAG_CANCLIMB
const int MAX_WEAPONSLOTS
entity weaponentities[MAX_WEAPONSLOTS]
void WeaponStats_LogKill(float awep, float abot, float vwep, float vbot)
void WeaponStats_LogDamage(float awep, float abot, float vwep, float vbot, float damage)
#define ATTACK_FINISHED_FOR(ent, w, slot)
float default_player_alpha