self.dmg_take = self.dmg_take + take;//max(take - 10, 0);
self.dmg_inflictor = inflictor;
- if(g_ca && self != attacker && IS_PLAYER(attacker))
- PlayerTeamScore_Add(attacker, SP_SCORE, ST_SCORE, (damage - excess) * autocvar_g_ca_damage2score_multiplier);
-
float abot, vbot, awep;
abot = (IS_BOT_CLIENT(attacker));
vbot = (IS_BOT_CLIENT(self));
return 1;
}
+MUTATOR_HOOKFUNCTION(arena_FilterItem)
+{
+ if(autocvar_g_powerups <= 0)
+ if(self.flags & FL_POWERUP)
+ return TRUE;
+
+ return FALSE;
+}
+
void arena_Initialize()
{
maxspawned = max(2, autocvar_g_arena_maxspawned);
MUTATOR_HOOK(GiveFragsForKill, arena_GiveFragsForKill, CBC_ORDER_ANY);
MUTATOR_HOOK(PlayerDies, arena_PlayerDies, CBC_ORDER_ANY);
MUTATOR_HOOK(SV_StartFrame, arena_SV_StartFrame, CBC_ORDER_ANY);
+ MUTATOR_HOOK(FilterItem, arena_FilterItem, CBC_ORDER_ANY);
MUTATOR_ONADD
{
{
if(IS_PLAYER(frag_target))
if(frag_target.deadflag == DEAD_NO)
- if(frag_target == frag_attacker || !IsDifferentTeam(frag_target, frag_attacker))
+ if(frag_target == frag_attacker || !IsDifferentTeam(frag_target, frag_attacker) || frag_deathtype == DEATH_FALL)
frag_damage = 0;
frag_mirrordamage = 0;
return FALSE;
}
+MUTATOR_HOOKFUNCTION(ca_FilterItem)
+{
+ if(autocvar_g_powerups <= 0)
+ if(self.flags & FL_POWERUP)
+ return TRUE;
+
+ if(autocvar_g_pickup_items <= 0)
+ return TRUE;
+
+ return FALSE;
+}
+
+MUTATOR_HOOKFUNCTION(ca_PlayerDamage_SplitHealthArmor)
+{
+ float excess = max(0, frag_damage - damage_take - damage_save);
+
+ if(frag_target != frag_attacker && IS_PLAYER(frag_attacker))
+ PlayerTeamScore_Add(frag_attacker, SP_SCORE, ST_SCORE, (frag_damage - excess) * autocvar_g_ca_damage2score_multiplier);
+
+ return FALSE;
+}
+
// scoreboard setup
void ca_ScoreRules()
{
MUTATOR_HOOK(GiveFragsForKill, ca_GiveFragsForKill, CBC_ORDER_FIRST);
MUTATOR_HOOK(SetStartItems, ca_SetStartItems, CBC_ORDER_ANY);
MUTATOR_HOOK(PlayerDamage_Calculate, ca_PlayerDamage, CBC_ORDER_ANY);
+ MUTATOR_HOOK(FilterItem, ca_FilterItem, CBC_ORDER_ANY);
+ MUTATOR_HOOK(PlayerDamage_SplitHealthArmor, ca_PlayerDamage_SplitHealthArmor, CBC_ORDER_ANY);
MUTATOR_ONADD
{
{
// check for falling damage
float velocity_len = vlen(self.velocity);
- if(!self.hook.state && !g_ca && !(g_cts && !autocvar_g_cts_selfdamage))
+ if(!self.hook.state && !(g_cts && !autocvar_g_cts_selfdamage))
{
dm = vlen(self.oldvelocity) - velocity_len; // dm is now the velocity DECREASE. Velocity INCREASE should never cause a sound or any damage.
if (self.deadflag)
return TRUE;
if(autocvar_g_powerups == 0)
return FALSE;
- if(g_ca)
- return FALSE;
- if(g_arena)
- return FALSE;
}
else
{
return TRUE;
if(autocvar_g_pickup_items == 0)
return FALSE;
- if(g_ca)
- return FALSE;
if(g_weaponarena)
if(!WEPSET_EMPTY_E(self) || (self.items & IT_AMMO))
return FALSE;