Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Requisition Centralization [Part 1.5] AKA medvendor infinite restock outside medbay cheese removal redux #5677

Merged
merged 45 commits into from
Apr 7, 2024
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
7595329
Merge remote-tracking branch 'cmss13-devs/master'
ItsVyzo Dec 15, 2023
3b0381b
Merge branch 'master' into master
ItsVyzo Dec 25, 2023
c37fcc5
Merge branch 'cmss13-devs:master' into master
ItsVyzo Jan 14, 2024
5b0150a
Merge branch 'cmss13-devs:master' into master
ItsVyzo Feb 3, 2024
af8a25e
stan blessed
ItsVyzo Feb 7, 2024
10022d9
oops
ItsVyzo Feb 7, 2024
451aef2
resolving
ItsVyzo Feb 7, 2024
71d0e14
more resolves
ItsVyzo Feb 7, 2024
c85fc01
fixes
ItsVyzo Feb 7, 2024
c8cb991
Merge remote-tracking branch 'cmss13-devs/master' into medvendor_source
ItsVyzo Feb 7, 2024
83b0c2d
Merge remote-tracking branch 'cmss13-devs/master' into medvendor_source
ItsVyzo Mar 8, 2024
7a52475
Merge branch 'master' into medsource_vendor
Nanu308 Mar 13, 2024
4e203e8
updates please work
ItsVyzo Mar 28, 2024
1b66e3c
Merge remote-tracking branch 'cmss13-devs/master' into medvendor_source
ItsVyzo Mar 29, 2024
8125a4a
linterss
ItsVyzo Mar 29, 2024
02407a4
updates finalization
ItsVyzo Mar 29, 2024
a75eb61
Update code/game/machinery/vending/vendor_types/medical.dm
ItsVyzo Apr 2, 2024
eae66bd
Update code/game/machinery/vending/vendor_types/medical.dm
ItsVyzo Apr 2, 2024
a838c3f
Update code/game/machinery/vending/vendor_types/medical.dm
ItsVyzo Apr 2, 2024
05cee0e
Update code/game/machinery/vending/vendor_types/medical.dm
ItsVyzo Apr 2, 2024
3d4f26e
Update code/game/machinery/vending/vendor_types/medical.dm
ItsVyzo Apr 2, 2024
9467098
Update code/game/machinery/vending/vendor_types/medical.dm
ItsVyzo Apr 2, 2024
d205222
Update code/game/machinery/vending/vendor_types/medical.dm
ItsVyzo Apr 2, 2024
ad94268
Update code/game/machinery/vending/vendor_types/medical.dm
ItsVyzo Apr 4, 2024
3ac22b8
Update code/game/machinery/vending/vendor_types/medical.dm
ItsVyzo Apr 4, 2024
0513df4
Update code/game/machinery/vending/vendor_types/medical.dm
ItsVyzo Apr 4, 2024
2d15483
Update code/game/machinery/vending/vendor_types/medical.dm
ItsVyzo Apr 4, 2024
1dad0d9
Update code/game/machinery/vending/vendor_types/medical.dm
ItsVyzo Apr 4, 2024
3c4752e
Update code/game/machinery/vending/vendor_types/medical.dm
ItsVyzo Apr 4, 2024
b018bb2
Update code/game/machinery/vending/vendor_types/medical.dm
ItsVyzo Apr 4, 2024
0ff7b77
fixes and updates
ItsVyzo Apr 4, 2024
d6a4c00
finally
ItsVyzo Apr 5, 2024
d13053e
final final finally
ItsVyzo Apr 6, 2024
7d8e7ba
Update code/game/machinery/vending/vendor_types/medical.dm
ItsVyzo Apr 6, 2024
3a32400
Update code/game/machinery/vending/vendor_types/medical.dm
ItsVyzo Apr 6, 2024
dd7ca43
Update code/game/machinery/vending/vendor_types/medical.dm
ItsVyzo Apr 6, 2024
2ac33e2
Update code/game/machinery/vending/vendor_types/medical.dm
ItsVyzo Apr 6, 2024
a2592fb
Update code/game/machinery/vending/vendor_types/medical.dm
ItsVyzo Apr 6, 2024
2bc3b16
Update code/game/machinery/vending/vendor_types/medical.dm
ItsVyzo Apr 6, 2024
2bf9824
Update code/game/machinery/vending/vendor_types/medical.dm
ItsVyzo Apr 6, 2024
c7010c1
Update code/game/machinery/vending/vendor_types/medical.dm
ItsVyzo Apr 6, 2024
0d93938
Update code/game/machinery/vending/vendor_types/medical.dm
ItsVyzo Apr 6, 2024
d142a42
Update code/game/machinery/vending/vendor_types/medical.dm
ItsVyzo Apr 6, 2024
c6fb965
Update code/game/machinery/vending/vendor_types/medical.dm
ItsVyzo Apr 6, 2024
44a51a4
final final final final finally
ItsVyzo Apr 6, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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'
ItsVyzo marked this conversation as resolved.
Show resolved Hide resolved
icon_state = "medlink_unclamped"
ItsVyzo marked this conversation as resolved.
Show resolved Hide resolved
anchored = TRUE
density = FALSE
unslashable = TRUE
unacidable = TRUE
plane = FLOOR_PLANE
layer = 2.1 //It's the floor, man
ItsVyzo marked this conversation as resolved.
Show resolved Hide resolved

/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)
ItsVyzo marked this conversation as resolved.
Show resolved Hide resolved
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()
ItsVyzo marked this conversation as resolved.
Show resolved Hide resolved
ItsVyzo marked this conversation as resolved.
Show resolved Hide resolved
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)
ItsVyzo marked this conversation as resolved.
Show resolved Hide resolved
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
ItsVyzo marked this conversation as resolved.
Show resolved Hide resolved

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()
ItsVyzo marked this conversation as resolved.
Show resolved Hide resolved
var/linkpoint = locate(/obj/structure/medical_supply_link) in loc
ItsVyzo marked this conversation as resolved.
Show resolved Hide resolved
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."))
ItsVyzo marked this conversation as resolved.
Show resolved Hide resolved
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."))
ItsVyzo marked this conversation as resolved.
Show resolved Hide resolved
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."))
ItsVyzo marked this conversation as resolved.
Show resolved Hide resolved
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."))
ItsVyzo marked this conversation as resolved.
Show resolved Hide resolved
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."))
ItsVyzo marked this conversation as resolved.
Show resolved Hide resolved
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)
ItsVyzo marked this conversation as resolved.
Show resolved Hide resolved
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)
ItsVyzo marked this conversation as resolved.
Show resolved Hide resolved
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
ItsVyzo marked this conversation as resolved.
Show resolved Hide resolved
Binary file not shown.
24 changes: 19 additions & 5 deletions maps/map_files/USS_Almayer/USS_Almayer.dmm
ItsVyzo marked this conversation as resolved.
Show resolved Hide resolved
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mapping looking great with transparent version 👍

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 @@ -36894,6 +36896,13 @@
icon_state = "plate"
},
/area/almayer/shipboard/brig/perma)
"hDr" = (
/obj/structure/machinery/photocopier,
/turf/open/floor/almayer{
dir = 10;
icon_state = "red"
},
/area/almayer/shipboard/brig/main_office)
"hDw" = (
/obj/structure/surface/table/almayer,
/obj/structure/machinery/computer/emails{
Expand Down Expand Up @@ -40738,6 +40747,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 +45461,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 @@ -65903,6 +65914,7 @@
/area/almayer/shipboard/sea_office)
"skq" = (
/obj/structure/machinery/cm_vending/sorted/medical,
/obj/structure/medical_supply_link,
/turf/open/floor/almayer{
dir = 1;
icon_state = "sterile_green_side"
Expand Down Expand Up @@ -71506,6 +71518,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 +72163,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 Expand Up @@ -92334,10 +92348,10 @@ vBm
lOI
pJv
jLM
tak
wDp
cMb
rbi
wDp
hDr
xys
nkX
iQB
Expand Down
Loading