From: Lyberta Date: Thu, 5 Oct 2017 17:04:36 +0000 (+0300) Subject: Player templates: Refactored item pickup. X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=6e5e13f495b06ca225ed4924e77bf4ca195a3e92;p=xonotic%2Fxonotic-data.pk3dir.git Player templates: Refactored item pickup. --- diff --git a/player-template-example.cfg b/player-template-example.cfg index 1a0f5fdcb7..e9fe45cfd6 100644 --- a/player-template-example.cfg +++ b/player-template-example.cfg @@ -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." diff --git a/qcsrc/server/playertemplates.qc b/qcsrc/server/playertemplates.qc index 75083f6929..f053db4a68 100644 --- a/qcsrc/server/playertemplates.qc +++ b/qcsrc/server/playertemplates.qc @@ -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: ",