From cdcb20b0f0dc557ddf2754daf1a342436b9f3c76 Mon Sep 17 00:00:00 2001 From: Lyberta Date: Wed, 12 Apr 2017 09:08:22 +0300 Subject: [PATCH] Survival: Defenders now can pickup health and armor. --- .../mutators/mutator/gamemode_survival.qc | 93 ++++++++++++++++++- survival.cfg | 8 ++ 2 files changed, 98 insertions(+), 3 deletions(-) diff --git a/qcsrc/server/mutators/mutator/gamemode_survival.qc b/qcsrc/server/mutators/mutator/gamemode_survival.qc index f48164a49..84e84895c 100644 --- a/qcsrc/server/mutators/mutator/gamemode_survival.qc +++ b/qcsrc/server/mutators/mutator/gamemode_survival.qc @@ -93,6 +93,22 @@ int autocvar_g_surv_defender_num_random_start_weapons; /// spawn. int autocvar_g_surv_cannon_fodder_num_random_start_weapons; +/// \brief How many health do defenders get when they pickup small health. +int autocvar_g_surv_defender_pickup_health_small; +/// \brief How many health do defenders get when they pickup medium health. +int autocvar_g_surv_defender_pickup_health_medium; +/// \brief How many health do defenders get when they pickup big health. +int autocvar_g_surv_defender_pickup_health_big; +/// \brief How many health do defenders get when they pickup mega health. +int autocvar_g_surv_defender_pickup_health_mega; +/// \brief How many armor do defenders get when they pickup small armor. +int autocvar_g_surv_defender_pickup_armor_small; +/// \brief How many armor do defenders get when they pickup medium armor. +int autocvar_g_surv_defender_pickup_armor_medium; +/// \brief How many armor do defenders get when they pickup big armor. +int autocvar_g_surv_defender_pickup_armor_big; +/// \brief How many armor do defenders get when they pickup mega armor. +int autocvar_g_surv_defender_pickup_armor_mega; /// \brief How many shells do defenders get when they pickup small health/armor. int autocvar_g_surv_defender_pickup_shells_small; /// \brief How many shells do defenders get when they pickup medium @@ -1704,8 +1720,9 @@ MUTATOR_HOOKFUNCTION(surv, ItemTouch) switch (item.classname) { case "item_health_small": - case "item_armor_small": { + GivePlayerHealth(player, + autocvar_g_surv_defender_pickup_health_small); GivePlayerShells(player, autocvar_g_surv_defender_pickup_shells_small); GivePlayerBullets(player, @@ -1720,8 +1737,9 @@ MUTATOR_HOOKFUNCTION(surv, ItemTouch) return MUT_ITEMTOUCH_RETURN; } case "item_health_medium": - case "item_armor_medium": { + GivePlayerHealth(player, + autocvar_g_surv_defender_pickup_health_medium); GivePlayerShells(player, autocvar_g_surv_defender_pickup_shells_medium); GivePlayerBullets(player, @@ -1736,8 +1754,76 @@ MUTATOR_HOOKFUNCTION(surv, ItemTouch) return MUT_ITEMTOUCH_RETURN; } case "item_health_big": + { + GivePlayerHealth(player, + autocvar_g_surv_defender_pickup_health_big); + GivePlayerShells(player, + autocvar_g_surv_defender_pickup_shells_big); + GivePlayerBullets(player, + autocvar_g_surv_defender_pickup_bullets_big); + GivePlayerRockets(player, + autocvar_g_surv_defender_pickup_rockets_big); + GivePlayerCells(player, + autocvar_g_surv_defender_pickup_cells_big); + Item_ScheduleRespawn(item); + sound(player, CH_TRIGGER, SND_HealthBig, VOL_BASE, + ATTEN_NORM); + return MUT_ITEMTOUCH_RETURN; + } + case "item_health_mega": + { + GivePlayerHealth(player, + autocvar_g_surv_defender_pickup_health_mega); + GivePlayerShells(player, + autocvar_g_surv_defender_pickup_shells_mega); + GivePlayerBullets(player, + autocvar_g_surv_defender_pickup_bullets_mega); + GivePlayerRockets(player, + autocvar_g_surv_defender_pickup_rockets_mega); + GivePlayerCells(player, + autocvar_g_surv_defender_pickup_cells_mega); + Item_ScheduleRespawn(item); + sound(player, CH_TRIGGER, SND_HealthMega, VOL_BASE, ATTEN_NORM); + return MUT_ITEMTOUCH_RETURN; + } + case "item_armor_small": + { + GivePlayerArmor(player, + autocvar_g_surv_defender_pickup_armor_small); + GivePlayerShells(player, + autocvar_g_surv_defender_pickup_shells_small); + GivePlayerBullets(player, + autocvar_g_surv_defender_pickup_bullets_small); + GivePlayerRockets(player, + autocvar_g_surv_defender_pickup_rockets_small); + GivePlayerCells(player, + autocvar_g_surv_defender_pickup_cells_small); + Item_ScheduleRespawn(item); + sound(player, CH_TRIGGER, SND_HealthSmall, VOL_BASE, + ATTEN_NORM); + return MUT_ITEMTOUCH_RETURN; + } + case "item_armor_medium": + { + GivePlayerArmor(player, + autocvar_g_surv_defender_pickup_armor_medium); + GivePlayerShells(player, + autocvar_g_surv_defender_pickup_shells_medium); + GivePlayerBullets(player, + autocvar_g_surv_defender_pickup_bullets_medium); + GivePlayerRockets(player, + autocvar_g_surv_defender_pickup_rockets_medium); + GivePlayerCells(player, + autocvar_g_surv_defender_pickup_cells_medium); + Item_ScheduleRespawn(item); + sound(player, CH_TRIGGER, SND_HealthMedium, VOL_BASE, + ATTEN_NORM); + return MUT_ITEMTOUCH_RETURN; + } case "item_armor_big": { + GivePlayerArmor(player, + autocvar_g_surv_defender_pickup_armor_big); GivePlayerShells(player, autocvar_g_surv_defender_pickup_shells_big); GivePlayerBullets(player, @@ -1750,9 +1836,10 @@ MUTATOR_HOOKFUNCTION(surv, ItemTouch) sound(player, CH_TRIGGER, SND_HealthBig, VOL_BASE, ATTEN_NORM); return MUT_ITEMTOUCH_RETURN; } - case "item_health_mega": case "item_armor_mega": { + GivePlayerArmor(player, + autocvar_g_surv_defender_pickup_armor_mega); GivePlayerShells(player, autocvar_g_surv_defender_pickup_shells_mega); GivePlayerBullets(player, diff --git a/survival.cfg b/survival.cfg index f77c26db2..6557a6b9a 100644 --- a/survival.cfg +++ b/survival.cfg @@ -40,6 +40,14 @@ set g_surv_defender_random_start_weapons "" "Weapons that can be randomly given set g_surv_cannon_fodder_num_random_start_weapons 2 "Number of weapons that can be randomly given to cannon fodder during spawn" set g_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_surv_defender_pickup_health_small 0 "How many health do defenders get when they pickup small health" +set g_surv_defender_pickup_health_medium 0 "How many health do defenders get when they pickup medium health" +set g_surv_defender_pickup_health_big 0 "How many health do defenders get when they pickup big health" +set g_surv_defender_pickup_health_mega 0 "How many health do defenders get when they pickup mega health" +set g_surv_defender_pickup_armor_small 0 "How many armor do defenders get when they pickup small armor" +set g_surv_defender_pickup_armor_medium 0 "How many armor do defenders get when they pickup medium armor" +set g_surv_defender_pickup_armor_big 0 "How many armor do defenders get when they pickup big armor" +set g_surv_defender_pickup_armor_mega 0 "How many armor do defenders get when they pickup mega armor" set g_surv_defender_pickup_shells_small 6 "How many shells do defenders get when they pickup small health/armor" set g_surv_defender_pickup_shells_medium 15 "How many shells do defenders get when they pickup medium health/armor" set g_surv_defender_pickup_shells_big 30 "How many shells do defenders get when they pickup big health/armor" -- 2.39.5