/// \brief How many cells do defenders get when they frag cannon fodder.
int autocvar_g_surv_defender_cannon_fodder_frag_cells;
-/// \brief Whether defenders drop weapons after death.
-int autocvar_g_surv_defender_drop_weapons;
-
/// \brief A stat that is used to track the time left in the round.
.float surv_round_time_stat = _STAT(SURV_ROUND_TIME);
/// \brief A stat that is used to track defender team.
M_ARGV(0, string) = player.surv_playermodel;
}
+/// \brief Hook which is called when the player tries to throw their weapon.
+MUTATOR_HOOKFUNCTION(surv, ForbidThrowCurrentWeapon)
+{
+ entity player = M_ARGV(0, entity);
+ return PlayerTemplate_ForbidThrowCurrentWeapon(player,
+ Surv_GetPlayerTemplate(player));
+}
+
/// \brief Hook that is called every frame to determine how player health should
/// regenerate.
MUTATOR_HOOKFUNCTION(surv, PlayerRegen)
return MUT_ITEMTOUCH_CONTINUE;
}
-/// \brief Hook which is called when the player tries to throw their weapon.
-MUTATOR_HOOKFUNCTION(surv, ForbidThrowCurrentWeapon)
-{
- entity player = M_ARGV(0, entity);
- if (player.team == surv_defenderteam)
- {
- return true;
- }
-}
-
/// \brief Hook which is called when the damage amount must be determined.
MUTATOR_HOOKFUNCTION(surv, Damage_Calculate)
{
}
/// \brief Hook which is called when the player dies.
-MUTATOR_HOOKFUNCTION(surv, PlayerDies)
+MUTATOR_HOOKFUNCTION(surv, PlayerDies, CBC_ORDER_FIRST)
{
//DebugPrintToChatAll("PlayerDies");
entity attacker = M_ARGV(1, entity);
entity victim = M_ARGV(2, entity);
+ PlayerTemplate_PlayerDies(victim, Surv_GetPlayerTemplate(victim));
if ((attacker.team == surv_defenderteam) &&
(victim.team == surv_attackerteam))
{
}
}
}
- if ((victim.team == surv_defenderteam) &&
- (autocvar_g_surv_defender_drop_weapons == false))
- {
- for (int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
- {
- .entity went = weaponentities[slot];
- victim.(went).m_weapon = WEP_Null;
- }
- }
if (!Surv_CanPlayerSpawn(victim))
{
victim.respawn_flags = RESPAWN_SILENT;
set g_player_template_surv_cannon_fodder_random_start_weapons_count 2 "Number of weapons that can be randomly given to cannon fodder during spawn"
set g_player_template_surv_cannon_fodder_random_start_weapons "machinegun mortar electro crylink vortex hagar devastator" "Weapons that can be randomly given to cannon fodder during spawn"
+set g_player_template_surv_defender_drop_weapons 0 "Whether defenders can drop weapons by throwing them or by dying"
+
set g_player_template_surv_attacker_pickup_item_shells "add 25 25" "What items do attackers get when they pickup shells"
set g_player_template_surv_attacker_pickup_item_bullets "add 25 25" "What items do attackers get when they pickup bullets"
set g_player_template_surv_attacker_pickup_item_rockets "add 25 25" "What items do attackers get when they pickup rockets"
set g_surv_defender_cannon_fodder_frag_bullets 0 "How many bullets do defenders get when they frag cannon fodder"
set g_surv_defender_cannon_fodder_frag_rockets 0 "How many rockets do defenders get when they frag cannon fodder"
set g_surv_defender_cannon_fodder_frag_cells 0 "How many cells do defenders get when they frag cannon fodder"
-
-set g_surv_defender_drop_weapons 0 "Whether defenders drop weapons after death"