]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Player templates: Refactored item pickup.
authorLyberta <lyberta@lyberta.net>
Thu, 5 Oct 2017 17:04:36 +0000 (20:04 +0300)
committerLyberta <lyberta@lyberta.net>
Thu, 5 Oct 2017 17:04:36 +0000 (20:04 +0300)
player-template-example.cfg
qcsrc/server/playertemplates.qc

index 1a0f5fdcb7344699c9a7cf50a6fccac74b38d58b..e9fe45cfd6e2c52191c89e694d22bb7c566f8d06 100644 (file)
@@ -71,19 +71,6 @@ set g_player_template_example_pickup_weapon_hlac "default" "What items does play
 set g_player_template_example_pickup_weapon_rifle "default" "What items does player get when they pickup a rifle."
 set g_player_template_example_pickup_weapon_seeker "default" "What items does player get when they pickup a TAG seeker."
 set g_player_template_example_pickup_weapon_vaporizer "default" "What items does player get when they pickup a vaporizer."
-// These weapons were dropped by other players.
-set g_player_template_example_pickup_weapon_dropped_shotgun "default" "What items does player get when they pickup a dropped shotgun."
-set g_player_template_example_pickup_weapon_dropped_machinegun "default" "What items does player get when they pickup a dropped machinegun."
-set g_player_template_example_pickup_weapon_dropped_mortar "default" "What items does player get when they pickup a dropped mortar."
-set g_player_template_example_pickup_weapon_dropped_electro "default" "What items does player get when they pickup a dropped electro."
-set g_player_template_example_pickup_weapon_dropped_crylink "default" "What items does player get when they pickup a dropped crylink."
-set g_player_template_example_pickup_weapon_dropped_vortex "default" "What items does player get when they pickup a dropped vortex."
-set g_player_template_example_pickup_weapon_dropped_hagar "default" "What items does player get when they pickup a dropped hagar."
-set g_player_template_example_pickup_weapon_dropped_devastator "default" "What items does player get when they pickup a dropped devastator."
-set g_player_template_example_pickup_weapon_dropped_minelayer "default" "What items does player get when they pickup a dropped mine layer."
-set g_player_template_example_pickup_weapon_dropped_hlac "default" "What items does player get when they pickup a dropped HLAC."
-set g_player_template_example_pickup_weapon_dropped_rifle "default" "What items does player get when they pickup a dropped rifle."
-set g_player_template_example_pickup_weapon_dropped_seeker "default" "What items does player get when they pickup a dropped TAG seeker."
 set g_player_template_example_pickup_item_strength "default" "What items does player get when they pickup strength."
 set g_player_template_example_pickup_item_shield "default" "What items does player get when they pickup shield."
 set g_player_template_example_pickup_item_fuel_regen "default" "What items does player get when they pickup fuel regeneration."
index 75083f6929d816ddd6c12342e816396fb8572969..f053db4a683d29db532bd63c4d977b4ef7bc391b 100644 (file)
@@ -590,68 +590,110 @@ float PlayerTemplateHook_ItemTouch(entity player, entity item, string template)
                {
                        switch (item.weapon)
                        {
+                               case WEP_BLASTER.m_id:
+                               {
+                                       return PlayerTemplate_GivePlayerItem(player, template,
+                                               "pickup_weapon_shotgun");
+                               }
                                case WEP_SHOTGUN.m_id:
                                {
                                        return PlayerTemplate_GivePlayerItem(player, template,
-                                               "pickup_weapon_dropped_shotgun");
+                                               "pickup_weapon_shotgun");
                                }
                                case WEP_MACHINEGUN.m_id:
                                {
                                        return PlayerTemplate_GivePlayerItem(player, template,
-                                               "pickup_weapon_dropped_machinegun");
+                                               "pickup_weapon_machinegun");
                                }
                                case WEP_MORTAR.m_id:
                                {
                                        return PlayerTemplate_GivePlayerItem(player, template,
-                                               "pickup_weapon_dropped_mortar");
+                                               "pickup_weapon_mortar");
                                }
                                case WEP_ELECTRO.m_id:
                                {
                                        return PlayerTemplate_GivePlayerItem(player, template,
-                                               "pickup_weapon_dropped_electro");
+                                               "pickup_weapon_electro");
                                }
                                case WEP_CRYLINK.m_id:
                                {
                                        return PlayerTemplate_GivePlayerItem(player, template,
-                                               "pickup_weapon_dropped_crylink");
+                                               "pickup_weapon_crylink");
                                }
                                case WEP_VORTEX.m_id:
                                {
                                        return PlayerTemplate_GivePlayerItem(player, template,
-                                               "pickup_weapon_dropped_vortex");
+                                               "pickup_weapon_vortex");
                                }
                                case WEP_HAGAR.m_id:
                                {
                                        return PlayerTemplate_GivePlayerItem(player, template,
-                                               "pickup_weapon_dropped_hagar");
+                                               "pickup_weapon_hagar");
                                }
                                case WEP_DEVASTATOR.m_id:
                                {
                                        return PlayerTemplate_GivePlayerItem(player, template,
-                                               "pickup_weapon_dropped_devastator");
+                                               "pickup_weapon_devastator");
+                               }
+                               case WEP_SHOCKWAVE.m_id:
+                               {
+                                       return PlayerTemplate_GivePlayerItem(player, template,
+                                               "pickup_weapon_shockwave");
+                               }
+                               case WEP_ARC.m_id:
+                               {
+                                       return PlayerTemplate_GivePlayerItem(player, template,
+                                               "pickup_weapon_arc");
+                               }
+                               case WEP_HOOK.m_id:
+                               {
+                                       return PlayerTemplate_GivePlayerItem(player, template,
+                                               "pickup_weapon_hook");
+                               }
+                               case WEP_TUBA.m_id:
+                               {
+                                       return PlayerTemplate_GivePlayerItem(player, template,
+                                               "pickup_weapon_tuba");
+                               }
+                               case WEP_PORTO.m_id:
+                               {
+                                       return PlayerTemplate_GivePlayerItem(player, template,
+                                               "pickup_weapon_porto");
+                               }
+                               case WEP_FIREBALL.m_id:
+                               {
+                                       return PlayerTemplate_GivePlayerItem(player, template,
+                                               "pickup_weapon_fireball");
                                }
                                case WEP_MINE_LAYER.m_id:
                                {
                                        return PlayerTemplate_GivePlayerItem(player, template,
-                                               "pickup_weapon_dropped_minelayer");
+                                               "pickup_weapon_minelayer");
                                }
                                case WEP_HLAC.m_id:
                                {
                                        return PlayerTemplate_GivePlayerItem(player, template,
-                                               "pickup_weapon_dropped_hlac");
+                                               "pickup_weapon_hlac");
                                }
                                case WEP_RIFLE.m_id:
                                {
                                        return PlayerTemplate_GivePlayerItem(player, template,
-                                               "pickup_weapon_dropped_rifle");
+                                               "pickup_weapon_rifle");
                                }
                                case WEP_SEEKER.m_id:
                                {
                                        return PlayerTemplate_GivePlayerItem(player, template,
-                                               "pickup_weapon_dropped_seeker");
+                                               "pickup_weapon_seeker");
+                               }
+                               case WEP_VAPORIZER.m_id:
+                               {
+                                       return PlayerTemplate_GivePlayerItem(player, template,
+                                               "pickup_weapon_vaporizer");
                                }
                                default:
                                {
+                                       PrintToChatAll(strcat("Unrecognized item, classname: ",
+                                               item.classname, " netname: ", item.netname));
                                        return MUT_ITEMTOUCH_CONTINUE;
                                }
                        }
@@ -682,6 +724,8 @@ float PlayerTemplateHook_ItemTouch(entity player, entity item, string template)
                                }
                                default:
                                {
+                                       PrintToChatAll(strcat("Unrecognized item, classname: ",
+                                               item.classname, " netname: ", item.netname));
                                        return MUT_ITEMTOUCH_CONTINUE;
                                }
                        }
@@ -730,13 +774,6 @@ float PlayerTemplateHook_ItemTouch(entity player, entity item, string template)
                {
                        switch (item.netname)
                        {
-                               //case "Vaporizer Ammo":
-                               //case "Extra life":
-                               //case "Invisibility":
-                               //case "Speed":
-                               //{
-                               //      return MUT_ITEMTOUCH_CONTINUE;
-                               //}
                                default:
                                {
                                        PrintToChatAll(strcat("Unrecognized item, classname: ",