.entity pusher;
.float pushltime;
+.float istypefrag;
.float CopyBody_nextthink;
.void(void) CopyBody_think;
self.lip = oldself.lip;
self.colormap = oldself.colormap;
self.iscreature = oldself.iscreature;
+ self.teleportable = oldself.teleportable;
self.damagedbycontents = oldself.damagedbycontents;
self.angles = oldself.angles;
self.avelocity = oldself.avelocity;
Drag_MoveDrag(oldself, self);
- self.owner = oldself;
-
if(self.colormap <= maxclients && self.colormap > 0)
self.colormap = 1024 + oldself.clientcolors;
if (!self.animstate_override)
{
- if (!(self.flags & FL_ONGROUND) || self.BUTTON_JUMP)
+ if (self.freezetag_frozen)
+ setanim(self, self.anim_idle, TRUE, FALSE, FALSE);
+ else if (!(self.flags & FL_ONGROUND) || self.BUTTON_JUMP)
{
if (self.crouch)
{
float j;
for(j = WEP_FIRST; j <= WEP_LAST; ++j)
{
- if(self.weapons & W_WeaponBit(j))
+ if(WEPSET_CONTAINS_EW(self, j))
if(W_IsWeaponThrowable(j))
W_ThrowNewWeapon(self, j, FALSE, org, randomvec() * 175 + '0 0 325');
}
self.alpha = -1;
self.solid = SOLID_NOT; // restore later
self.takedamage = DAMAGE_NO; // restore later
+ self.damagedbycontents = FALSE;
}
}
void ClientKill_Now_TeamChange();
-void freezetag_CheckWinner();
void PlayerDamage (entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
{
float valid_damage_for_weaponstats;
float excess;
- if((g_arena && numspawned < 2) || (g_ca && !ca_teams_ok) && !inWarmupStage)
- return;
-
dh = max(self.health, 0);
da = max(self.armorvalue, 0);
take = damage;
}
+ if(attacker == self)
+ {
+ // don't reset pushltime for self damage as it may be an attempt to
+ // escape a lava pit or similar
+ //self.pushltime = 0;
+ self.istypefrag = 0;
+ }
+ else if(attacker.classname == "player")
+ {
+ self.pusher = attacker;
+ self.pushltime = time + autocvar_g_maxpushtime;
+ self.istypefrag = self.BUTTON_CHAT;
+ }
+ else if(time < self.pushltime)
+ {
+ attacker = self.pusher;
+ self.pushltime = max(self.pushltime, time + 0.6);
+ }
+ else
+ {
+ self.pushltime = 0;
+ self.istypefrag = 0;
+ }
+
frag_inflictor = inflictor;
frag_attacker = attacker;
frag_target = self;
self.dmg_take = self.dmg_take + take;//max(take - 10, 0);
self.dmg_inflictor = inflictor;
- if(attacker == self)
- {
- // don't reset pushltime for self damage as it may be an attempt to
- // escape a lava pit or similar
- //self.pushltime = 0;
- }
- else if(attacker.classname == "player")
- {
- self.pusher = attacker;
- self.pushltime = time + autocvar_g_maxpushtime;
- }
- else if(time < self.pushltime)
- {
- attacker = self.pusher;
- self.pushltime = max(self.pushltime, time + 0.6);
- }
- else
- self.pushltime = 0;
+ if(g_ca && self != attacker && attacker.classname == "player")
+ PlayerScore_Add(attacker, SP_SCORE, (damage - excess) * autocvar_g_ca_damage2score_multiplier);
float abot, vbot, awep;
abot = (clienttype(attacker) == CLIENTTYPE_BOT);
vbot = (clienttype(self) == CLIENTTYPE_BOT);
valid_damage_for_weaponstats = 0;
+ awep = 0;
+
if(vbot || clienttype(self) == CLIENTTYPE_REAL)
if(abot || clienttype(attacker) == CLIENTTYPE_REAL)
if(attacker && self != attacker)
}
}
- if(!g_freezetag)
- {
- // become fully visible
- self.alpha = default_player_alpha;
- // throw a weapon
- SpawnThrownWeapon (self.origin + (self.mins + self.maxs) * 0.5, self.switchweapon);
- }
-
// print an obituary message
Obituary (attacker, inflictor, self, deathtype);
race_PreDie();
if(accuracy_isgooddamage(attacker, self))
attacker.accuracy.(accuracy_frags[w-1]) += 1;
- if(deathtype == DEATH_HURTTRIGGER && g_freezetag)
- {
- PutClientInServer();
- count_alive_players(); // re-count players
- freezetag_CheckWinner();
- return;
- }
-
frag_attacker = attacker;
frag_inflictor = inflictor;
frag_target = self;
+ frag_deathtype = deathtype;
MUTATOR_CALLHOOK(PlayerDies);
+
weapon_action(self.weapon, WR_PLAYERDEATH);
RemoveGrapplingHook(self);
- if(self.flagcarried)
- {
- if(attacker.classname != "player")
- DropFlag(self.flagcarried, self, attacker); // penalty for flag loss by suicide
- else if(attacker.team == self.team)
- DropFlag(self.flagcarried, attacker, attacker); // penalty for flag loss by suicide/teamkill
- else
- DropFlag(self.flagcarried, world, attacker);
- }
- if(self.ballcarried && g_nexball)
- DropBall(self.ballcarried, self.origin, self.velocity);
Portal_ClearAllLater(self);
if(clienttype(self) == CLIENTTYPE_REAL)
//WriteAngle (MSG_ONE, 80);
}
- if(defer_ClientKill_Now_TeamChange) // TODO does this work with FreezeTag?
- ClientKill_Now_TeamChange();
+ if(defer_ClientKill_Now_TeamChange)
+ ClientKill_Now_TeamChange(); // can turn player into spectator
- if(g_arena)
- Spawnqueue_Unmark(self);
-
- if(g_freezetag)
+ // player could have been miraculously resuscitated ;)
+ // e.g. players in freezetag get frozen, they don't really die
+ if(self.health >= 1 || self.classname != "player")
return;
// when we get here, player actually dies
- // clear waypoints (do this AFTER FreezeTag)
+
+ // clear waypoints
WaypointSprite_PlayerDead();
+ // throw a weapon
+ SpawnThrownWeapon (self.origin + (self.mins + self.maxs) * 0.5, self.switchweapon);
+ // become fully visible
+ self.alpha = default_player_alpha;
// make the corpse upright (not tilted)
self.angles_x = 0;
self.angles_z = 0;
// 0 = reject
// -1 = fake accept
{
- string msgstr, colorstr, cmsgstr, namestr, fullmsgstr, sourcemsgstr, fullcmsgstr, sourcecmsgstr, privatemsgprefix;
- float flood, privatemsgprefixlen;
+ string msgstr, colorstr, cmsgstr, namestr, fullmsgstr, sourcemsgstr, fullcmsgstr, sourcecmsgstr;
+ float flood;
var .float flood_field;
entity head;
float ret;
-
- if(Ban_MaybeEnforceBan(source))
- return 0;
+ string privatemsgprefix = string_null; float privatemsgprefixlen = 0;
if(!teamsay && !privatesay)
if(substring(msgin, 0, 1) == " ")
else if(teamplay)
colorstr = Team_ColorCode(source.team);
else
+ {
+ colorstr = "";
teamsay = FALSE;
+ }
if(intermission_running)
teamsay = FALSE;
// FLOOD CONTROL
flood = 0;
+ flood_field = floodcontrol_chat;
if(floodcontrol)
{
float flood_spl;
if(source.classname != "player")
{
if not(intermission_running)
- if(teamsay || (autocvar_g_chat_nospectators == 1) || (autocvar_g_chat_nospectators == 2 && !inWarmupStage))
+ if(teamsay || (autocvar_g_chat_nospectators == 1) || (autocvar_g_chat_nospectators == 2 && !(inWarmupStage || gameover)))
teamsay = -1; // spectators
}