Skip to content

Commit

Permalink
resupply and stim-jector shenanigans also known as bug fixing
Browse files Browse the repository at this point in the history
  • Loading branch information
silencer-pl committed Sep 6, 2024
1 parent 31229c8 commit 98eab5a
Show file tree
Hide file tree
Showing 10 changed files with 196 additions and 21 deletions.
4 changes: 4 additions & 0 deletions code/_globalvars/misc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
2 changes: 1 addition & 1 deletion code/controllers/configuration/entries/game_options.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
123 changes: 118 additions & 5 deletions code/game/machinery/vending/vendor_types/pve/pve_guns.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
13 changes: 9 additions & 4 deletions code/game/objects/items/misc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -428,19 +428,24 @@
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
var/cooldown_val = 50


/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"
. = ..()
Expand Down
28 changes: 28 additions & 0 deletions code/game/objects/objs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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("<b>[src]</b> 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("<b>[src]</b> [str]")
var/talkdelay = delay
if (!talkdelay)
if ((length("[str]")) <= 64)
talkdelay = 40
if ((length("[str]")) > 64)
talkdelay = 60
sleep(talkdelay)
return
6 changes: 3 additions & 3 deletions code/modules/cm_tech/droppod/droppod.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
1 change: 0 additions & 1 deletion code/modules/cm_tech/droppod/equipment.dm
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
. = ..()
move_equipment()
equipment_to_spawn = null
qdel(src)

/obj/structure/droppod/equipment/proc/move_equipment()
if(equipment_to_spawn)
Expand Down
11 changes: 7 additions & 4 deletions code/modules/gear_presets/xenosurge.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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)
Expand All @@ -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)
26 changes: 25 additions & 1 deletion code/modules/mob/living/carbon/human/human.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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
3 changes: 1 addition & 2 deletions code/modules/reagents/chemistry_reagents/medical.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit 98eab5a

Please sign in to comment.