]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Survival: Defenders now can pickup health and armor.
authorLyberta <lyberta@lyberta.net>
Wed, 12 Apr 2017 06:08:22 +0000 (09:08 +0300)
committerLyberta <lyberta@lyberta.net>
Wed, 12 Apr 2017 06:08:22 +0000 (09:08 +0300)
qcsrc/server/mutators/mutator/gamemode_survival.qc
survival.cfg

index f48164a49c669d1af284156df3147b9cbd8142f1..84e84895caa5d218018b5afb08fd052b2063f8ff 100644 (file)
@@ -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,
index f77c26db21dd15f322c04dc1bf99040381d6fdb2..6557a6b9a6eeb89317dfabee51b97cc4e55e510a 100644 (file)
@@ -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"