mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2026-08-21 12:17:40 +01:00
Merge pull request #14898 from Youtubeboy139/2023-SmartFridge
Some Smarter Fridges
This commit is contained in:
committed by
CHOMPStation2
parent
5f07c2a152
commit
3ff7a7d488
@@ -1,7 +1,12 @@
|
||||
/*
|
||||
* Industrial Sized Sheet Storage (but not actually industrial sized)
|
||||
*/
|
||||
/obj/machinery/smartfridge/sheets
|
||||
name = "\improper Smart Sheet Storage"
|
||||
desc = "A storage unit for metals."
|
||||
icon_contents = "boxes"
|
||||
name = "\improper Industrial Sheet Storage"
|
||||
desc = "An industrial sized storage unit for materials."
|
||||
icon_state = "base_industrial"
|
||||
icon_base = "industrial"
|
||||
icon_contents = "sheet"
|
||||
stored_datum_type = /datum/stored_item/stack
|
||||
|
||||
/obj/machinery/smartfridge/sheets/persistent
|
||||
@@ -30,3 +35,17 @@
|
||||
if(O.type == I.item_path) // Typecheck should evaluate material-specific subtype
|
||||
return I
|
||||
return null
|
||||
|
||||
/*
|
||||
* Mining Variant
|
||||
*/
|
||||
/obj/machinery/smartfridge/sheets/mining
|
||||
name = "\improper Mining Sheet Storage"
|
||||
icon_state = "base_mining"
|
||||
icon_base = "mining"
|
||||
icon_contents = "sheet"
|
||||
|
||||
/obj/machinery/smartfridge/sheets/mining/persistent
|
||||
persistent = /datum/persistent/storage/smartfridge/sheet_storage
|
||||
/obj/machinery/smartfridge/sheets/mining/persistent_lossy
|
||||
persistent = /datum/persistent/storage/smartfridge/sheet_storage/lossy
|
||||
@@ -1,21 +1,46 @@
|
||||
/*
|
||||
* Medical
|
||||
*/
|
||||
/obj/machinery/smartfridge/medbay
|
||||
name = "\improper Refrigerated Medicine Storage"
|
||||
desc = "A refrigerated storage unit for securely storing medicine and chemicals."
|
||||
icon_contents = "chem"
|
||||
|
||||
/obj/machinery/smartfridge/medbay/accept_check(var/obj/item/O as obj)
|
||||
if(istype(O,/obj/item/weapon/storage/pill_bottle) || istype(O,/obj/item/weapon/reagent_containers) || istype(O,/obj/item/weapon/reagent_containers/glass/))
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/obj/machinery/smartfridge/secure/medbay
|
||||
name = "\improper Refrigerated Medicine Storage"
|
||||
desc = "A refrigerated storage unit for storing medicine and chemicals."
|
||||
icon_contents = "chem"
|
||||
req_one_access = list(access_medical,access_chemistry)
|
||||
|
||||
/obj/machinery/smartfridge/secure/medbay/accept_check(var/obj/item/O as obj)
|
||||
if(istype(O,/obj/item/weapon/reagent_containers/glass/))
|
||||
if(istype(O,/obj/item/weapon/storage/pill_bottle) || istype(O,/obj/item/weapon/reagent_containers) || istype(O,/obj/item/weapon/reagent_containers/glass/))
|
||||
return 1
|
||||
if(istype(O,/obj/item/weapon/storage/pill_bottle/))
|
||||
return 0
|
||||
|
||||
/*
|
||||
* Virology
|
||||
*/
|
||||
/obj/machinery/smartfridge/virology
|
||||
name = "\improper Refrigerated Virus Storage"
|
||||
desc = "A refrigerated storage unit for storing viral material."
|
||||
icon_contents = "viro"
|
||||
|
||||
/obj/machinery/smartfridge/virology/accept_check(var/obj/item/O as obj)
|
||||
if(istype(O,/obj/item/weapon/reagent_containers/glass/beaker/vial/))
|
||||
return 1
|
||||
if(istype(O,/obj/item/weapon/reagent_containers/pill/))
|
||||
if(istype(O,/obj/item/weapon/virusdish/))
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/obj/machinery/smartfridge/secure/virology
|
||||
name = "\improper Refrigerated Virus Storage"
|
||||
desc = "A refrigerated storage unit for storing viral material."
|
||||
icon_contents = "misc"
|
||||
desc = "A refrigerated storage unit for securely storing viral material."
|
||||
icon_contents = "viro"
|
||||
req_access = list(access_virology)
|
||||
|
||||
/obj/machinery/smartfridge/secure/virology/accept_check(var/obj/item/O as obj)
|
||||
@@ -25,15 +50,27 @@
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/obj/machinery/smartfridge/chemistry //Is this used anywhere? It's not secure.
|
||||
/*
|
||||
* Chemistry
|
||||
*/
|
||||
/obj/machinery/smartfridge/chemistry
|
||||
name = "\improper Smart Chemical Storage"
|
||||
desc = "A refrigerated storage unit for medicine and chemical storage."
|
||||
desc = "A refrigerated storage unit for storing medicine and chemicals."
|
||||
icon_contents = "chem"
|
||||
req_one_access = list(access_chemistry)
|
||||
|
||||
/obj/machinery/smartfridge/chemistry/accept_check(var/obj/item/O as obj)
|
||||
if(istype(O,/obj/item/weapon/storage/pill_bottle) || istype(O,/obj/item/weapon/reagent_containers))
|
||||
if(istype(O,/obj/item/weapon/storage/pill_bottle) || istype(O,/obj/item/weapon/reagent_containers) || istype(O,/obj/item/weapon/reagent_containers/glass/))
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/obj/machinery/smartfridge/chemistry/virology //Same
|
||||
name = "\improper Smart Virus Storage"
|
||||
desc = "A refrigerated storage unit for volatile sample storage."
|
||||
/obj/machinery/smartfridge/secure/chemistry
|
||||
name = "\improper Smart Chemical Storage"
|
||||
desc = "A refrigerated storage unit for securely storing medicine and chemicals."
|
||||
icon_contents = "chem"
|
||||
req_one_access = list(access_chemistry)
|
||||
|
||||
/obj/machinery/smartfridge/secure/chemistry/accept_check(var/obj/item/O as obj)
|
||||
if(istype(O,/obj/item/weapon/storage/pill_bottle) || istype(O,/obj/item/weapon/reagent_containers) || istype(O,/obj/item/weapon/reagent_containers/glass/))
|
||||
return 1
|
||||
return 0
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
/*
|
||||
* Xenobiological
|
||||
*/
|
||||
/obj/machinery/smartfridge/secure/extract
|
||||
name = "\improper Biological Sample Storage"
|
||||
desc = "A refrigerated storage unit for xenobiological samples."
|
||||
icon_contents = "slime"
|
||||
req_access = list(access_research)
|
||||
|
||||
/obj/machinery/smartfridge/secure/extract/accept_check(var/obj/item/O as obj)
|
||||
if(istype(O, /obj/item/slime_extract) || istype(O, /obj/item/slimepotion))
|
||||
return 1
|
||||
return 0
|
||||
+59
-35
@@ -1,7 +1,59 @@
|
||||
/*
|
||||
* Chef
|
||||
*/
|
||||
/obj/machinery/smartfridge/chef
|
||||
desc = "For storing all sorts of delicious foods!"
|
||||
|
||||
/obj/machinery/smartfridge/chef/accept_check(var/obj/item/O as obj)
|
||||
if(istype(O,/obj/item/weapon/reagent_containers/food/snacks))
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/*
|
||||
* Bartender
|
||||
*/
|
||||
/obj/machinery/smartfridge/drinks
|
||||
name = "\improper Smart Drink Storage"
|
||||
desc = "A refrigerated storage unit for tasty tasty alcohol."
|
||||
icon_contents = "drinks"
|
||||
|
||||
/obj/machinery/smartfridge/drinks/accept_check(var/obj/item/O as obj)
|
||||
if(istype(O,/obj/item/weapon/reagent_containers/glass) || istype(O,/obj/item/weapon/reagent_containers/food/drinks) || istype(O,/obj/item/weapon/reagent_containers/food/condiment))
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/obj/machinery/smartfridge/drinks/showcase
|
||||
name = "\improper Drink Showcase"
|
||||
icon_state = "base_showcase"
|
||||
icon_base = "showcase"
|
||||
|
||||
//Showcase needs a special icon update
|
||||
/obj/machinery/smartfridge/drinks/showcase/update_icon()
|
||||
cut_overlays()
|
||||
if(panel_open)
|
||||
add_overlay("[icon_base]-panel")
|
||||
|
||||
if(stat & (BROKEN))
|
||||
cut_overlays()
|
||||
icon_state = "[icon_base]-broken"
|
||||
|
||||
if(stat & (NOPOWER))
|
||||
icon_state = "[icon_base]-off"
|
||||
else
|
||||
icon_state = icon_base
|
||||
switch(contents.len)
|
||||
if(0)
|
||||
add_overlay("[icon_base]")
|
||||
if(1 to 3)
|
||||
add_overlay("[icon_base]-fill")
|
||||
|
||||
/*
|
||||
* Hydroponics
|
||||
*/
|
||||
/obj/machinery/smartfridge/produce
|
||||
name = "\improper Smart Produce Storage"
|
||||
desc = "For storing all sorts of perishable foods!"
|
||||
icon_contents = "boxes"
|
||||
desc = "For storing all sorts of perishable produce!"
|
||||
icon_contents = "plants"
|
||||
|
||||
/obj/machinery/smartfridge/produce/persistent
|
||||
persistent = /datum/persistent/storage/smartfridge/produce
|
||||
@@ -11,43 +63,15 @@
|
||||
|
||||
/obj/machinery/smartfridge/produce/accept_check(var/obj/item/O as obj)
|
||||
if(istype(O,/obj/item/weapon/reagent_containers/food/snacks/grown/) || istype(O,/obj/item/seeds/))
|
||||
return TRUE
|
||||
return FALSE
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/obj/machinery/smartfridge/drinks
|
||||
name = "\improper Smart Drink Storage"
|
||||
desc = "A refrigerated storage unit for tasty tasty alcohol."
|
||||
icon_contents = "drinks"
|
||||
|
||||
/obj/machinery/smartfridge/drinks/showcase
|
||||
name = "\improper Drink Showcase"
|
||||
icon_state = "showcase"
|
||||
icon_base = "showcase"
|
||||
|
||||
/obj/machinery/smartfridge/drinks/accept_check(var/obj/item/O as obj)
|
||||
if(istype(O,/obj/item/weapon/reagent_containers/glass) || istype(O,/obj/item/weapon/reagent_containers/food/drinks) || istype(O,/obj/item/weapon/reagent_containers/food/condiment))
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
/obj/machinery/smartfridge/seeds
|
||||
/obj/machinery/smartfridge/seeds //I honestly don't know why this exists when you can store seeds in the vendor. It's not even persistent.
|
||||
name = "\improper MegaSeed Servitor"
|
||||
desc = "When you need seeds fast!"
|
||||
icon_contents = "boxes"
|
||||
icon_contents = "petri" //There's no seed base in the current batch
|
||||
|
||||
/obj/machinery/smartfridge/seeds/accept_check(var/obj/item/O as obj)
|
||||
if(istype(O,/obj/item/seeds/))
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/obj/machinery/smartfridge/secure/extract
|
||||
name = "\improper Biological Sample Storage"
|
||||
desc = "A refrigerated storage unit for xenobiological samples."
|
||||
req_access = list(access_research)
|
||||
icon_contents = "drinks"
|
||||
|
||||
/obj/machinery/smartfridge/secure/extract/accept_check(var/obj/item/O as obj)
|
||||
if(istype(O, /obj/item/slime_extract))
|
||||
return TRUE
|
||||
if(istype(O, /obj/item/slimepotion))
|
||||
return TRUE
|
||||
return FALSE
|
||||
return 0
|
||||
@@ -1,12 +1,10 @@
|
||||
/* SmartFridge. Much todo
|
||||
*/
|
||||
/obj/machinery/smartfridge
|
||||
name = "\improper SmartFridge"
|
||||
desc = "For storing all sorts of things! This one doesn't accept any of them!"
|
||||
icon = 'icons/obj/vending.dmi'
|
||||
icon = 'icons/obj/vending_smartfridge.dmi'
|
||||
icon_state = "smartfridge"
|
||||
var/icon_base = "smartfridge" //Iconstate to base all the broken/deny/etc on
|
||||
var/icon_contents = "misc" //Overlay to put on glass to show contents
|
||||
var/icon_contents = "food" //Overlay to put on that show contents
|
||||
density = TRUE
|
||||
anchored = TRUE
|
||||
use_power = USE_POWER_IDLE
|
||||
@@ -67,26 +65,35 @@
|
||||
|
||||
/obj/machinery/smartfridge/update_icon()
|
||||
cut_overlays()
|
||||
if(stat & (BROKEN|NOPOWER))
|
||||
icon_state = "[icon_base]-off"
|
||||
else
|
||||
icon_state = icon_base
|
||||
|
||||
if(panel_open)
|
||||
add_overlay("[icon_base]-panel")
|
||||
|
||||
// Fridge contents
|
||||
switch(contents.len)
|
||||
if(1 to 3)
|
||||
add_overlay("[icon_base]-[icon_contents]1")
|
||||
if(3 to 6)
|
||||
add_overlay("[icon_base]-[icon_contents]2")
|
||||
if(6 to INFINITY)
|
||||
add_overlay("[icon_base]-[icon_contents]3")
|
||||
if(stat & (BROKEN))
|
||||
cut_overlays()
|
||||
icon_state = "[icon_base]-broken"
|
||||
|
||||
/*******************
|
||||
* Item Adding
|
||||
********************/
|
||||
if(stat & (NOPOWER))
|
||||
icon_state = "[icon_base]-off"
|
||||
switch(contents.len)
|
||||
if(0)
|
||||
add_overlay("[icon_base]-0-off")
|
||||
if(1 to 3)
|
||||
add_overlay("[icon_base]-[icon_contents]1-off")
|
||||
if(3 to 6)
|
||||
add_overlay("[icon_base]-[icon_contents]2-off")
|
||||
if(6 to INFINITY)
|
||||
add_overlay("[icon_base]-[icon_contents]3-off")
|
||||
else
|
||||
icon_state = icon_base
|
||||
switch(contents.len)
|
||||
if(0)
|
||||
add_overlay("[icon_base]-0")
|
||||
if(1 to 3)
|
||||
add_overlay("[icon_base]-[icon_contents]1")
|
||||
if(3 to 6)
|
||||
add_overlay("[icon_base]-[icon_contents]2")
|
||||
if(6 to INFINITY)
|
||||
add_overlay("[icon_base]-[icon_contents]3")
|
||||
|
||||
/obj/machinery/smartfridge/attackby(var/obj/item/O as obj, var/mob/user as mob)
|
||||
if(O.is_screwdriver())
|
||||
@@ -226,6 +233,7 @@
|
||||
return TRUE
|
||||
|
||||
vend(item_records[index], amount)
|
||||
update_icon()
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
@@ -247,12 +255,12 @@
|
||||
throw_item.throw_at(target,16,3,src)
|
||||
src.visible_message("<span class='warning'>[src] launches [throw_item.name] at [target.name]!</span>")
|
||||
SStgui.update_uis(src)
|
||||
update_icon()
|
||||
return TRUE
|
||||
|
||||
/************************
|
||||
* Secure SmartFridges
|
||||
*************************/
|
||||
|
||||
/*
|
||||
* Secure Smartfridges
|
||||
*/
|
||||
/obj/machinery/smartfridge/secure/tgui_act(action, params)
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return TRUE
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
/*
|
||||
* Expert Jobs
|
||||
*/
|
||||
/obj/machinery/smartfridge
|
||||
var/expert_job = "Chef"
|
||||
/obj/machinery/smartfridge/seeds
|
||||
@@ -6,14 +9,16 @@
|
||||
expert_job = "Xenobiologist"
|
||||
/obj/machinery/smartfridge/secure/medbay
|
||||
expert_job = "Chemist"
|
||||
/obj/machinery/smartfridge/secure/chemistry
|
||||
expert_job = "Chemist"
|
||||
/obj/machinery/smartfridge/secure/virology
|
||||
expert_job = "Medical Doctor" //Virologist is an alt-title unfortunately
|
||||
/obj/machinery/smartfridge/chemistry
|
||||
expert_job = "Chemist" //Unsure what this one is used for, actually
|
||||
/obj/machinery/smartfridge/drinks
|
||||
expert_job = "Bartender"
|
||||
|
||||
// Allow thrown items into smartfridges
|
||||
/*
|
||||
* Allow thrown items into smartfridges
|
||||
*/
|
||||
/obj/machinery/smartfridge/hitby(var/atom/movable/A, speed)
|
||||
. = ..()
|
||||
if(accept_check(A) && A.thrower)
|
||||
@@ -31,12 +36,20 @@
|
||||
else if(prob(20))
|
||||
stock(A)
|
||||
|
||||
//Chemistry 'chemavator'
|
||||
/*
|
||||
* Chemistry 'chemavator' (multi-z chem storage)
|
||||
*/
|
||||
/obj/machinery/smartfridge/chemistry/chemvator
|
||||
name = "\improper Smart Chemavator - Upper"
|
||||
desc = "A refrigerated storage unit for medicine and chemical storage. Now sporting a fancy system of pulleys to lift bottles up and down."
|
||||
expert_job = "Chemist"
|
||||
var/obj/machinery/smartfridge/chemistry/chemvator/attached
|
||||
|
||||
/obj/machinery/smartfridge/chemistry/chemvator/accept_check(var/obj/item/O as obj)
|
||||
if(istype(O,/obj/item/weapon/storage/pill_bottle) || istype(O,/obj/item/weapon/reagent_containers) || istype(O,/obj/item/weapon/reagent_containers/glass/))
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/obj/machinery/smartfridge/chemistry/chemvator/down/Destroy()
|
||||
attached = null
|
||||
return ..()
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 426 KiB After Width: | Height: | Size: 419 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 38 KiB |
+2
-1
@@ -2506,8 +2506,9 @@
|
||||
#include "code\modules\food\kitchen\cooking_machines\oven.dm"
|
||||
#include "code\modules\food\kitchen\smartfridge\drying_rack.dm"
|
||||
#include "code\modules\food\kitchen\smartfridge\engineering.dm"
|
||||
#include "code\modules\food\kitchen\smartfridge\hydroponics.dm"
|
||||
#include "code\modules\food\kitchen\smartfridge\medical.dm"
|
||||
#include "code\modules\food\kitchen\smartfridge\research.dm"
|
||||
#include "code\modules\food\kitchen\smartfridge\service.dm"
|
||||
#include "code\modules\food\kitchen\smartfridge\smartfridge.dm"
|
||||
#include "code\modules\food\kitchen\smartfridge\smartfridge_vr.dm"
|
||||
#include "code\modules\gamemaster\defines.dm"
|
||||
|
||||
Reference in New Issue
Block a user