From 98eab5a89c502e9f10548fcdb44e97ebc48695a5 Mon Sep 17 00:00:00 2001 From: silencer-pl <103842328+silencer-pl@users.noreply.github.com> Date: Thu, 5 Sep 2024 21:31:57 -0400 Subject: [PATCH] resupply and stim-jector shenanigans also known as bug fixing --- code/_globalvars/misc.dm | 4 + .../configuration/entries/game_options.dm | 2 +- .../vending/vendor_types/pve/pve_guns.dm | 123 +++++++++++++++++- code/game/objects/items/misc.dm | 13 +- code/game/objects/objs.dm | 28 ++++ code/modules/cm_tech/droppod/droppod.dm | 6 +- code/modules/cm_tech/droppod/equipment.dm | 1 - code/modules/gear_presets/xenosurge.dm | 11 +- code/modules/mob/living/carbon/human/human.dm | 26 +++- .../reagents/chemistry_reagents/medical.dm | 3 +- 10 files changed, 196 insertions(+), 21 deletions(-) diff --git a/code/_globalvars/misc.dm b/code/_globalvars/misc.dm index 9490bc797d..740cd430e3 100644 --- a/code/_globalvars/misc.dm +++ b/code/_globalvars/misc.dm @@ -68,3 +68,7 @@ GLOBAL_VAR_INIT(xenosurge_wave_xenos_current, 0) GLOBAL_LIST_EMPTY(xenosurge_configured_spawners) GLOBAL_VAR_INIT(spawner_number, 1) + +GLOBAL_VAR_INIT(ammo_restock_next, 0) +GLOBAL_VAR_INIT(ammo_restock_full, 0) +GLOBAL_VAR_INIT(ammo_restock_delay, 6000) diff --git a/code/controllers/configuration/entries/game_options.dm b/code/controllers/configuration/entries/game_options.dm index ad1924565c..b3c406383e 100644 --- a/code/controllers/configuration/entries/game_options.dm +++ b/code/controllers/configuration/entries/game_options.dm @@ -51,7 +51,7 @@ config_entry_value = TRUE /datum/config_entry/number/revive_grace_period - config_entry_value = 3000 + config_entry_value = 50000 min_val = 0 /datum/config_entry/flag/bones_can_break diff --git a/code/game/machinery/vending/vendor_types/pve/pve_guns.dm b/code/game/machinery/vending/vendor_types/pve/pve_guns.dm index 80e45f3f64..1f2f126a0d 100644 --- a/code/game/machinery/vending/vendor_types/pve/pve_guns.dm +++ b/code/game/machinery/vending/vendor_types/pve/pve_guns.dm @@ -5,7 +5,7 @@ req_access = list() req_one_access = list() hackable = TRUE - vend_flags = VEND_CLUTTER_PROTECTION | VEND_TO_HAND + vend_flags = VEND_CLUTTER_PROTECTION | VEND_TO_HAND | VEND_LIMITED_INVENTORY /obj/structure/machinery/cm_vending/sorted/cargo_guns/pve/guns/ui_state(mob/user) return GLOB.not_incapacitated_and_adjacent_strict_state @@ -34,7 +34,7 @@ req_access = list() req_one_access = list() hackable = TRUE - vend_flags = VEND_CLUTTER_PROTECTION | VEND_TO_HAND + vend_flags = VEND_CLUTTER_PROTECTION | VEND_TO_HAND | VEND_LIMITED_INVENTORY /obj/structure/machinery/cm_vending/sorted/cargo_guns/pve/attachies/ui_state(mob/user) return GLOB.not_incapacitated_and_adjacent_strict_state @@ -88,7 +88,7 @@ req_access = list() req_one_access = list() hackable = TRUE - vend_flags = VEND_CLUTTER_PROTECTION | VEND_TO_HAND + vend_flags = VEND_CLUTTER_PROTECTION | VEND_TO_HAND | VEND_LIMITED_INVENTORY /obj/structure/machinery/cm_vending/sorted/cargo_guns/pve/extra_munitions/ui_state(mob/user) return GLOB.not_incapacitated_and_adjacent_strict_state @@ -124,7 +124,7 @@ req_access = list() req_one_access = list() hackable = TRUE - vend_flags = VEND_CLUTTER_PROTECTION | VEND_TO_HAND + vend_flags = VEND_CLUTTER_PROTECTION | VEND_TO_HAND | VEND_LIMITED_INVENTORY /obj/structure/machinery/cm_vending/sorted/cargo_guns/pve/ammo/ui_state(mob/user) return GLOB.not_incapacitated_and_adjacent_strict_state @@ -161,7 +161,7 @@ req_access = list() req_one_access = list() hackable = TRUE - vend_flags = VEND_CLUTTER_PROTECTION | VEND_TO_HAND + vend_flags = VEND_CLUTTER_PROTECTION | VEND_TO_HAND | VEND_LIMITED_INVENTORY /obj/structure/machinery/cm_vending/sorted/cargo_guns/pve/accesories/ui_state(mob/user) return GLOB.not_incapacitated_and_adjacent_strict_state @@ -239,10 +239,123 @@ list("Fire Extinguisher (Portable)", 20, /obj/item/tool/extinguisher/mini, VENDOR_ITEM_REGULAR), ) +/obj/structure/machinery/cm_vending/sorted/cargo_guns/pve/ammo_refill/ + name = "\improper UAR Automated Resuply Locker" + desc = "A supply rack fed directly from the Dropships own stores." + icon_state = "req_ammo" + req_access = list() + req_one_access = list() + hackable = TRUE + vend_flags = VEND_CLUTTER_PROTECTION | VEND_TO_HAND | VEND_LIMITED_INVENTORY + var/list/refilled_stims = list() + needs_power = FALSE + +/obj/structure/machinery/cm_vending/sorted/cargo_guns/pve/ammo_refill/ui_state(mob/user) + return GLOB.not_incapacitated_and_adjacent_strict_state + +/obj/structure/machinery/cm_vending/sorted/cargo_guns/pve/ammo_refill/populate_product_list(scale) + listed_products = list( + list("PRIMARY AMMUNITION", -1, null, null), + list("Box Of Buckshot Shells", 200, /obj/item/ammo_magazine/shotgun/buckshot, VENDOR_ITEM_REGULAR), + list("Box Of Flechette Shells", 200, /obj/item/ammo_magazine/shotgun/flechette, VENDOR_ITEM_REGULAR), + list("Box Of Shotgun Slugs", 200, /obj/item/ammo_magazine/shotgun/slugs, VENDOR_ITEM_REGULAR), + list("M4RA Magazine (10x24mm)", 200, /obj/item/ammo_magazine/rifle/m4ra, VENDOR_ITEM_REGULAR), + list("M4RA AP Magazine (10x24mm)", 200, /obj/item/ammo_magazine/rifle/m4ra/ap, VENDOR_ITEM_RECOMMENDED), + list("M41A MK2 Magazine (10x24mm)", 200, /obj/item/ammo_magazine/rifle, VENDOR_ITEM_REGULAR), + list("M41A MK2 AP Magazine (10x24mm)", 200, /obj/item/ammo_magazine/rifle/ap, VENDOR_ITEM_RECOMMENDED), + list("M41A MK2 Extended Magazine (10x24mm)", 200, /obj/item/ammo_magazine/rifle/extended, VENDOR_ITEM_REGULAR), + list("M39 HV Magazine (10x20mm)", 200, /obj/item/ammo_magazine/smg/m39, VENDOR_ITEM_REGULAR), + list("M39 AP Magazine (10x20mm)", 200, /obj/item/ammo_magazine/smg/m39/ap, VENDOR_ITEM_RECOMMENDED), + list("M39 Extended Magazine (10x20mm)", 200 + 3, /obj/item/ammo_magazine/smg/m39/extended, VENDOR_ITEM_REGULAR), + list("XM88 .458 bullets box (.458 x 300)", 200, /obj/item/ammo_magazine/lever_action/xm88, VENDOR_ITEM_REGULAR), + list("SECONDARY AMMUNITION", -1, null, null), + list("M44 Speed Loader (.44)", 200, /obj/item/ammo_magazine/revolver, VENDOR_ITEM_REGULAR), + list("M44 Heavy Speed Loader (.44)", 200, /obj/item/ammo_magazine/revolver/heavy, VENDOR_ITEM_REGULAR), + list("M44 Marksman Speed Loader (.44)", 200, /obj/item/ammo_magazine/revolver/marksman, VENDOR_ITEM_REGULAR), + list("M4A3 Magazine (9mm)", 200, /obj/item/ammo_magazine/pistol, VENDOR_ITEM_REGULAR), + list("M4A3 AP Magazine (9mm)", 200, /obj/item/ammo_magazine/pistol/ap, VENDOR_ITEM_RECOMMENDED), + list("M4A3 HP Magazine (9mm)", 200, /obj/item/ammo_magazine/pistol/hp, VENDOR_ITEM_REGULAR), + list("88 Mod 4 Magazine (9mm)", 200, /obj/item/ammo_magazine/pistol/mod88/normalpoint, VENDOR_ITEM_REGULAR), + list("EXPLOSIVES", -1, null, null), + list("M15 Fragmentation Grenade", 200, /obj/item/explosive/grenade/high_explosive/m15, VENDOR_ITEM_REGULAR), + list("M20 Claymore Anti-Personnel Mine", 200, /obj/item/explosive/mine, VENDOR_ITEM_REGULAR), + list("M40 HEDP Grenade", 200, /obj/item/explosive/grenade/high_explosive, VENDOR_ITEM_REGULAR), + list("M40 HIDP Incendiary Grenade", 200, /obj/item/explosive/grenade/incendiary, VENDOR_ITEM_REGULAR), + list("M40 HPDP White Phosphorus Smoke Grenade", 200, /obj/item/explosive/grenade/phosphorus, VENDOR_ITEM_REGULAR), + list("M40 HSDP Smoke Grenade", 200, /obj/item/explosive/grenade/smokebomb, VENDOR_ITEM_REGULAR), + list("M74 AGM-Frag Airburst Grenade", 200, /obj/item/explosive/grenade/high_explosive/airburst, VENDOR_ITEM_REGULAR), + list("M74 AGM-Icendiary Airburst Grenade", 200, /obj/item/explosive/grenade/incendiary/airburst, VENDOR_ITEM_REGULAR), + list("M74 AGM-Smoke Airburst Grenade", 200, /obj/item/explosive/grenade/smokebomb/airburst, VENDOR_ITEM_REGULAR), + list("M74 AGM-Star Shell", 200, /obj/item/explosive/grenade/high_explosive/airburst/starshell, VENDOR_ITEM_REGULAR), + list("M74 AGM-Hornet Shell", 200, /obj/item/explosive/grenade/high_explosive/airburst/hornet_shell, VENDOR_ITEM_REGULAR), + list("M40 HIRR Baton Slug", 200, /obj/item/explosive/grenade/slug/baton, VENDOR_ITEM_REGULAR), + list("M40 MFHS Metal Foam Grenade", 200, /obj/item/explosive/grenade/metal_foam, VENDOR_ITEM_REGULAR), + list("Plastic Explosives", 100, /obj/item/explosive/plastic, VENDOR_ITEM_REGULAR), + list("Breaching Charge", 100, /obj/item/explosive/plastic/breaching_charge, VENDOR_ITEM_REGULAR), + ) + + +/obj/structure/machinery/cm_vending/sorted/cargo_guns/pve/ammo_refill/attackby(obj/item/W, mob/user) + if(istype(W, /obj/item/stim_injector/)) + var/obj/item/stim_injector/injector_to_refill = W + if(refilled_stims.Find(injector_to_refill) == 0) + injector_to_refill.reagents.del_reagent("SuperStim") + injector_to_refill.reagents.add_reagent("SuperStim", injector_to_refill.volume) + refilled_stims.Add(injector_to_refill) + to_chat(usr, SPAN_INFO("Injector refilled")) + return + else + to_chat(usr, SPAN_WARNING("This injector was already refilled in this resupply locker")) + return + . = ..() +/obj/structure/droppod/equipment/vendor + var/obj/structure/machinery/cm_vending/sorted/cargo_guns/pve/ammo_refill/dropped_vendor +/obj/structure/droppod/equipment/vendor/spawn_equipment(equipment, mob/M) + var/obj/structure/machinery/cm_vending/sorted/cargo_guns/pve/ammo_refill/S = ..() + dropped_vendor = S + return S +/obj/structure/droppod/equipment/vendor/proc/go_back() + sleep(2400) + talkas("Warning: One Minute of Deployment time left. Please conclude your resupply.") + sleep(600) + talkas("Resupply station withdrawing to dropship. Please stand back.") + if(dropped_vendor) qdel(dropped_vendor) + recall() +/obj/structure/droppod/equipment/vendor/move_equipment() + ..() + dropped_vendor.talkas("Munitions restock is now available.") + INVOKE_ASYNC(src, TYPE_PROC_REF(/obj/structure/droppod/equipment/vendor/, go_back)) +/obj/structure/machinery/cm_vending/sorted/cargo_guns/pve/ammo_refill/partial + name = "\improper UAR Automated Field Resupply Locker" + needs_power = FALSE + +/obj/structure/machinery/cm_vending/sorted/cargo_guns/pve/ammo_refill/partial/ui_state(mob/user) + return GLOB.not_incapacitated_and_adjacent_strict_state + +/obj/structure/machinery/cm_vending/sorted/cargo_guns/pve/ammo_refill/partial/populate_product_list(scale) + listed_products = list( + list("PRIMARY AMMUNITION", -1, null, null), + list("Box Of Buckshot Shells", 200, /obj/item/ammo_magazine/shotgun/buckshot, VENDOR_ITEM_REGULAR), + list("Box Of Shotgun Slugs", 200, /obj/item/ammo_magazine/shotgun/slugs, VENDOR_ITEM_REGULAR), + list("M4RA Magazine (10x24mm)", 200, /obj/item/ammo_magazine/rifle/m4ra, VENDOR_ITEM_REGULAR), + list("M41A MK2 Magazine (10x24mm)", 200, /obj/item/ammo_magazine/rifle, VENDOR_ITEM_REGULAR), + list("M39 HV Magazine (10x20mm)", 200, /obj/item/ammo_magazine/smg/m39, VENDOR_ITEM_REGULAR), + list("XM88 .458 bullets box (.458 x 300)", 200, /obj/item/ammo_magazine/lever_action/xm88, VENDOR_ITEM_REGULAR), + list("SECONDARY AMMUNITION", -1, null, null), + list("M44 Speed Loader (.44)", 200, /obj/item/ammo_magazine/revolver, VENDOR_ITEM_REGULAR), + list("M4A3 Magazine (9mm)", 200, /obj/item/ammo_magazine/pistol, VENDOR_ITEM_REGULAR), + list("88 Mod 4 Magazine (9mm)", 200, /obj/item/ammo_magazine/pistol/mod88/normalpoint, VENDOR_ITEM_REGULAR), + ) +/obj/structure/droppod/equipment/vendor/partial + name = "\improper UAR Automated Field Resupply Locker" +/obj/structure/droppod/equipment/vendor/partial/spawn_equipment(equipment, mob/M) + var/obj/structure/machinery/cm_vending/sorted/cargo_guns/pve/ammo_refill/partial/S = ..() + dropped_vendor = S + return S diff --git a/code/game/objects/items/misc.dm b/code/game/objects/items/misc.dm index f1d1a26b64..301dfb19ac 100644 --- a/code/game/objects/items/misc.dm +++ b/code/game/objects/items/misc.dm @@ -428,9 +428,10 @@ map.tgui_interact(user) /obj/item/stim_injector + name = "UACM GA-8 WY brand Combat Stimulant Syringe" desc = "An autoinjector with five compartments." icon = 'icons/obj/items/syringe.dmi' - item_state = "stim_5" + icon_state = "stim_5" var/owner_mob var/volume = 25 var/cooldown_time = 0 @@ -438,9 +439,13 @@ /obj/item/stim_injector/update_icon() - if(volume > 0) - var/text_to_append = num2text(floor(volume / 5)) - icon_state = "stim_[text_to_append]" + if(reagents.total_volume > 0) + var/num_to_append = floor(reagents.total_volume / 5) + var/text_to_append = num2text(num_to_append) + if(num_to_append > 1) + icon_state = "stim_[text_to_append]" + else + icon_state = "stim_empty" else icon_state = "stim_empty" . = ..() diff --git a/code/game/objects/objs.dm b/code/game/objects/objs.dm index 4304d4516e..492281a6c6 100644 --- a/code/game/objects/objs.dm +++ b/code/game/objects/objs.dm @@ -458,3 +458,31 @@ /// override for subtypes that require extra behaviour when spawned from a vendor /obj/proc/post_vendor_spawn_hook(mob/living/carbon/human/user) return + +/obj/proc/talkas(str, delay) //Talk as. Delay in BYOND ticks (about 1/10 of a second per tick) If not provided, delay calculated automatically depending in message length. + if (!str) return + var/list/heard = get_mobs_in_view(world_view_size, src) + src.langchat_speech(str, heard, GLOB.all_languages, skip_language_check = TRUE) + src.visible_message("[src] says, \"[str]\"") + var/talkdelay = delay + if (!talkdelay) + if ((length("[str]")) <= 64) + talkdelay = 40 + if ((length("[str]")) > 64) + talkdelay = 60 + sleep(talkdelay) + return + +/obj/proc/emoteas(str, delay) //Emote as. Delay in BYOND ticks (about 1/10 of a second per tick) If not provided, delay calculated automatically depending in message length. + if (!str) return + var/list/heard = get_mobs_in_view(world_view_size, src) + src.langchat_speech(str, heard, GLOB.all_languages, skip_language_check = TRUE, animation_style = LANGCHAT_FAST_POP, additional_styles = list("langchat_small", "emote")) + src.visible_message("[src] [str]") + var/talkdelay = delay + if (!talkdelay) + if ((length("[str]")) <= 64) + talkdelay = 40 + if ((length("[str]")) > 64) + talkdelay = 60 + sleep(talkdelay) + return diff --git a/code/modules/cm_tech/droppod/droppod.dm b/code/modules/cm_tech/droppod/droppod.dm index ebaa4f7ae3..176ee8dd4d 100644 --- a/code/modules/cm_tech/droppod/droppod.dm +++ b/code/modules/cm_tech/droppod/droppod.dm @@ -156,9 +156,9 @@ /obj/structure/droppod/proc/post_land() density = TRUE - for(var/mob/mob in loc) - mob.gib(create_cause_data("gibbing", initial(name))) - +// for(var/mob/mob in loc) +// mob.gib(create_cause_data("gibbing", initial(name))) +// Someone is going to fucking gib thesmleves with a resupply pod and I really dont have time for that during tests :P for(var/obj/structure/structure in loc) structure.update_health(-land_damage) diff --git a/code/modules/cm_tech/droppod/equipment.dm b/code/modules/cm_tech/droppod/equipment.dm index 3c8e8e59c5..17d137d77d 100644 --- a/code/modules/cm_tech/droppod/equipment.dm +++ b/code/modules/cm_tech/droppod/equipment.dm @@ -20,7 +20,6 @@ . = ..() move_equipment() equipment_to_spawn = null - qdel(src) /obj/structure/droppod/equipment/proc/move_equipment() if(equipment_to_spawn) diff --git a/code/modules/gear_presets/xenosurge.dm b/code/modules/gear_presets/xenosurge.dm index d3ed5d441a..ad2e4b9086 100644 --- a/code/modules/gear_presets/xenosurge.dm +++ b/code/modules/gear_presets/xenosurge.dm @@ -45,8 +45,9 @@ back_item = /obj/item/storage/backpack/marine new_human.equip_to_slot_or_del(new back_item(new_human), WEAR_BACK) - var/obj/item/stim_injector/injector = new_human.put_in_any_hand_if_possible(new /obj/item/stim_injector(new_human)) + var/obj/item/stim_injector/injector = new /obj/item/stim_injector(get_turf(new_human)) new_human.bind_stimpack(injector) + new_human.put_in_any_hand_if_possible(injector) /datum/job/marine/pve/point @@ -76,8 +77,9 @@ back_item = /obj/item/storage/backpack/marine new_human.equip_to_slot_or_del(new back_item(new_human), WEAR_BACK) - var/obj/item/stim_injector/injector = new_human.put_in_any_hand_if_possible(new /obj/item/stim_injector(new_human)) + var/obj/item/stim_injector/injector = new /obj/item/stim_injector(get_turf(new_human)) new_human.bind_stimpack(injector) + new_human.put_in_any_hand_if_possible(injector) /datum/job/marine/pve/lead title = JOB_UER_MARINE_LEAD @@ -89,7 +91,7 @@ entry_message_body = "haha" /datum/equipment_preset/pve/lead - name = "UER Marine Operator" + name = "UER Marine Lead" flags = EQUIPMENT_PRESET_START_OF_ROUND|EQUIPMENT_PRESET_MARINE access = list(ACCESS_MARINE_PREP) @@ -106,5 +108,6 @@ back_item = /obj/item/storage/backpack/marine new_human.equip_to_slot_or_del(new back_item(new_human), WEAR_BACK) - var/obj/item/stim_injector/injector = new_human.put_in_any_hand_if_possible(new /obj/item/stim_injector(new_human)) + var/obj/item/stim_injector/injector = new /obj/item/stim_injector(get_turf(new_human)) new_human.bind_stimpack(injector) + new_human.put_in_any_hand_if_possible(injector) diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 3d45a8aca8..af022c91d5 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -1715,7 +1715,7 @@ return TRUE return ..() -/mob/living/carbon/human/proc/bind_stimpack(obj/item/stim_injector/pack_to_bind) +/mob/living/carbon/human/proc/bind_stimpack(pack_to_bind) bound_injector = pack_to_bind /mob/living/carbon/human/verb/find_injector() @@ -1730,3 +1730,27 @@ else to_chat(usr, SPAN_WARNING("No bound Injector found!")) return + +/mob/living/carbon/human/verb/call_resupply() + set name = "Call resupply" + set desc = "Calls a resupply droppod. Depending on round state, it may be a partial or full resupply vendor." + set category = "IC" + + var/turf_to_spawn = get_turf(src) + if(GLOB.ammo_restock_next > world.time) + return + if(!do_after(usr, 20, INTERRUPT_ALL, BUSY_ICON_FRIENDLY, turf_to_spawn, INTERRUPT_MOVED, BUSY_ICON_MEDICAL)) + return + if(GLOB.ammo_restock_next <= world.time) + GLOB.ammo_restock_next = world.time + GLOB.ammo_restock_delay + var/obj/structure/droppod/equipment/vendor/droppod + if(GLOB.ammo_restock_full == 0) + droppod = new /obj/structure/droppod/equipment/vendor/partial(turf_to_spawn, /obj/structure/machinery/cm_vending/sorted/cargo_guns/pve/ammo_refill/partial/, src) + else + droppod = new /obj/structure/droppod/equipment/vendor/(turf_to_spawn, /obj/structure/machinery/cm_vending/sorted/cargo_guns/pve/ammo_refill/, src) + droppod.drop_time = 5 SECONDS + droppod.launch(turf_to_spawn) + return + else + to_chat(src, SPAN_WARNING("The Ammo Resupply is on cooldown!")) + return diff --git a/code/modules/reagents/chemistry_reagents/medical.dm b/code/modules/reagents/chemistry_reagents/medical.dm index d08ce03490..b94e7dbeea 100644 --- a/code/modules/reagents/chemistry_reagents/medical.dm +++ b/code/modules/reagents/chemistry_reagents/medical.dm @@ -430,9 +430,8 @@ id = "SuperStim" description = "A light green tinted watery liquid. Smells like fresh apples. Tastest awful, which is why it should be injected." reagent_state = LIQUID - volume = 1 color = "#8ae786" custom_metabolism = AMOUNT_PER_TIME(1, 10) data = 0 overdose = 200 - properties = list(PROPERTY_OMNIPOTENT = 1,PROPERTY_DEFIBRILLATING = 5,PROPERTY_CARDIOSTABILIZING = 5, PROPERTY_PAINKILLING = 5) + properties = list(PROPERTY_OMNIPOTENT = 20,PROPERTY_DEFIBRILLATING = 20,PROPERTY_CARDIOSTABILIZING = 10, PROPERTY_PAINKILLING = 5)