54 this.CopyBody_think(
this);
58 this.CopyBody_think =
getthink(
this);
61 CSQCMODEL_AUTOUPDATE(
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;
111 setcefc(clone, getcefc(
this));
112 clone.uncustomizeentityforclient = this.uncustomizeentityforclient;
113 clone.uncustomizeentityforclient_set = this.uncustomizeentityforclient_set;
114 if (keepvelocity == 1)
116 clone.oldvelocity = clone.velocity;
117 clone.alpha = this.
alpha;
122 setsize(clone, this.
mins, this.
maxs);
123 clone.reset = SUB_Remove;
124 clone._ps = this.
_ps;
128 if(clone.colormap <=
maxclients && clone.colormap > 0)
131 CSQCMODEL_AUTOINIT(clone);
132 clone.CopyBody_nextthink = this.
nextthink;
133 clone.CopyBody_think =
getthink(
this);
134 clone.nextthink =
time;
167 int animbits = deadbits;
168 if(STAT(FROZEN,
this))
182 Violence_GibSplash_At(hitloc, force, 2,
bound(0, damage, 200) / 16,
this, attacker);
199 Violence_GibSplash_At(hitloc, force * -0.1, 3, 1,
this, attacker);
201 Violence_GibSplash_At(hitloc, force * -0.2, 3, 1,
this, attacker);
219 Violence_GibSplash(
this, 1, 1, attacker);
234 float take = 0, save = 0;
241 if (
this != attacker &&
IS_PLAYER(attacker))
247 if (STAT(FROZEN,
this))
261 ear1_z += 0.125 * this.
view_ofs.z + 0.875 * this.
maxs.z;
266 d = inflictor.origin - this.
origin;
272 Violence_GibSplash_At(ear1, force * -1, 2,
bound(0, damage, 25) / 2 * (0.5 - 0.5 * f),
this, attacker);
273 Violence_GibSplash_At(ear2, force, 2,
bound(0, damage, 25) / 2 * (0.5 + 0.5 * f),
this, attacker);
286 Violence_GibSplash_At(hitloc, force, 2,
bound(0, damage, 200) / 16,
this, attacker);
317 MUTATOR_CALLHOOK(PlayerDamage_SplitHealthArmor, inflictor, attacker,
this, force, take, save, deathtype, damage);
320 float excess =
max(0, damage - take - save);
324 if (save > 10 && (initial_health - take) > 0)
333 Violence_GibSplash_At(hitloc, force * -0.1, 3, 1,
this, attacker);
335 Violence_GibSplash_At(hitloc, force * -0.2, 3, 1,
this, attacker);
351 if(autocvar_sv_gentle < 1) {
368 if(deathtype == DEATH_FALL.m_id)
386 shake = damage * 5 / (
bound(0,
skill,100) + 1);
387 this.v_angle_x = this.
v_angle.x + (
random() * 2 - 1) * shake;
388 this.v_angle_y = this.
v_angle.y + (
random() * 2 - 1) * shake;
402 bool valid_damage_for_weaponstats =
false;
408 if(attacker &&
this != attacker)
412 awep = attacker.(weaponentity).m_weapon;
415 valid_damage_for_weaponstats =
true;
420 if(valid_damage_for_weaponstats)
425 bool forbid_logging_damage =
MUTATOR_CALLHOOK(PlayerDamaged, attacker,
this, dh, da, hitloc, deathtype, damage);
427 if ((dh || da) && !forbid_logging_damage)
429 float realdmg = damage - excess;
430 if ((
this != attacker || deathtype == DEATH_KILL.m_id) && realdmg && !STAT(FROZEN,
this)
442 bool defer_ClientKill_Now_TeamChange =
false;
446 PlayerStats_GameReport_Event_Player(
this, PLAYERSTATS_ALIVETIME,
time - this.
alivetime);
450 if(valid_damage_for_weaponstats)
453 if(autocvar_sv_gentle < 1)
456 if(deathtype == DEATH_DROWN.m_id)
468 defer_ClientKill_Now_TeamChange =
true;
471 if(deathtype == DEATH_KILL.m_id)
474 Send_Effect(EFFECT_ROCKET_EXPLODE, this.
origin,
'0 0 0', 1);
480 Obituary(attacker, inflictor,
this, deathtype, weaponentity);
485 CS(attacker).accuracy.(accuracy_frags[w.
m_id-1]) += 1;
489 damage =
M_ARGV(4,
float);
490 excess =
max(0, damage - take - save);
498 Weapon wep = this.(went).m_weapon;
499 wep.wr_playerdeath(wep,
this, went);
508 if(defer_ClientKill_Now_TeamChange)
524 WaypointSprite_PlayerDead(
this);
562 STAT(AIR_FINISHED,
this) = 0;
574 this.event_damage(
this, inflictor, attacker, excess, deathtype, weaponentity, hitloc, force);
580 this.CopyBody_think =
getthink(
this);
586 if(autocvar_sv_gentle > 0 || autocvar_ekg || this.
classname ==
"body") {
589 this.event_damage(
this, inflictor, attacker,
autocvar_sv_gibhealth + 1, deathtype, weaponentity, hitloc, force);
595 FOREACH(Weapons, it != WEP_Null,
597 it.wr_resetplayer(it,
this);
619 int globhandle, i, n;
643 for (i = 0; i < n; ++i)
654 if (globhandle < 0)
return;
656 for (
int i = 0; i < n; ++i)
ERASEABLE void IL_REMOVE(IntrusiveList this, entity it)
Remove any element, anywhere in the list.
#define round_handler_IsActive()
bool PlayerHeal(entity targ, entity inflictor, float amount, float limit)
#define PHYS_INPUT_BUTTON_CHAT(s)
const int ANIMSTATE_FROZEN
void Portal_ClearAllLater(entity own)
bool SetResourceExplicit(entity e, Resource res_type, float amount)
Sets the resource amount of an entity without calling any hooks.
float autocvar_g_balance_pause_health_regen
void PrecachePlayerSounds(string f)
void animdecide_setframes(entity e, float support_blending,.float fld_frame,.float fld_frame1time,.float fld_frame2,.float fld_frame2time)
const int VOICETYPE_PLAYERSOUND
void WeaponStats_LogKill(float awep, float abot, float vwep, float vbot)
const int TELEPORT_SIMPLE
void animdecide_setstate(entity e, int newstate, float restart)
bool animstate_override
true for one cycle, then changed to false
void precache_playermodels(string s)
Header file that describes the handicap system.
float frame2
secondary framegroup animation (strength = lerpfrac)
IntrusiveList g_damagedbycontents
void Obituary(entity attacker, entity inflictor, entity targ, int deathtype,.entity weaponentity)
void animdecide_load_if_needed(entity e)
void PlayerDamage(entity this, entity inflictor, entity attacker, float damage, int deathtype,.entity weaponentity, vector hitloc, vector force)
ClientState CS(Client this)
#define GameRules_scoring_add(client, fld, value)
string autocvar_sv_defaultplayermodel
int killindicator_teamchange
float anim_lower_implicit_time
float frame2time
start time of framegroup animation
#define round_handler_IsRoundStarted()
string autocvar_sv_defaultplayermodel_blue
const int ANIMACTION_PAIN2
#define UNSET_ONGROUND(s)
float autocvar_g_maxpushtime
#define DEATH_WEAPONOF(t)
const int ANIMSTATE_FOLLOW
#define FOREACH_WORD(words, cond, body)
#define IS_REAL_CLIENT(v)
void TakeResource(entity receiver, Resource res_type, float amount)
Takes an entity some resource.
#define ATTACK_FINISHED_FOR(ent, w, slot)
float anim_upper_implicit_time
void Unfreeze(entity targ, bool reset_health)
void precache_playermodel(string m)
ERASEABLE entity IL_PUSH(IntrusiveList this, entity it)
Push to tail.
void GiveResourceWithLimit(entity receiver, Resource res_type, float amount, float limit)
Gives an entity some resource but not more than a limit.
string autocvar_sv_defaultplayermodel_yellow
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"))
const int MAX_WEAPONSLOTS
float autocvar_g_ballistics_density_corpse
void animdecide_setimplicitstate(entity e, float onground)
void animdecide_setaction(entity e, float action, float restart)
void player_anim(entity this)
float Handicap_GetTotalHandicap(entity player)
Returns the total handicap of the player.
void ClientKill_Now_TeamChange(entity this)
void player_setupanimsformodel(entity this)
bool autocvar_sv_defaultcharacter
void SpawnThrownWeapon(entity this, vector org, Weapon wep,.entity weaponentity)
void RemoveGrapplingHooks(entity pl)
const int ANIMACTION_PAIN1
vector(float skel, float bonenum) _skel_get_boneabs_hidden
const int WEP_FLAG_CANCLIMB
#define ITEM_DAMAGE_NEEDKILL(dt)
float GetResource(entity e, Resource res_type)
Returns the current amount of resource the given entity has.
float anim_lower_implicit_action
float autocvar_g_spawnshield_blockdamage
void calculate_player_respawn_time(entity this)
void WeaponStats_LogDamage(float awep, float abot, float vwep, float vbot, float damage)
string autocvar_sv_defaultplayermodel_red
bool accuracy_isgooddamage(entity attacker, entity targ)
#define MUTATOR_CALLHOOK(id,...)
const int ANIMSTATE_DEAD2
#define IS_BOT_CLIENT(v)
want: (IS_CLIENT(v) && !IS_REAL_CLIENT(v))
void Drop_Special_Items(entity player)
float frame
primary framegroup animation (strength = 1 - lerpfrac - lerpfrac3 - lerpfrac4)
entity weaponentities[MAX_WEAPONSLOTS]
float pauseregen_finished
const int ANIMSTATE_DEAD1
void SUB_SetFade(entity ent, float vanish_time, float fading_time)
float autocvar_sv_gibhealth
void Drag_MoveDrag(entity from, entity to)
float default_player_alpha
float anim_upper_implicit_action
#define DEATH_ISSPECIAL(t)
#define sound(e, c, s, v, a)
void CopyBody(entity this, float keepvelocity)
float autocvar_g_balance_armor_blockpercent
void PlayerCorpseDamage(entity this, entity inflictor, entity attacker, float damage, int deathtype,.entity weaponentity, vector hitloc, vector force)
fields which are explicitly/manually set are marked with "M", fields set automatically are marked wit...
ERASEABLE bool fexists(string f)
#define FOREACH(list, cond, body)
void precache_all_playermodels(string pattern)
string autocvar_sv_defaultplayermodel_pink
void set_movetype(entity this, int mt)
void CopyBody_Think(entity this)
float frame1time
start time of framegroup animation
bool autocvar_sv_precacheplayermodels