Skip to content

Commit

Permalink
stan blessed
Browse files Browse the repository at this point in the history
  • Loading branch information
ItsVyzo committed Feb 7, 2024
1 parent 5b0150a commit af8a25e
Show file tree
Hide file tree
Showing 7 changed files with 116 additions and 5 deletions.
2 changes: 2 additions & 0 deletions code/__DEFINES/dcs/signals/atom/signals_obj.dm
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
/// from /obj/structure/transmitter/update_icon()
#define COMSIG_TRANSMITTER_UPDATE_ICON "transmitter_update_icon"

#define COMSIG_STRUCTURE_WRENCHED "structure_wrenched"
#define COMSIG_STRUCTURE_UNWRENCHED "structure_unwrenched"
#define COMSIG_TENT_COLLAPSING "tent_collapsing"

/// from /obj/proc/afterbuckle()
Expand Down
10 changes: 9 additions & 1 deletion code/game/machinery/vending/cm_vending.dm
Original file line number Diff line number Diff line change
Expand Up @@ -985,12 +985,16 @@ GLOBAL_LIST_EMPTY(vending_products)
to_chat(user, SPAN_WARNING("\The [item_to_stock] needs to be fully charged to restock it!"))
return

if(istype(item_to_stock, /obj/item/cell))
else if(istype(item_to_stock, /obj/item/cell))
var/obj/item/cell/C = item_to_stock
if(C.charge < C.maxcharge)
to_chat(user, SPAN_WARNING("\The [item_to_stock] needs to be fully charged to restock it!"))
return

else if(!additional_restock_checks(item_to_stock, user))
// the error message needs to go in the proc
return FALSE

if(item_to_stock.loc == user) //Inside the mob's inventory
if(item_to_stock.flags_item & WIELDED)
item_to_stock.unwield(user)
Expand All @@ -1008,6 +1012,10 @@ GLOBAL_LIST_EMPTY(vending_products)
updateUsrDialog()
return //We found our item, no reason to go on.

/// additional restocking checks for individual vendor subtypes. Parse in item, do checks, return FALSE to fail. Include error message.
/obj/structure/machinery/cm_vending/sorted/proc/additional_restock_checks(obj/item/item_to_stock, mob/user)
return TRUE

//sending an /empty ammo box type path here will return corresponding regular (full) type of this box
//if there is one set in corresponding_box_types or will return FALSE otherwise
/obj/structure/machinery/cm_vending/sorted/proc/return_corresponding_type(unusual_path)
Expand Down
87 changes: 87 additions & 0 deletions code/game/machinery/vending/vendor_types/medical.dm
Original file line number Diff line number Diff line change
@@ -1,3 +1,47 @@
//------------SUPPLY LINK FOR MEDICAL VENDORS---------------

/obj/structure/medical_supply_link
name = "medical supplies link port"
desc = "A complex network of pipes and machinery, linking to large storage systems below the deck. Medical vendors linked to this port will be able to infinitely restock supplies."
icon = 'icons/effects/warning_stripes.dmi'
icon_state = "medlink_unclamped"
anchored = TRUE
density = FALSE
unslashable = TRUE
unacidable = TRUE
plane = FLOOR_PLANE
layer = 2.1 //It's the floor, man

/obj/structure/medical_supply_link/ex_act(severity, direction)
return FALSE

/obj/structure/medical_supply_link/Initialize()
. = ..()
RegisterSignal(src, COMSIG_STRUCTURE_WRENCHED, PROC_REF(do_clamp_animation))
RegisterSignal(src, COMSIG_STRUCTURE_UNWRENCHED, PROC_REF(do_unclamp_animation))
update_icon()

/obj/structure/medical_supply_link/deconstruct(disassembled)
UnregisterSignal(src, COMSIG_STRUCTURE_WRENCHED)
UnregisterSignal(src, COMSIG_STRUCTURE_UNWRENCHED)
return ..()

/obj/structure/medical_supply_link/proc/do_clamp_animation()
flick("medlink_clamping", src)
addtimer(CALLBACK(src, PROC_REF(update_icon), 2.6 SECONDS))
update_icon()

/obj/structure/medical_supply_link/proc/do_unclamp_animation()
flick("medlink_unclamping", src)
addtimer(CALLBACK(src, PROC_REF(update_icon), 2.6 SECONDS))
update_icon()

/obj/structure/medical_supply_link/update_icon()
if(locate(/obj/structure/machinery/cm_vending/sorted/medical) in loc)
icon_state = "medlink_clamped"
else
icon_state = "medlink_unclamped"

//------------SORTED MEDICAL VENDORS---------------

/obj/structure/machinery/cm_vending/sorted/medical
Expand All @@ -14,6 +58,8 @@
vendor_theme = VENDOR_THEME_COMPANY
vend_delay = 0.5 SECONDS

var/requires_supply_link_port = TRUE

var/datum/health_scan/last_health_display

var/healthscan = TRUE
Expand Down Expand Up @@ -60,6 +106,33 @@
if(healthscan)
. += SPAN_NOTICE("The [src.name] offers assisted medical scan, for ease of usage with minimal training. Present the target in front of the scanner to scan.")

/obj/structure/machinery/cm_vending/sorted/medical/proc/get_supply_link()
var/linkpoint = locate(/obj/structure/medical_supply_link) in loc
if(!linkpoint)
return FALSE
return TRUE

/obj/structure/machinery/cm_vending/sorted/medical/additional_restock_checks(obj/item/item_to_stock, mob/user)
if(istype(item_to_stock, /obj/item/reagent_container/hypospray/autoinjector) || istype(item_to_stock, /obj/item/reagent_container/glass/bottle))
if(requires_supply_link_port && !get_supply_link())
var/obj/item/reagent_container/container = item_to_stock
if(container.reagents.total_volume < container.reagents.maximum_volume)
if(user)
to_chat(user, SPAN_WARNING("\The [src] makes a buzzing noise as it rejects \the [container.name]. Looks like this vendor cannot refill these outside of a medical bay's supply link."))
playsound(src, 'sound/machines/buzz-sigh.ogg', 15, TRUE)
return FALSE

//stacked items handling if the vendor cannot restock partial stacks
else if(istype(item_to_stock, /obj/item/stack))
if(requires_supply_link_port && !get_supply_link())
var/obj/item/stack/restock_stack = item_to_stock
if(restock_stack.amount < restock_stack.max_amount) // if the stack is not full
if(user)
to_chat(user, SPAN_WARNING("\The [src] makes a buzzing noise as it rejects \the [restock_stack]. Looks like this vendor cannot restock non-full stacks outside of a medical bay's supply link."))
playsound(src, 'sound/machines/buzz-sigh.ogg', 15, TRUE)
return FALSE
return TRUE

/obj/structure/machinery/cm_vending/sorted/medical/attackby(obj/item/I, mob/user)
if(stat == WORKING && LAZYLEN(chem_refill) && (istype(I, /obj/item/reagent_container/hypospray/autoinjector) || istype(I, /obj/item/reagent_container/glass/bottle))) // only if we are completely fine and working
if(!hacked)
Expand All @@ -80,6 +153,11 @@
to_chat(user, SPAN_WARNING("[src] makes a warning noise. The [C.name] is currently full."))
return

if(requires_supply_link_port && !get_supply_link())
to_chat(user, SPAN_WARNING("\The [src] makes a buzzing noise as it rejects \the [C.name]. Looks like this vendor cannot refill these outside of a medical bay's supply link."))
playsound(src, 'sound/machines/buzz-sigh.ogg', 15, TRUE)
return

to_chat(user, SPAN_NOTICE("[src] makes a whirring noise as it refills your [C.name]."))
// Since the reagent is deleted on use it's easier to make a new one instead of snowflake checking
var/obj/item/reagent_container/new_container = new C.type(src)
Expand All @@ -104,6 +182,11 @@
to_chat(user, SPAN_WARNING("[src] makes a warning noise. The [S.name] is currently fully stacked."))
return

if(requires_supply_link_port && !get_supply_link())
to_chat(user, SPAN_WARNING("\The [src] makes a buzzing noise as it rejects \the [S.name]. Looks like this vendor cannot restock non-full stacks outside of a medical bay's supply link."))
playsound(src, 'sound/machines/buzz-sigh.ogg', 15, TRUE)
return

to_chat(user, SPAN_NOTICE("[src] makes a whirring noise as it restocks your [S.name]."))
S.amount = S.max_amount
S.update_icon()
Expand Down Expand Up @@ -231,6 +314,7 @@
name = "\improper Medical Equipment Vendor"
desc = "A vending machine dispensing various pieces of medical equipment."
req_one_access = list(ACCESS_ILLEGAL_PIRATE, ACCESS_UPP_GENERAL, ACCESS_CLF_GENERAL)
requires_supply_link_port = FALSE
req_access = null
vendor_theme = VENDOR_THEME_CLF

Expand Down Expand Up @@ -272,6 +356,7 @@
name = "\improper Basic Medical Supplies Vendor"
desc = "A vending machine dispensing basic medical supplies."
req_one_access = list(ACCESS_ILLEGAL_PIRATE, ACCESS_UPP_GENERAL, ACCESS_CLF_GENERAL)
requires_supply_link_port = FALSE
req_access = null
vendor_theme = VENDOR_THEME_CLF

Expand Down Expand Up @@ -307,6 +392,7 @@

/obj/structure/machinery/cm_vending/sorted/medical/blood/antag
req_one_access = list(ACCESS_ILLEGAL_PIRATE, ACCESS_UPP_GENERAL, ACCESS_CLF_GENERAL)
requires_supply_link_port = FALSE
req_access = null
vendor_theme = VENDOR_THEME_CLF

Expand All @@ -315,6 +401,7 @@
desc = "Wall-mounted Medical Equipment Dispenser."
icon_state = "wallmed"
vend_delay = 0.7 SECONDS
requires_supply_link_port = FALSE

req_access = list()

Expand Down
6 changes: 5 additions & 1 deletion code/game/objects/structures.dm
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@

/obj/structure/proc/toggle_anchored(obj/item/W, mob/user)
if(!wrenchable)
to_chat(user, SPAN_WARNING("[src] cannot be [anchored ? "un" : ""]anchored."))
to_chat(user, SPAN_WARNING("The [src] cannot be [anchored ? "un" : ""]anchored."))
return FALSE
else
// Wrenching is faster if we are better at engineering
Expand All @@ -219,8 +219,12 @@
playsound(loc, 'sound/items/Ratchet.ogg', 25, 1)
if(anchored)
user.visible_message(SPAN_NOTICE("[user] anchors [src] into place."),SPAN_NOTICE("You anchor [src] into place."))
for(var/obj/O in loc)
SEND_SIGNAL(O, COMSIG_STRUCTURE_WRENCHED, src)
else
user.visible_message(SPAN_NOTICE("[user] unanchors [src]."),SPAN_NOTICE("You unanchor [src]."))
for(var/obj/O in loc)
SEND_SIGNAL(O, COMSIG_STRUCTURE_UNWRENCHED, src)
return TRUE

/obj/structure/get_applying_acid_time()
Expand Down
4 changes: 4 additions & 0 deletions code/modules/cm_marines/overwatch.dm
Original file line number Diff line number Diff line change
Expand Up @@ -884,10 +884,14 @@
density = FALSE
unslashable = TRUE
unacidable = TRUE
plane = FLOOR_PLANE
layer = 2.1 //It's the floor, man
var/squad = SQUAD_MARINE_1
var/sending_package = 0

/obj/structure/supply_drop/ex_act(severity, direction)
return FALSE

/obj/structure/supply_drop/Initialize(mapload, ...)
. = ..()
GLOB.supply_drop_list += src
Expand Down
Binary file modified icons/effects/warning_stripes.dmi
Binary file not shown.
12 changes: 9 additions & 3 deletions maps/map_files/USS_Almayer/USS_Almayer.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -10340,6 +10340,7 @@
pixel_x = 1
},
/obj/structure/machinery/cm_vending/sorted/medical/bolted,
/obj/structure/medical_supply_link,
/turf/open/floor/almayer{
dir = 4;
icon_state = "sterile_green_corner"
Expand Down Expand Up @@ -16846,6 +16847,7 @@
/area/almayer/squads/bravo)
"bET" = (
/obj/structure/machinery/cm_vending/sorted/medical/bolted,
/obj/structure/medical_supply_link,
/turf/open/floor/almayer{
icon_state = "sterile_green_side"
},
Expand Down Expand Up @@ -23934,9 +23936,7 @@
},
/area/almayer/engineering/lower/engine_core)
"cGp" = (
/obj/structure/machinery/cm_vending/clothing/senior_officer{
pixel_y = 0
},
/obj/structure/machinery/cm_vending/clothing/senior_officer,
/turf/open/floor/almayer{
icon_state = "mono"
},
Expand Down Expand Up @@ -31344,6 +31344,7 @@
/area/almayer/command/cic)
"fvJ" = (
/obj/structure/machinery/cm_vending/sorted/medical/bolted,
/obj/structure/medical_supply_link,
/turf/open/floor/almayer{
dir = 1;
icon_state = "sterile_green_side"
Expand Down Expand Up @@ -36343,6 +36344,7 @@
pixel_y = -32
},
/obj/structure/machinery/cm_vending/sorted/medical/bolted,
/obj/structure/medical_supply_link,
/turf/open/floor/almayer{
icon_state = "sterile_green_side"
},
Expand Down Expand Up @@ -40738,6 +40740,7 @@
/area/almayer/living/commandbunks)
"jbO" = (
/obj/structure/machinery/cm_vending/sorted/medical/bolted,
/obj/structure/medical_supply_link,
/turf/open/floor/almayer{
icon_state = "sterile_green_side"
},
Expand Down Expand Up @@ -45451,6 +45454,7 @@
pixel_y = -7
},
/obj/structure/machinery/cm_vending/sorted/medical/chemistry,
/obj/structure/medical_supply_link,
/turf/open/floor/almayer{
icon_state = "mono"
},
Expand Down Expand Up @@ -71506,6 +71510,7 @@
dir = 4
},
/obj/structure/machinery/cm_vending/sorted/medical/bolted,
/obj/structure/medical_supply_link,
/turf/open/floor/almayer{
dir = 1;
icon_state = "sterile_green_side"
Expand Down Expand Up @@ -72150,6 +72155,7 @@
/area/almayer/medical/containment/cell)
"uyJ" = (
/obj/structure/machinery/cm_vending/sorted/medical/chemistry,
/obj/structure/medical_supply_link,
/turf/open/floor/almayer{
icon_state = "dark_sterile"
},
Expand Down

0 comments on commit af8a25e

Please sign in to comment.