mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 10:12:45 +00:00
Port Bay's vendor/smartfridge sprites
This commit is contained in:
committed by
Aronai Sieyes
parent
002f4b6469
commit
a23797182f
@@ -2,19 +2,26 @@
|
||||
*/
|
||||
/obj/machinery/smartfridge
|
||||
name = "\improper SmartFridge"
|
||||
desc = "For storing all sorts of perishable foods!"
|
||||
icon = 'icons/obj/vending.dmi'
|
||||
icon_state = "smartfridge"
|
||||
icon_state = "fridge_food"
|
||||
var/icon_base = "fridge_food" //Iconstate to base all the broken/deny/etc on
|
||||
var/icon_contents = "food" //Overlay to put on glass to show contents
|
||||
density = 1
|
||||
anchored = 1
|
||||
use_power = USE_POWER_IDLE
|
||||
idle_power_usage = 5
|
||||
active_power_usage = 100
|
||||
flags = NOREACT
|
||||
<<<<<<< HEAD
|
||||
var/max_n_of_items = 999 // Sorry but the BYOND infinite loop detector doesn't look things over 1000. //VOREStation Edit - Non-global
|
||||
//var/global/max_n_of_items = 999 // Sorry but the BYOND infinite loop detector doesn't look things over 1000.
|
||||
var/icon_on = "smartfridge"
|
||||
var/icon_off = "smartfridge-off"
|
||||
var/icon_panel = "smartfridge-panel"
|
||||
=======
|
||||
var/global/max_n_of_items = 999 // Sorry but the BYOND infinite loop detector doesn't look things over 1000.
|
||||
>>>>>>> 636062b... Merge pull request #6858 from VOREStation/pol-bayvend
|
||||
var/list/item_records = list()
|
||||
var/datum/stored_item/currently_vending = null //What we're putting out of the machine.
|
||||
var/seconds_electrified = 0;
|
||||
@@ -27,6 +34,9 @@
|
||||
|
||||
/obj/machinery/smartfridge/secure
|
||||
is_secure = 1
|
||||
icon_state = "fridge_sci"
|
||||
icon_base = "fridge_sci"
|
||||
icon_contents = "chem"
|
||||
|
||||
/obj/machinery/smartfridge/New()
|
||||
..()
|
||||
@@ -50,10 +60,7 @@
|
||||
/obj/machinery/smartfridge/seeds
|
||||
name = "\improper MegaSeed Servitor"
|
||||
desc = "When you need seeds fast!"
|
||||
icon = 'icons/obj/vending.dmi'
|
||||
icon_state = "seeds"
|
||||
icon_on = "seeds"
|
||||
icon_off = "seeds-off"
|
||||
icon_contents = "chem"
|
||||
|
||||
/obj/machinery/smartfridge/seeds/accept_check(var/obj/item/O as obj)
|
||||
if(istype(O,/obj/item/seeds/))
|
||||
@@ -63,6 +70,7 @@
|
||||
/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)
|
||||
@@ -72,12 +80,9 @@
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
|
||||
/obj/machinery/smartfridge/secure/medbay
|
||||
name = "\improper Refrigerated Medicine Storage"
|
||||
desc = "A refrigerated storage unit for storing medicine and chemicals."
|
||||
icon_state = "smartfridge" //To fix the icon in the map editor.
|
||||
icon_on = "smartfridge_chem"
|
||||
req_one_access = list(access_medical,access_chemistry)
|
||||
|
||||
/obj/machinery/smartfridge/secure/medbay/accept_check(var/obj/item/O as obj)
|
||||
@@ -92,10 +97,8 @@
|
||||
/obj/machinery/smartfridge/secure/virology
|
||||
name = "\improper Refrigerated Virus Storage"
|
||||
desc = "A refrigerated storage unit for storing viral material."
|
||||
icon_contents = "drink"
|
||||
req_access = list(access_virology)
|
||||
icon_state = "smartfridge_virology"
|
||||
icon_on = "smartfridge_virology"
|
||||
icon_off = "smartfridge_virology-off"
|
||||
|
||||
/obj/machinery/smartfridge/secure/virology/accept_check(var/obj/item/O as obj)
|
||||
if(istype(O,/obj/item/weapon/reagent_containers/glass/beaker/vial/))
|
||||
@@ -104,23 +107,26 @@
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/obj/machinery/smartfridge/chemistry
|
||||
/obj/machinery/smartfridge/chemistry //Is this used anywhere? It's not secure.
|
||||
name = "\improper Smart Chemical Storage"
|
||||
desc = "A refrigerated storage unit for medicine and chemical storage."
|
||||
icon_contents = "chem"
|
||||
|
||||
/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))
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/obj/machinery/smartfridge/chemistry/virology
|
||||
/obj/machinery/smartfridge/chemistry/virology //Same
|
||||
name = "\improper Smart Virus Storage"
|
||||
desc = "A refrigerated storage unit for volatile sample storage."
|
||||
|
||||
|
||||
/obj/machinery/smartfridge/drinks
|
||||
name = "\improper Drink Showcase"
|
||||
desc = "A refrigerated storage unit for tasty tasty alcohol."
|
||||
icon_state = "fridge_drinks"
|
||||
icon_base = "fridge_drinks"
|
||||
icon_contents = "drink"
|
||||
|
||||
/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))
|
||||
@@ -131,9 +137,7 @@
|
||||
desc = "A machine for drying plants."
|
||||
wrenchable = 1
|
||||
icon_state = "drying_rack"
|
||||
icon_on = "drying_rack_on"
|
||||
icon_off = "drying_rack"
|
||||
icon_panel = "drying_rack-panel"
|
||||
icon_base = "drying_rack"
|
||||
|
||||
/obj/machinery/smartfridge/drying_rack/accept_check(var/obj/item/O as obj)
|
||||
if(istype(O, /obj/item/weapon/reagent_containers/food/snacks/))
|
||||
@@ -151,21 +155,22 @@
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/smartfridge/drying_rack/update_icon()
|
||||
overlays.Cut()
|
||||
var/not_working = stat & (BROKEN|NOPOWER)
|
||||
if(not_working)
|
||||
icon_state = icon_off
|
||||
else
|
||||
icon_state = icon_on
|
||||
var/hasItems
|
||||
for(var/datum/stored_item/I in item_records)
|
||||
if(I.get_amount())
|
||||
hasItems = 1
|
||||
break
|
||||
if(hasItems)
|
||||
overlays += "drying_rack_filled"
|
||||
if(!not_working)
|
||||
overlays += "drying_rack_drying"
|
||||
if(not_working)
|
||||
icon_state = "[icon_base]-plant-off"
|
||||
else
|
||||
icon_state = "[icon_base]-plant"
|
||||
else
|
||||
if(not_working)
|
||||
icon_state = "[icon_base]-off"
|
||||
else
|
||||
icon_state = "[icon_base]"
|
||||
|
||||
/obj/machinery/smartfridge/drying_rack/proc/dry()
|
||||
for(var/datum/stored_item/I in item_records)
|
||||
@@ -199,10 +204,40 @@
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/smartfridge/update_icon()
|
||||
cut_overlays()
|
||||
if(stat & (BROKEN|NOPOWER))
|
||||
icon_state = icon_off
|
||||
icon_state = "[icon_base]-off"
|
||||
else
|
||||
icon_state = icon_on
|
||||
icon_state = icon_base
|
||||
|
||||
if(is_secure)
|
||||
add_overlay("[icon_base]-sidepanel")
|
||||
|
||||
if(panel_open)
|
||||
add_overlay("[icon_base]-panel")
|
||||
|
||||
var/is_off = ""
|
||||
if(inoperable())
|
||||
is_off = "-off"
|
||||
|
||||
// Fridge contents
|
||||
switch(contents.len)
|
||||
if(0)
|
||||
add_overlay("empty[is_off]")
|
||||
if(1 to 2)
|
||||
add_overlay("[icon_contents]-1[is_off]")
|
||||
if(3 to 5)
|
||||
add_overlay("[icon_contents]-2[is_off]")
|
||||
if(6 to 8)
|
||||
add_overlay("[icon_contents]-3[is_off]")
|
||||
else
|
||||
add_overlay("[icon_contents]-4[is_off]")
|
||||
|
||||
// Fridge top
|
||||
var/image/top = image(icon, "[icon_base]-top")
|
||||
top.pixel_z = 32
|
||||
top.layer = ABOVE_WINDOW_LAYER
|
||||
add_overlay(top)
|
||||
|
||||
/*******************
|
||||
* Item Adding
|
||||
@@ -213,9 +248,7 @@
|
||||
panel_open = !panel_open
|
||||
user.visible_message("[user] [panel_open ? "opens" : "closes"] the maintenance panel of \the [src].", "You [panel_open ? "open" : "close"] the maintenance panel of \the [src].")
|
||||
playsound(src, O.usesound, 50, 1)
|
||||
overlays.Cut()
|
||||
if(panel_open)
|
||||
overlays += image(icon, icon_panel)
|
||||
update_icon()
|
||||
SSnanoui.update_uis(src)
|
||||
return
|
||||
|
||||
|
||||
Reference in New Issue
Block a user