#include "../common/mutators/mutator/waypoints/waypointsprites.qh"
#include "../common/triggers/include.qh"
#include "../common/wepent.qh"
#include "../common/mutators/mutator/waypoints/waypointsprites.qh"
#include "../common/triggers/include.qh"
#include "../common/wepent.qh"
clone.move_qcphysics = false; // don't run gamecode logic on clones, too many
set_movetype(clone, this.move_movetype);
clone.solid = this.solid;
clone.move_qcphysics = false; // don't run gamecode logic on clones, too many
set_movetype(clone, this.move_movetype);
clone.solid = this.solid;
clone.takedamage = this.takedamage;
setcefc(clone, getcefc(this));
clone.uncustomizeentityforclient = this.uncustomizeentityforclient;
clone.takedamage = this.takedamage;
setcefc(clone, getcefc(this));
clone.uncustomizeentityforclient = this.uncustomizeentityforclient;
-void PlayerCorpseDamage(entity this, entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force)
+void PlayerCorpseDamage(entity this, entity inflictor, entity attacker, float damage, int deathtype, .entity weaponentity, vector hitloc, vector force)
{
float take, save;
vector v;
Violence_GibSplash_At(hitloc, force, 2, bound(0, damage, 200) / 16, this, attacker);
{
float take, save;
vector v;
Violence_GibSplash_At(hitloc, force, 2, bound(0, damage, 200) / 16, this, attacker);
v = healtharmor_applydamage(this.armorvalue, autocvar_g_balance_armor_blockpercent, deathtype, damage);
take = v.x;
save = v.y;
v = healtharmor_applydamage(this.armorvalue, autocvar_g_balance_armor_blockpercent, deathtype, damage);
take = v.x;
save = v.y;
-void PlayerDamage(entity this, entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force)
+void PlayerDamage(entity this, entity inflictor, entity attacker, float damage, int deathtype, .entity weaponentity, vector hitloc, vector force)
{
float take, save, dh, da;
vector v;
{
float take, save, dh, da;
vector v;
- damage *= bound(1.0, CS(this).cvar_cl_handicap, 10.0);
- if(this != attacker && IS_PLAYER(attacker))
- damage /= bound(1.0, CS(attacker).cvar_cl_handicap, 10.0);
+ damage *= Handicap_GetTotalHandicap(this);
+ if (this != attacker && IS_PLAYER(attacker))
+ {
+ damage /= Handicap_GetTotalHandicap(attacker);
+ }
- Obituary (attacker, inflictor, this, deathtype);
+ Obituary (attacker, inflictor, this, deathtype, weaponentity);
// increment frag counter for used weapon type
Weapon w = DEATH_WEAPONOF(deathtype);
if(w != WEP_Null && accuracy_isgooddamage(attacker, this))
// increment frag counter for used weapon type
Weapon w = DEATH_WEAPONOF(deathtype);
if(w != WEP_Null && accuracy_isgooddamage(attacker, this))
MUTATOR_CALLHOOK(PlayerDies, inflictor, attacker, this, deathtype, damage);
damage = M_ARGV(4, float);
excess = max(0, damage - take - save);
MUTATOR_CALLHOOK(PlayerDies, inflictor, attacker, this, deathtype, damage);
damage = M_ARGV(4, float);
excess = max(0, damage - take - save);
// when we get here, player actually dies
Unfreeze(this); // remove any icy remains
// when we get here, player actually dies
Unfreeze(this); // remove any icy remains
set_movetype(this, MOVETYPE_TOSS);
// shootable corpse
this.solid = SOLID_CORPSE;
set_movetype(this, MOVETYPE_TOSS);
// shootable corpse
this.solid = SOLID_CORPSE;
this.death_time = time;
if (random() < 0.5)
animdecide_setstate(this, this.anim_state | ANIMSTATE_DEAD1, true);
else
animdecide_setstate(this, this.anim_state | ANIMSTATE_DEAD2, true);
this.death_time = time;
if (random() < 0.5)
animdecide_setstate(this, this.anim_state | ANIMSTATE_DEAD1, true);
else
animdecide_setstate(this, this.anim_state | ANIMSTATE_DEAD2, true);
// set damage function to corpse damage
this.event_damage = PlayerCorpseDamage;
// call the corpse damage function just in case it wants to gib
// set damage function to corpse damage
this.event_damage = PlayerCorpseDamage;
// call the corpse damage function just in case it wants to gib
- this.event_damage(this, inflictor, attacker, excess, deathtype, hitloc, force);
+ this.event_damage(this, inflictor, attacker, excess, deathtype, weaponentity, hitloc, force);
// set up to fade out later
SUB_SetFade (this, time + 6 + random (), 1);
// set up to fade out later
SUB_SetFade (this, time + 6 + random (), 1);
if(autocvar_sv_gentle > 0 || autocvar_ekg || this.classname == "body") {
// remove corpse
// clones don't run any animation code any more, so we must gib them when they die :(
if(autocvar_sv_gentle > 0 || autocvar_ekg || this.classname == "body") {
// remove corpse
// clones don't run any animation code any more, so we must gib them when they die :(
- PlayerCorpseDamage(this, inflictor, attacker, autocvar_sv_gibhealth+1.0, deathtype, hitloc, force);
+ this.event_damage(this, inflictor, attacker, autocvar_sv_gibhealth + 1, deathtype, weaponentity, hitloc, force);
{
int lockteams_backup = lockteams; // backup any team lock
lockteams = 0; // disable locked teams
TeamchangeFrags(client); // move the players frags
{
int lockteams_backup = lockteams; // backup any team lock
lockteams = 0; // disable locked teams
TeamchangeFrags(client); // move the players frags
- SetPlayerColors(client, team_colour - 1); // set the players colour
- Damage(client, client, client, 100000, DEATH_AUTOTEAMCHANGE.m_id, client.origin, '0 0 0'); // kill the player
+ if (!SetPlayerTeamSimple(client, team_colour))
+ {
+ return false;
+ }
+ Damage(client, client, client, 100000, DEATH_AUTOTEAMCHANGE.m_id, DMG_NOWEP, client.origin, '0 0 0'); // kill the player
lockteams = lockteams_backup; // restore the team lock
LogTeamchange(client.playerid, client.team, type);
lockteams = lockteams_backup; // restore the team lock
LogTeamchange(client.playerid, client.team, type);
- LOG_INFO("NOTE: ", playername(source, true), "^7 is flooding.\n");
+ LOG_INFO("NOTE: ", playername(source, true), "^7 is flooding.");