From: Lyberta Date: Wed, 12 Apr 2017 07:51:24 +0000 (+0300) Subject: Survival: Added frag rewards for defenders. X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=2eb61fb318045af5ea3866f281847b660fe4c1af;p=xonotic%2Fxonotic-data.pk3dir.git Survival: Added frag rewards for defenders. --- diff --git a/qcsrc/server/mutators/mutator/gamemode_survival.qc b/qcsrc/server/mutators/mutator/gamemode_survival.qc index b128f5afc..84402bbb1 100644 --- a/qcsrc/server/mutators/mutator/gamemode_survival.qc +++ b/qcsrc/server/mutators/mutator/gamemode_survival.qc @@ -157,8 +157,6 @@ int autocvar_g_surv_defender_pickup_cells_mega; /// \brief How much score attackers gain per 1 point of damage. float autocvar_g_surv_attacker_damage_score; -/// \brief How much score attackers get for killing defenders. -float autocvar_g_surv_attacker_frag_score; /// \brief How much defenders damage others. Higher values mean more damage. float autocvar_g_surv_defender_attack_scale; /// \brief How much defenders get damaged. High values mean less damage. @@ -169,6 +167,33 @@ float autocvar_g_surv_cannon_fodder_attack_scale; /// \brief How much cannon fodder gets damaged. Higher values mean less damage. float autocvar_g_surv_cannon_fodder_defense_scale; +/// \brief How much score attackers get for fragging defenders. +float autocvar_g_surv_attacker_frag_score; +/// \brief How much health do defenders get when they frag an attacker. +int autocvar_g_surv_defender_attacker_frag_health; +/// \brief How much armor do defenders get when they frag an attacker. +int autocvar_g_surv_defender_attacker_frag_armor; +/// \brief How many shells do defenders get when they frag an attacker. +int autocvar_g_surv_defender_attacker_frag_shells; +/// \brief How many bullets do defenders get when they frag an attacker. +int autocvar_g_surv_defender_attacker_frag_bullets; +/// \brief How many rockets do defenders get when they frag an attacker. +int autocvar_g_surv_defender_attacker_frag_rockets; +/// \brief How many cells do defenders get when they frag an attacker. +int autocvar_g_surv_defender_attacker_frag_cells; +/// \brief How much health do defenders get when they frag cannon fodder. +int autocvar_g_surv_defender_cannon_fodder_frag_health; +/// \brief How much armor do defenders get when they frag cannon fodder. +int autocvar_g_surv_defender_cannon_fodder_frag_armor; +/// \brief How many shells do defenders get when they frag cannon fodder. +int autocvar_g_surv_defender_cannon_fodder_frag_shells; +/// \brief How many bullets do defenders get when they frag cannon fodder. +int autocvar_g_surv_defender_cannon_fodder_frag_bullets; +/// \brief How many rockets do defenders get when they frag cannon fodder. +int autocvar_g_surv_defender_cannon_fodder_frag_rockets; +/// \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; @@ -2095,7 +2120,47 @@ MUTATOR_HOOKFUNCTION(surv, PlayerDamaged) MUTATOR_HOOKFUNCTION(surv, PlayerDies) { //DebugPrintToChatAll("PlayerDies"); + entity attacker = M_ARGV(1, entity); entity victim = M_ARGV(2, entity); + if ((attacker.team == surv_defenderteam) && + (victim.team == surv_attackerteam)) + { + switch (victim.surv_role) + { + case SURVIVAL_ROLE_PLAYER: + { + GivePlayerHealth(attacker, + autocvar_g_surv_defender_attacker_frag_health); + GivePlayerArmor(attacker, + autocvar_g_surv_defender_attacker_frag_armor); + GivePlayerShells(attacker, + autocvar_g_surv_defender_attacker_frag_shells); + GivePlayerBullets(attacker, + autocvar_g_surv_defender_attacker_frag_bullets); + GivePlayerRockets(attacker, + autocvar_g_surv_defender_attacker_frag_rockets); + GivePlayerCells(attacker, + autocvar_g_surv_defender_attacker_frag_cells); + break; + } + case SURVIVAL_ROLE_CANNON_FODDER: + { + GivePlayerHealth(attacker, + autocvar_g_surv_defender_cannon_fodder_frag_health); + GivePlayerArmor(attacker, + autocvar_g_surv_defender_cannon_fodder_frag_armor); + GivePlayerShells(attacker, + autocvar_g_surv_defender_cannon_fodder_frag_shells); + GivePlayerBullets(attacker, + autocvar_g_surv_defender_cannon_fodder_frag_bullets); + GivePlayerRockets(attacker, + autocvar_g_surv_defender_cannon_fodder_frag_rockets); + GivePlayerCells(attacker, + autocvar_g_surv_defender_cannon_fodder_frag_cells); + break; + } + } + } if ((victim.team == surv_defenderteam) && (autocvar_g_surv_defender_drop_weapons == false)) { diff --git a/survival.cfg b/survival.cfg index 3faededb7..6fd2fa41d 100644 --- a/survival.cfg +++ b/survival.cfg @@ -70,10 +70,24 @@ set g_surv_defender_pickup_cells_big 40 "How many cells do defenders get when th set g_surv_defender_pickup_cells_mega 50 "How many cells do defenders get when they pickup mega health/armor" set g_surv_attacker_damage_score 0.025 "How much score attackers gain per 1 point of damage" -set g_surv_attacker_frag_score 10 "How much score attackers get for killing defenders" set g_surv_defender_attack_scale 1 "How much defenders damage others. Higher values mean more damage" set g_surv_defender_defense_scale 2 "How much defenders get damaged. Higher values mean less damage" set g_surv_cannon_fodder_attack_scale 1 "How much cannon fodder damages others. Higher values mean more damage" set g_surv_cannon_fodder_defense_scale 1 "How much cannon fodder gets damaged. Higher values mean less damage" +set g_surv_attacker_frag_score 10 "How much score attackers get for fragging defenders" +set g_surv_defender_attacker_frag_health 0 "How much health do defenders get when they frag an attacker" +set g_surv_defender_attacker_frag_armor 0 "How much armor do defenders get when they frag an attacker" +set g_surv_defender_attacker_frag_shells 0 "How many shells do defenders get when they frag an attacker" +set g_surv_defender_attacker_frag_bullets 0 "How many bullets do defenders get when they frag an attacker" +set g_surv_defender_attacker_frag_rockets 0 "How many rockets do defenders get when they frag an attacker" +set g_surv_defender_attacker_frag_cells 0 "How many cells do defenders get when they frag an attacker" +set g_surv_defender_cannon_fodder_frag_health 0 "How much health do defenders get when they frag cannon fodder" +set g_surv_defender_cannon_fodder_frag_armor 0 "How much armor do defenders get when they frag cannon fodder" +set g_surv_defender_cannon_fodder_frag_shells 0 "How many shells do defenders get when they frag cannon fodder" +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"