From 83b949fe0878b2cda7d03d7466a4607130e77741 Mon Sep 17 00:00:00 2001 From: Steelpoint <6595389+Steelpoint@users.noreply.github.com> Date: Thu, 7 Sep 2023 00:54:34 +0800 Subject: [PATCH] Fix UPP Hostile ERT Not Spawning With Gun (#4313) # About the pull request Fixes a situation where a UPP Soldier in the ERT would not spawn with a gun, had a 33% chance to occur. # Explain why it's good for the game Bug # Testing Photographs and Procedure
Screenshots & Videos Put screenshots and videos here with an empty line between the screenshots and the `
` tags.
# Changelog :cl: fix: ERT UPP Soldiers will now correctly spawn with firearms. /:cl: --------- Co-authored-by: Steelpoint --- code/modules/gear_presets/_select_equipment.dm | 16 ++++++++++++++++ code/modules/gear_presets/upp.dm | 16 +--------------- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/code/modules/gear_presets/_select_equipment.dm b/code/modules/gear_presets/_select_equipment.dm index 9d02cce8c5e9..4c3a4476d733 100644 --- a/code/modules/gear_presets/_select_equipment.dm +++ b/code/modules/gear_presets/_select_equipment.dm @@ -951,6 +951,22 @@ var/list/rebel_rifles = list( list("Webbing", 10, /obj/item/clothing/accessory/storage/webbing, null, VENDOR_ITEM_REGULAR) ) +/datum/equipment_preset/proc/load_upp_shotgun(mob/living/carbon/human/new_human) + var/random_shotgun = rand(1,3) + switch(random_shotgun) + if(1) + new_human.equip_to_slot_or_del(new /obj/item/weapon/gun/shotgun/type23/breacher, WEAR_J_STORE) + new_human.equip_to_slot_or_del(new /obj/item/storage/pouch/shotgun/heavybuck, WEAR_L_STORE) + new_human.equip_to_slot_or_del(new /obj/item/storage/pouch/shotgun/heavybuck, WEAR_R_STORE) + if(2) + new_human.equip_to_slot_or_del(new /obj/item/weapon/gun/shotgun/type23/breacher/slug, WEAR_J_STORE) + new_human.equip_to_slot_or_del(new /obj/item/storage/pouch/shotgun/heavyslug, WEAR_L_STORE) + new_human.equip_to_slot_or_del(new /obj/item/storage/pouch/shotgun/heavyslug, WEAR_R_STORE) + if(3) + new_human.equip_to_slot_or_del(new /obj/item/weapon/gun/shotgun/type23/breacher/flechette, WEAR_J_STORE) + new_human.equip_to_slot_or_del(new /obj/item/storage/pouch/shotgun/heavyflechette, WEAR_L_STORE) + new_human.equip_to_slot_or_del(new /obj/item/storage/pouch/shotgun/heavyflechette, WEAR_R_STORE) + /datum/equipment_preset/proc/add_upp_weapon(mob/living/carbon/human/new_human) var/random_gun = rand(1,5) switch(random_gun) diff --git a/code/modules/gear_presets/upp.dm b/code/modules/gear_presets/upp.dm index 58ee8b0156fa..39a6c98aea0f 100644 --- a/code/modules/gear_presets/upp.dm +++ b/code/modules/gear_presets/upp.dm @@ -127,22 +127,8 @@ new_human.equip_to_slot_or_del(new /obj/item/storage/box/m94, WEAR_IN_BACK) //4.25 //waist new_human.equip_to_slot_or_del(new /obj/item/storage/belt/gun/type47/np92, WEAR_WAIST) + load_upp_shotgun(new_human) -/datum/equipment_preset/upp/soldier/proc/pick_ammotype(mob/living/carbon/human/new_human) - var/percentage = rand(1, 100) - switch(percentage) - if(1 to 33) - new_human.equip_to_slot_or_del(new /obj/item/weapon/gun/shotgun/type23/breacher, WEAR_J_STORE) - new_human.equip_to_slot_or_del(new /obj/item/storage/pouch/shotgun/heavybuck, WEAR_L_STORE) - new_human.equip_to_slot_or_del(new /obj/item/storage/pouch/shotgun/heavybuck, WEAR_R_STORE) - if(34 to 66) - new_human.equip_to_slot_or_del(new /obj/item/weapon/gun/shotgun/type23/breacher/slug, WEAR_J_STORE) - new_human.equip_to_slot_or_del(new /obj/item/storage/pouch/shotgun/heavyslug, WEAR_L_STORE) - new_human.equip_to_slot_or_del(new /obj/item/storage/pouch/shotgun/heavyslug, WEAR_R_STORE) - else - new_human.equip_to_slot_or_del(new /obj/item/weapon/gun/shotgun/type23/breacher/flechette, WEAR_J_STORE) - new_human.equip_to_slot_or_del(new /obj/item/storage/pouch/shotgun/heavyflechette, WEAR_L_STORE) - new_human.equip_to_slot_or_del(new /obj/item/storage/pouch/shotgun/heavyflechette, WEAR_R_STORE) /datum/equipment_preset/upp/soldier/proc/load_upp_double(mob/living/carbon/human/new_human, obj/item/clothing/under/marine/veteran/UPP/UPP) //back