mirror of
https://github.com/PolarisSS13/Polaris.git
synced 2025-12-18 06:01:56 +00:00
Move almost everythign food related into the kitchen module.
Not moving reagents and tools.
This commit is contained in:
@@ -1,38 +1,38 @@
|
||||
#define CELLS 8
|
||||
#define CELLSIZE (32/CELLS)
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Food.
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/obj/item/weapon/reagent_containers/food
|
||||
possible_transfer_amounts = null
|
||||
volume = 50 //Sets the default container amount for all food items.
|
||||
var/filling_color = "#FFFFFF" //Used by sandwiches.
|
||||
|
||||
var/list/center_of_mass = list() // Used for table placement
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/New()
|
||||
..()
|
||||
if (center_of_mass.len && !pixel_x && !pixel_y)
|
||||
src.pixel_x = rand(-6.0, 6) //Randomizes postion
|
||||
src.pixel_y = rand(-6.0, 6)
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/afterattack(atom/A, mob/user, proximity, params)
|
||||
if(center_of_mass.len && proximity && params && istype(A, /obj/structure/table))
|
||||
//Places the item on a grid
|
||||
var/list/mouse_control = params2list(params)
|
||||
|
||||
var/mouse_x = text2num(mouse_control["icon-x"])
|
||||
var/mouse_y = text2num(mouse_control["icon-y"])
|
||||
|
||||
if(!isnum(mouse_x) || !isnum(mouse_y))
|
||||
return
|
||||
|
||||
var/cell_x = max(0, min(CELLS-1, round(mouse_x/CELLSIZE)))
|
||||
var/cell_y = max(0, min(CELLS-1, round(mouse_y/CELLSIZE)))
|
||||
|
||||
pixel_x = (CELLSIZE * (0.5 + cell_x)) - center_of_mass["x"]
|
||||
pixel_y = (CELLSIZE * (0.5 + cell_y)) - center_of_mass["y"]
|
||||
|
||||
#undef CELLS
|
||||
#undef CELLSIZE
|
||||
#define CELLS 8
|
||||
#define CELLSIZE (32/CELLS)
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Food.
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/obj/item/weapon/reagent_containers/food
|
||||
possible_transfer_amounts = null
|
||||
volume = 50 //Sets the default container amount for all food items.
|
||||
var/filling_color = "#FFFFFF" //Used by sandwiches.
|
||||
|
||||
var/list/center_of_mass = list() // Used for table placement
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/New()
|
||||
..()
|
||||
if (center_of_mass.len && !pixel_x && !pixel_y)
|
||||
src.pixel_x = rand(-6.0, 6) //Randomizes postion
|
||||
src.pixel_y = rand(-6.0, 6)
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/afterattack(atom/A, mob/user, proximity, params)
|
||||
if(center_of_mass.len && proximity && params && istype(A, /obj/structure/table))
|
||||
//Places the item on a grid
|
||||
var/list/mouse_control = params2list(params)
|
||||
|
||||
var/mouse_x = text2num(mouse_control["icon-x"])
|
||||
var/mouse_y = text2num(mouse_control["icon-y"])
|
||||
|
||||
if(!isnum(mouse_x) || !isnum(mouse_y))
|
||||
return
|
||||
|
||||
var/cell_x = max(0, min(CELLS-1, round(mouse_x/CELLSIZE)))
|
||||
var/cell_y = max(0, min(CELLS-1, round(mouse_y/CELLSIZE)))
|
||||
|
||||
pixel_x = (CELLSIZE * (0.5 + cell_x)) - center_of_mass["x"]
|
||||
pixel_y = (CELLSIZE * (0.5 + cell_y)) - center_of_mass["y"]
|
||||
|
||||
#undef CELLS
|
||||
#undef CELLSIZE
|
||||
@@ -1,178 +1,178 @@
|
||||
|
||||
///////////////////////////////////////////////Condiments
|
||||
//Notes by Darem: The condiments food-subtype is for stuff you don't actually eat but you use to modify existing food. They all
|
||||
// leave empty containers when used up and can be filled/re-filled with other items. Formatting for first section is identical
|
||||
// to mixed-drinks code. If you want an object that starts pre-loaded, you need to make it in addition to the other code.
|
||||
|
||||
//Food items that aren't eaten normally and leave an empty container behind.
|
||||
/obj/item/weapon/reagent_containers/food/condiment
|
||||
name = "Condiment Container"
|
||||
desc = "Just your average condiment container."
|
||||
icon = 'icons/obj/food.dmi'
|
||||
icon_state = "emptycondiment"
|
||||
flags = OPENCONTAINER
|
||||
possible_transfer_amounts = list(1,5,10)
|
||||
center_of_mass = list("x"=16, "y"=6)
|
||||
volume = 50
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/condiment/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
|
||||
return
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/condiment/attack_self(var/mob/user as mob)
|
||||
return
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/condiment/attack(var/mob/M as mob, var/mob/user as mob, var/def_zone)
|
||||
if(standard_feed_mob(user, M))
|
||||
return
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/condiment/afterattack(var/obj/target, var/mob/user, var/flag)
|
||||
if(standard_dispenser_refill(user, target))
|
||||
return
|
||||
if(standard_pour_into(user, target))
|
||||
return
|
||||
|
||||
if(istype(target, /obj/item/weapon/reagent_containers/food/snacks)) // These are not opencontainers but we can transfer to them
|
||||
if(!reagents || !reagents.total_volume)
|
||||
user << "<span class='notice'>There is no condiment left in \the [src].</span>"
|
||||
return
|
||||
|
||||
if(!target.reagents.get_free_space())
|
||||
user << "<span class='notice'>You can't add more condiment to \the [target].</span>"
|
||||
return
|
||||
|
||||
var/trans = reagents.trans_to_obj(target, amount_per_transfer_from_this)
|
||||
user << "<span class='notice'>You add [trans] units of the condiment to \the [target].</span>"
|
||||
else
|
||||
..()
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/condiment/feed_sound(var/mob/user)
|
||||
playsound(user.loc, 'sound/items/drink.ogg', rand(10, 50), 1)
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/condiment/self_feed_message(var/mob/user)
|
||||
user << "<span class='notice'>You swallow some of contents of \the [src].</span>"
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/condiment/on_reagent_change()
|
||||
if(reagents.reagent_list.len > 0)
|
||||
switch(reagents.get_master_reagent_id())
|
||||
if("ketchup")
|
||||
name = "Ketchup"
|
||||
desc = "You feel more American already."
|
||||
icon_state = "ketchup"
|
||||
center_of_mass = list("x"=16, "y"=6)
|
||||
if("capsaicin")
|
||||
name = "Hotsauce"
|
||||
desc = "You can almost TASTE the stomach ulcers now!"
|
||||
icon_state = "hotsauce"
|
||||
center_of_mass = list("x"=16, "y"=6)
|
||||
if("enzyme")
|
||||
name = "Universal Enzyme"
|
||||
desc = "Used in cooking various dishes."
|
||||
icon_state = "enzyme"
|
||||
center_of_mass = list("x"=16, "y"=6)
|
||||
if("soysauce")
|
||||
name = "Soy Sauce"
|
||||
desc = "A salty soy-based flavoring."
|
||||
icon_state = "soysauce"
|
||||
center_of_mass = list("x"=16, "y"=6)
|
||||
if("frostoil")
|
||||
name = "Coldsauce"
|
||||
desc = "Leaves the tongue numb in its passage."
|
||||
icon_state = "coldsauce"
|
||||
center_of_mass = list("x"=16, "y"=6)
|
||||
if("sodiumchloride")
|
||||
name = "Salt Shaker"
|
||||
desc = "Salt. From space oceans, presumably."
|
||||
icon_state = "saltshaker"
|
||||
center_of_mass = list("x"=16, "y"=10)
|
||||
if("blackpepper")
|
||||
name = "Pepper Mill"
|
||||
desc = "Often used to flavor food or make people sneeze."
|
||||
icon_state = "peppermillsmall"
|
||||
center_of_mass = list("x"=16, "y"=10)
|
||||
if("cornoil")
|
||||
name = "Corn Oil"
|
||||
desc = "A delicious oil used in cooking. Made from corn."
|
||||
icon_state = "oliveoil"
|
||||
center_of_mass = list("x"=16, "y"=6)
|
||||
if("sugar")
|
||||
name = "Sugar"
|
||||
desc = "Tastey space sugar!"
|
||||
center_of_mass = list("x"=16, "y"=6)
|
||||
else
|
||||
name = "Misc Condiment Bottle"
|
||||
if (reagents.reagent_list.len==1)
|
||||
desc = "Looks like it is [reagents.get_master_reagent_name()], but you are not sure."
|
||||
else
|
||||
desc = "A mixture of various condiments. [reagents.get_master_reagent_name()] is one of them."
|
||||
icon_state = "mixedcondiments"
|
||||
center_of_mass = list("x"=16, "y"=6)
|
||||
else
|
||||
icon_state = "emptycondiment"
|
||||
name = "Condiment Bottle"
|
||||
desc = "An empty condiment bottle."
|
||||
center_of_mass = list("x"=16, "y"=6)
|
||||
return
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/condiment/enzyme
|
||||
name = "Universal Enzyme"
|
||||
desc = "Used in cooking various dishes."
|
||||
icon_state = "enzyme"
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/condiment/enzyme/New()
|
||||
..()
|
||||
reagents.add_reagent("enzyme", 50)
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/condiment/sugar/New()
|
||||
..()
|
||||
reagents.add_reagent("sugar", 50)
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/condiment/small
|
||||
possible_transfer_amounts = list(1,20)
|
||||
amount_per_transfer_from_this = 1
|
||||
volume = 20
|
||||
center_of_mass = list()
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/condiment/small/on_reagent_change()
|
||||
return
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/condiment/small/saltshaker //Seperate from above since it's a small shaker rather then
|
||||
name = "salt shaker" // a large one.
|
||||
desc = "Salt. From space oceans, presumably."
|
||||
icon_state = "saltshakersmall"
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/condiment/small/saltshaker/New()
|
||||
..()
|
||||
reagents.add_reagent("sodiumchloride", 20)
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/condiment/small/peppermill
|
||||
name = "pepper mill"
|
||||
desc = "Often used to flavor food or make people sneeze."
|
||||
icon_state = "peppermillsmall"
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/condiment/small/peppermill/New()
|
||||
..()
|
||||
reagents.add_reagent("blackpepper", 20)
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/condiment/small/sugar
|
||||
name = "sugar"
|
||||
desc = "Sweetness in a bottle"
|
||||
icon_state = "sugarsmall"
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/condiment/small/sugar/New()
|
||||
..()
|
||||
reagents.add_reagent("sugar", 20)
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/condiment/flour
|
||||
name = "flour sack"
|
||||
desc = "A big bag of flour. Good for baking!"
|
||||
icon = 'icons/obj/food.dmi'
|
||||
icon_state = "flour"
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/condiment/flour/on_reagent_change()
|
||||
return
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/condiment/flour/New()
|
||||
..()
|
||||
reagents.add_reagent("flour", 30)
|
||||
src.pixel_x = rand(-10.0, 10)
|
||||
src.pixel_y = rand(-10.0, 10)
|
||||
|
||||
///////////////////////////////////////////////Condiments
|
||||
//Notes by Darem: The condiments food-subtype is for stuff you don't actually eat but you use to modify existing food. They all
|
||||
// leave empty containers when used up and can be filled/re-filled with other items. Formatting for first section is identical
|
||||
// to mixed-drinks code. If you want an object that starts pre-loaded, you need to make it in addition to the other code.
|
||||
|
||||
//Food items that aren't eaten normally and leave an empty container behind.
|
||||
/obj/item/weapon/reagent_containers/food/condiment
|
||||
name = "Condiment Container"
|
||||
desc = "Just your average condiment container."
|
||||
icon = 'icons/obj/food.dmi'
|
||||
icon_state = "emptycondiment"
|
||||
flags = OPENCONTAINER
|
||||
possible_transfer_amounts = list(1,5,10)
|
||||
center_of_mass = list("x"=16, "y"=6)
|
||||
volume = 50
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/condiment/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
|
||||
return
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/condiment/attack_self(var/mob/user as mob)
|
||||
return
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/condiment/attack(var/mob/M as mob, var/mob/user as mob, var/def_zone)
|
||||
if(standard_feed_mob(user, M))
|
||||
return
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/condiment/afterattack(var/obj/target, var/mob/user, var/flag)
|
||||
if(standard_dispenser_refill(user, target))
|
||||
return
|
||||
if(standard_pour_into(user, target))
|
||||
return
|
||||
|
||||
if(istype(target, /obj/item/weapon/reagent_containers/food/snacks)) // These are not opencontainers but we can transfer to them
|
||||
if(!reagents || !reagents.total_volume)
|
||||
user << "<span class='notice'>There is no condiment left in \the [src].</span>"
|
||||
return
|
||||
|
||||
if(!target.reagents.get_free_space())
|
||||
user << "<span class='notice'>You can't add more condiment to \the [target].</span>"
|
||||
return
|
||||
|
||||
var/trans = reagents.trans_to_obj(target, amount_per_transfer_from_this)
|
||||
user << "<span class='notice'>You add [trans] units of the condiment to \the [target].</span>"
|
||||
else
|
||||
..()
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/condiment/feed_sound(var/mob/user)
|
||||
playsound(user.loc, 'sound/items/drink.ogg', rand(10, 50), 1)
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/condiment/self_feed_message(var/mob/user)
|
||||
user << "<span class='notice'>You swallow some of contents of \the [src].</span>"
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/condiment/on_reagent_change()
|
||||
if(reagents.reagent_list.len > 0)
|
||||
switch(reagents.get_master_reagent_id())
|
||||
if("ketchup")
|
||||
name = "Ketchup"
|
||||
desc = "You feel more American already."
|
||||
icon_state = "ketchup"
|
||||
center_of_mass = list("x"=16, "y"=6)
|
||||
if("capsaicin")
|
||||
name = "Hotsauce"
|
||||
desc = "You can almost TASTE the stomach ulcers now!"
|
||||
icon_state = "hotsauce"
|
||||
center_of_mass = list("x"=16, "y"=6)
|
||||
if("enzyme")
|
||||
name = "Universal Enzyme"
|
||||
desc = "Used in cooking various dishes."
|
||||
icon_state = "enzyme"
|
||||
center_of_mass = list("x"=16, "y"=6)
|
||||
if("soysauce")
|
||||
name = "Soy Sauce"
|
||||
desc = "A salty soy-based flavoring."
|
||||
icon_state = "soysauce"
|
||||
center_of_mass = list("x"=16, "y"=6)
|
||||
if("frostoil")
|
||||
name = "Coldsauce"
|
||||
desc = "Leaves the tongue numb in its passage."
|
||||
icon_state = "coldsauce"
|
||||
center_of_mass = list("x"=16, "y"=6)
|
||||
if("sodiumchloride")
|
||||
name = "Salt Shaker"
|
||||
desc = "Salt. From space oceans, presumably."
|
||||
icon_state = "saltshaker"
|
||||
center_of_mass = list("x"=16, "y"=10)
|
||||
if("blackpepper")
|
||||
name = "Pepper Mill"
|
||||
desc = "Often used to flavor food or make people sneeze."
|
||||
icon_state = "peppermillsmall"
|
||||
center_of_mass = list("x"=16, "y"=10)
|
||||
if("cornoil")
|
||||
name = "Corn Oil"
|
||||
desc = "A delicious oil used in cooking. Made from corn."
|
||||
icon_state = "oliveoil"
|
||||
center_of_mass = list("x"=16, "y"=6)
|
||||
if("sugar")
|
||||
name = "Sugar"
|
||||
desc = "Tastey space sugar!"
|
||||
center_of_mass = list("x"=16, "y"=6)
|
||||
else
|
||||
name = "Misc Condiment Bottle"
|
||||
if (reagents.reagent_list.len==1)
|
||||
desc = "Looks like it is [reagents.get_master_reagent_name()], but you are not sure."
|
||||
else
|
||||
desc = "A mixture of various condiments. [reagents.get_master_reagent_name()] is one of them."
|
||||
icon_state = "mixedcondiments"
|
||||
center_of_mass = list("x"=16, "y"=6)
|
||||
else
|
||||
icon_state = "emptycondiment"
|
||||
name = "Condiment Bottle"
|
||||
desc = "An empty condiment bottle."
|
||||
center_of_mass = list("x"=16, "y"=6)
|
||||
return
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/condiment/enzyme
|
||||
name = "Universal Enzyme"
|
||||
desc = "Used in cooking various dishes."
|
||||
icon_state = "enzyme"
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/condiment/enzyme/New()
|
||||
..()
|
||||
reagents.add_reagent("enzyme", 50)
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/condiment/sugar/New()
|
||||
..()
|
||||
reagents.add_reagent("sugar", 50)
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/condiment/small
|
||||
possible_transfer_amounts = list(1,20)
|
||||
amount_per_transfer_from_this = 1
|
||||
volume = 20
|
||||
center_of_mass = list()
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/condiment/small/on_reagent_change()
|
||||
return
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/condiment/small/saltshaker //Seperate from above since it's a small shaker rather then
|
||||
name = "salt shaker" // a large one.
|
||||
desc = "Salt. From space oceans, presumably."
|
||||
icon_state = "saltshakersmall"
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/condiment/small/saltshaker/New()
|
||||
..()
|
||||
reagents.add_reagent("sodiumchloride", 20)
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/condiment/small/peppermill
|
||||
name = "pepper mill"
|
||||
desc = "Often used to flavor food or make people sneeze."
|
||||
icon_state = "peppermillsmall"
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/condiment/small/peppermill/New()
|
||||
..()
|
||||
reagents.add_reagent("blackpepper", 20)
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/condiment/small/sugar
|
||||
name = "sugar"
|
||||
desc = "Sweetness in a bottle"
|
||||
icon_state = "sugarsmall"
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/condiment/small/sugar/New()
|
||||
..()
|
||||
reagents.add_reagent("sugar", 20)
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/condiment/flour
|
||||
name = "flour sack"
|
||||
desc = "A big bag of flour. Good for baking!"
|
||||
icon = 'icons/obj/food.dmi'
|
||||
icon_state = "flour"
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/condiment/flour/on_reagent_change()
|
||||
return
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/condiment/flour/New()
|
||||
..()
|
||||
reagents.add_reagent("flour", 30)
|
||||
src.pixel_x = rand(-10.0, 10)
|
||||
src.pixel_y = rand(-10.0, 10)
|
||||
@@ -1,313 +1,313 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Drinks.
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/obj/item/weapon/reagent_containers/food/drinks
|
||||
name = "drink"
|
||||
desc = "yummy"
|
||||
icon = 'icons/obj/drinks.dmi'
|
||||
icon_state = null
|
||||
flags = OPENCONTAINER
|
||||
amount_per_transfer_from_this = 5
|
||||
volume = 50
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/drinks/on_reagent_change()
|
||||
if (reagents.reagent_list.len > 0)
|
||||
var/datum/reagent/R = reagents.get_master_reagent()
|
||||
if(R.price_tag)
|
||||
price_tag = R.price_tag
|
||||
else
|
||||
price_tag = null
|
||||
return
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/drinks/attack_self(mob/user as mob)
|
||||
if(!is_open_container())
|
||||
open(user)
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/drinks/proc/open(mob/user)
|
||||
playsound(loc,"canopen", rand(10,50), 1)
|
||||
user << "<span class='notice'>You open [src] with an audible pop!</span>"
|
||||
flags |= OPENCONTAINER
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/drinks/attack(mob/M as mob, mob/user as mob, def_zone)
|
||||
if(force && !(flags & NOBLUDGEON) && user.a_intent == I_HURT)
|
||||
return ..()
|
||||
|
||||
if(standard_feed_mob(user, M))
|
||||
return
|
||||
|
||||
return 0
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/drinks/afterattack(obj/target, mob/user, proximity)
|
||||
if(!proximity) return
|
||||
|
||||
if(standard_dispenser_refill(user, target))
|
||||
return
|
||||
if(standard_pour_into(user, target))
|
||||
return
|
||||
return ..()
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/drinks/standard_feed_mob(var/mob/user, var/mob/target)
|
||||
if(!is_open_container())
|
||||
user << "<span class='notice'>You need to open [src]!</span>"
|
||||
return 1
|
||||
return ..()
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/drinks/standard_dispenser_refill(var/mob/user, var/obj/structure/reagent_dispensers/target)
|
||||
if(!is_open_container())
|
||||
user << "<span class='notice'>You need to open [src]!</span>"
|
||||
return 1
|
||||
return ..()
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/drinks/standard_pour_into(var/mob/user, var/atom/target)
|
||||
if(!is_open_container())
|
||||
user << "<span class='notice'>You need to open [src]!</span>"
|
||||
return 1
|
||||
return ..()
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/drinks/self_feed_message(var/mob/user)
|
||||
user << "<span class='notice'>You swallow a gulp from \the [src].</span>"
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/drinks/feed_sound(var/mob/user)
|
||||
playsound(user.loc, 'sound/items/drink.ogg', rand(10, 50), 1)
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/drinks/examine(mob/user)
|
||||
if(!..(user, 1))
|
||||
return
|
||||
if(!reagents || reagents.total_volume == 0)
|
||||
user << "<span class='notice'>\The [src] is empty!</span>"
|
||||
else if (reagents.total_volume <= volume * 0.25)
|
||||
user << "<span class='notice'>\The [src] is almost empty!</span>"
|
||||
else if (reagents.total_volume <= volume * 0.66)
|
||||
user << "<span class='notice'>\The [src] is half full!</span>"
|
||||
else if (reagents.total_volume <= volume * 0.90)
|
||||
user << "<span class='notice'>\The [src] is almost full!</span>"
|
||||
else
|
||||
user << "<span class='notice'>\The [src] is full!</span>"
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Drinks. END
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/drinks/golden_cup
|
||||
desc = "A golden cup"
|
||||
name = "golden cup"
|
||||
icon_state = "golden_cup"
|
||||
item_state = "" //nope :(
|
||||
w_class = ITEMSIZE_LARGE
|
||||
force = 14
|
||||
throwforce = 10
|
||||
amount_per_transfer_from_this = 20
|
||||
possible_transfer_amounts = null
|
||||
volume = 150
|
||||
flags = CONDUCT | OPENCONTAINER
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/drinks/golden_cup/on_reagent_change()
|
||||
..()
|
||||
|
||||
///////////////////////////////////////////////Drinks
|
||||
//Notes by Darem: Drinks are simply containers that start preloaded. Unlike condiments, the contents can be ingested directly
|
||||
// rather then having to add it to something else first. They should only contain liquids. They have a default container size of 50.
|
||||
// Formatting is the same as food.
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/drinks/milk
|
||||
name = "milk carton"
|
||||
desc = "It's milk. White and nutritious goodness!"
|
||||
icon_state = "milk"
|
||||
item_state = "carton"
|
||||
center_of_mass = list("x"=16, "y"=9)
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/drinks/milk/New()
|
||||
..()
|
||||
reagents.add_reagent("milk", 50)
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/drinks/soymilk
|
||||
name = "soymilk carton"
|
||||
desc = "It's soy milk. White and nutritious goodness!"
|
||||
icon_state = "soymilk"
|
||||
item_state = "carton"
|
||||
center_of_mass = list("x"=16, "y"=9)
|
||||
/obj/item/weapon/reagent_containers/food/drinks/soymilk/New()
|
||||
..()
|
||||
reagents.add_reagent("soymilk", 50)
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/drinks/smallmilk
|
||||
name = "small milk carton"
|
||||
desc = "It's milk. White and nutritious goodness!"
|
||||
volume = 30
|
||||
icon_state = "mini-milk"
|
||||
item_state = "carton"
|
||||
center_of_mass = list("x"=16, "y"=9)
|
||||
/obj/item/weapon/reagent_containers/food/drinks/smallmilk/New()
|
||||
..()
|
||||
reagents.add_reagent("milk", 30)
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/drinks/smallchocmilk
|
||||
name = "small chocolate milk carton"
|
||||
desc = "It's milk! This one is in delicious chocolate flavour."
|
||||
volume = 30
|
||||
icon_state = "mini-milk_choco"
|
||||
item_state = "carton"
|
||||
center_of_mass = list("x"=16, "y"=9)
|
||||
/obj/item/weapon/reagent_containers/food/drinks/smallchocmilk/New()
|
||||
..()
|
||||
reagents.add_reagent("chocolate_milk", 30)
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/drinks/coffee
|
||||
name = "\improper Robust Coffee"
|
||||
desc = "Careful, the beverage you're about to enjoy is extremely hot."
|
||||
icon_state = "coffee"
|
||||
center_of_mass = list("x"=15, "y"=10)
|
||||
/obj/item/weapon/reagent_containers/food/drinks/coffee/New()
|
||||
..()
|
||||
reagents.add_reagent("coffee", 30)
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/drinks/tea
|
||||
name = "cup of Duke Purple Tea"
|
||||
desc = "An insult to Duke Purple is an insult to the Space Queen! Any proper gentleman will fight you, if you sully this tea."
|
||||
icon_state = "teacup"
|
||||
item_state = "coffee"
|
||||
center_of_mass = list("x"=16, "y"=14)
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/drinks/tea/New()
|
||||
..()
|
||||
reagents.add_reagent("tea", 30)
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/drinks/ice
|
||||
name = "cup of ice"
|
||||
desc = "Careful, cold ice, do not chew."
|
||||
icon_state = "coffee"
|
||||
center_of_mass = list("x"=15, "y"=10)
|
||||
/obj/item/weapon/reagent_containers/food/drinks/ice/New()
|
||||
..()
|
||||
reagents.add_reagent("ice", 30)
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/drinks/h_chocolate
|
||||
name = "cup of Dutch hot coco"
|
||||
desc = "Made in Space South America."
|
||||
icon_state = "hot_coco"
|
||||
item_state = "coffee"
|
||||
center_of_mass = list("x"=15, "y"=13)
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/drinks/h_chocolate/New()
|
||||
..()
|
||||
reagents.add_reagent("hot_coco", 30)
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/drinks/dry_ramen
|
||||
name = "Cup Ramen"
|
||||
desc = "Just add 10ml water, self heats! A taste that reminds you of your school years."
|
||||
icon_state = "ramen"
|
||||
center_of_mass = list("x"=16, "y"=11)
|
||||
/obj/item/weapon/reagent_containers/food/drinks/dry_ramen/New()
|
||||
..()
|
||||
reagents.add_reagent("dry_ramen", 30)
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/drinks/sillycup
|
||||
name = "paper cup"
|
||||
desc = "A paper water cup."
|
||||
icon_state = "water_cup_e"
|
||||
possible_transfer_amounts = null
|
||||
volume = 10
|
||||
center_of_mass = list("x"=16, "y"=12)
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/drinks/sillycup/New()
|
||||
..()
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/drinks/sillycup/on_reagent_change()
|
||||
..()
|
||||
if(reagents.total_volume)
|
||||
icon_state = "water_cup"
|
||||
else
|
||||
icon_state = "water_cup_e"
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/drinks/sillycup/MouseDrop(obj/over_object as obj)
|
||||
if(!reagents.total_volume && istype(over_object, /obj/structure/reagent_dispensers/water_cooler))
|
||||
if(over_object.Adjacent(usr))
|
||||
var/obj/structure/reagent_dispensers/water_cooler/W = over_object
|
||||
if(W.cupholder && W.cups < 10)
|
||||
W.cups++
|
||||
usr << "<span class='notice'>You put the [src] in the cup dispenser.</span>"
|
||||
qdel(src)
|
||||
W.update_icon()
|
||||
else
|
||||
return ..()
|
||||
|
||||
//////////////////////////drinkingglass and shaker//
|
||||
//Note by Darem: This code handles the mixing of drinks. New drinks go in three places: In Chemistry-Reagents.dm (for the drink
|
||||
// itself), in Chemistry-Recipes.dm (for the reaction that changes the components into the drink), and here (for the drinking glass
|
||||
// icon states.
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/drinks/shaker
|
||||
name = "shaker"
|
||||
desc = "A metal shaker to mix drinks in."
|
||||
icon_state = "shaker"
|
||||
amount_per_transfer_from_this = 10
|
||||
volume = 120
|
||||
center_of_mass = list("x"=17, "y"=10)
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/drinks/shaker/on_reagent_change()
|
||||
..()
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/drinks/teapot
|
||||
name = "teapot"
|
||||
desc = "An elegant teapot. It simply oozes class."
|
||||
icon_state = "teapot"
|
||||
item_state = "teapot"
|
||||
amount_per_transfer_from_this = 10
|
||||
volume = 120
|
||||
center_of_mass = list("x"=17, "y"=7)
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/drinks/teapot/on_reagent_change()
|
||||
..()
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/drinks/flask
|
||||
name = "\improper Colony Director's flask"
|
||||
desc = "A metal flask belonging to the Colony Director"
|
||||
icon_state = "flask"
|
||||
volume = 60
|
||||
center_of_mass = list("x"=17, "y"=7)
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/drinks/flask/on_reagent_change()
|
||||
..()
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/drinks/flask/shiny
|
||||
name = "shiny flask"
|
||||
desc = "A shiny metal flask. It appears to have a Greek symbol inscribed on it."
|
||||
icon_state = "shinyflask"
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/drinks/flask/lithium
|
||||
name = "lithium flask"
|
||||
desc = "A flask with a Lithium Atom symbol on it."
|
||||
icon_state = "lithiumflask"
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/drinks/flask/detflask
|
||||
name = "\improper Detective's flask"
|
||||
desc = "A metal flask with a leather band and golden badge belonging to the detective."
|
||||
icon_state = "detflask"
|
||||
volume = 60
|
||||
center_of_mass = list("x"=17, "y"=8)
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/drinks/flask/barflask
|
||||
name = "flask"
|
||||
desc = "For those who can't be bothered to hang out at the bar to drink."
|
||||
icon_state = "barflask"
|
||||
volume = 60
|
||||
center_of_mass = list("x"=17, "y"=7)
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/drinks/flask/vacuumflask
|
||||
name = "vacuum flask"
|
||||
desc = "Keeping your drinks at the perfect temperature since 1892."
|
||||
icon_state = "vacuumflask"
|
||||
volume = 60
|
||||
center_of_mass = list("x"=15, "y"=4)
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/drinks/britcup
|
||||
name = "cup"
|
||||
desc = "A cup with the British flag emblazoned on it."
|
||||
icon_state = "britcup"
|
||||
volume = 30
|
||||
center_of_mass = list("x"=15, "y"=13)
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/drinks/britcup/on_reagent_change()
|
||||
..()
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Drinks.
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/obj/item/weapon/reagent_containers/food/drinks
|
||||
name = "drink"
|
||||
desc = "yummy"
|
||||
icon = 'icons/obj/drinks.dmi'
|
||||
icon_state = null
|
||||
flags = OPENCONTAINER
|
||||
amount_per_transfer_from_this = 5
|
||||
volume = 50
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/drinks/on_reagent_change()
|
||||
if (reagents.reagent_list.len > 0)
|
||||
var/datum/reagent/R = reagents.get_master_reagent()
|
||||
if(R.price_tag)
|
||||
price_tag = R.price_tag
|
||||
else
|
||||
price_tag = null
|
||||
return
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/drinks/attack_self(mob/user as mob)
|
||||
if(!is_open_container())
|
||||
open(user)
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/drinks/proc/open(mob/user)
|
||||
playsound(loc,"canopen", rand(10,50), 1)
|
||||
user << "<span class='notice'>You open [src] with an audible pop!</span>"
|
||||
flags |= OPENCONTAINER
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/drinks/attack(mob/M as mob, mob/user as mob, def_zone)
|
||||
if(force && !(flags & NOBLUDGEON) && user.a_intent == I_HURT)
|
||||
return ..()
|
||||
|
||||
if(standard_feed_mob(user, M))
|
||||
return
|
||||
|
||||
return 0
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/drinks/afterattack(obj/target, mob/user, proximity)
|
||||
if(!proximity) return
|
||||
|
||||
if(standard_dispenser_refill(user, target))
|
||||
return
|
||||
if(standard_pour_into(user, target))
|
||||
return
|
||||
return ..()
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/drinks/standard_feed_mob(var/mob/user, var/mob/target)
|
||||
if(!is_open_container())
|
||||
user << "<span class='notice'>You need to open [src]!</span>"
|
||||
return 1
|
||||
return ..()
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/drinks/standard_dispenser_refill(var/mob/user, var/obj/structure/reagent_dispensers/target)
|
||||
if(!is_open_container())
|
||||
user << "<span class='notice'>You need to open [src]!</span>"
|
||||
return 1
|
||||
return ..()
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/drinks/standard_pour_into(var/mob/user, var/atom/target)
|
||||
if(!is_open_container())
|
||||
user << "<span class='notice'>You need to open [src]!</span>"
|
||||
return 1
|
||||
return ..()
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/drinks/self_feed_message(var/mob/user)
|
||||
user << "<span class='notice'>You swallow a gulp from \the [src].</span>"
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/drinks/feed_sound(var/mob/user)
|
||||
playsound(user.loc, 'sound/items/drink.ogg', rand(10, 50), 1)
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/drinks/examine(mob/user)
|
||||
if(!..(user, 1))
|
||||
return
|
||||
if(!reagents || reagents.total_volume == 0)
|
||||
user << "<span class='notice'>\The [src] is empty!</span>"
|
||||
else if (reagents.total_volume <= volume * 0.25)
|
||||
user << "<span class='notice'>\The [src] is almost empty!</span>"
|
||||
else if (reagents.total_volume <= volume * 0.66)
|
||||
user << "<span class='notice'>\The [src] is half full!</span>"
|
||||
else if (reagents.total_volume <= volume * 0.90)
|
||||
user << "<span class='notice'>\The [src] is almost full!</span>"
|
||||
else
|
||||
user << "<span class='notice'>\The [src] is full!</span>"
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Drinks. END
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/drinks/golden_cup
|
||||
desc = "A golden cup"
|
||||
name = "golden cup"
|
||||
icon_state = "golden_cup"
|
||||
item_state = "" //nope :(
|
||||
w_class = ITEMSIZE_LARGE
|
||||
force = 14
|
||||
throwforce = 10
|
||||
amount_per_transfer_from_this = 20
|
||||
possible_transfer_amounts = null
|
||||
volume = 150
|
||||
flags = CONDUCT | OPENCONTAINER
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/drinks/golden_cup/on_reagent_change()
|
||||
..()
|
||||
|
||||
///////////////////////////////////////////////Drinks
|
||||
//Notes by Darem: Drinks are simply containers that start preloaded. Unlike condiments, the contents can be ingested directly
|
||||
// rather then having to add it to something else first. They should only contain liquids. They have a default container size of 50.
|
||||
// Formatting is the same as food.
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/drinks/milk
|
||||
name = "milk carton"
|
||||
desc = "It's milk. White and nutritious goodness!"
|
||||
icon_state = "milk"
|
||||
item_state = "carton"
|
||||
center_of_mass = list("x"=16, "y"=9)
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/drinks/milk/New()
|
||||
..()
|
||||
reagents.add_reagent("milk", 50)
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/drinks/soymilk
|
||||
name = "soymilk carton"
|
||||
desc = "It's soy milk. White and nutritious goodness!"
|
||||
icon_state = "soymilk"
|
||||
item_state = "carton"
|
||||
center_of_mass = list("x"=16, "y"=9)
|
||||
/obj/item/weapon/reagent_containers/food/drinks/soymilk/New()
|
||||
..()
|
||||
reagents.add_reagent("soymilk", 50)
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/drinks/smallmilk
|
||||
name = "small milk carton"
|
||||
desc = "It's milk. White and nutritious goodness!"
|
||||
volume = 30
|
||||
icon_state = "mini-milk"
|
||||
item_state = "carton"
|
||||
center_of_mass = list("x"=16, "y"=9)
|
||||
/obj/item/weapon/reagent_containers/food/drinks/smallmilk/New()
|
||||
..()
|
||||
reagents.add_reagent("milk", 30)
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/drinks/smallchocmilk
|
||||
name = "small chocolate milk carton"
|
||||
desc = "It's milk! This one is in delicious chocolate flavour."
|
||||
volume = 30
|
||||
icon_state = "mini-milk_choco"
|
||||
item_state = "carton"
|
||||
center_of_mass = list("x"=16, "y"=9)
|
||||
/obj/item/weapon/reagent_containers/food/drinks/smallchocmilk/New()
|
||||
..()
|
||||
reagents.add_reagent("chocolate_milk", 30)
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/drinks/coffee
|
||||
name = "\improper Robust Coffee"
|
||||
desc = "Careful, the beverage you're about to enjoy is extremely hot."
|
||||
icon_state = "coffee"
|
||||
center_of_mass = list("x"=15, "y"=10)
|
||||
/obj/item/weapon/reagent_containers/food/drinks/coffee/New()
|
||||
..()
|
||||
reagents.add_reagent("coffee", 30)
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/drinks/tea
|
||||
name = "cup of Duke Purple Tea"
|
||||
desc = "An insult to Duke Purple is an insult to the Space Queen! Any proper gentleman will fight you, if you sully this tea."
|
||||
icon_state = "teacup"
|
||||
item_state = "coffee"
|
||||
center_of_mass = list("x"=16, "y"=14)
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/drinks/tea/New()
|
||||
..()
|
||||
reagents.add_reagent("tea", 30)
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/drinks/ice
|
||||
name = "cup of ice"
|
||||
desc = "Careful, cold ice, do not chew."
|
||||
icon_state = "coffee"
|
||||
center_of_mass = list("x"=15, "y"=10)
|
||||
/obj/item/weapon/reagent_containers/food/drinks/ice/New()
|
||||
..()
|
||||
reagents.add_reagent("ice", 30)
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/drinks/h_chocolate
|
||||
name = "cup of Dutch hot coco"
|
||||
desc = "Made in Space South America."
|
||||
icon_state = "hot_coco"
|
||||
item_state = "coffee"
|
||||
center_of_mass = list("x"=15, "y"=13)
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/drinks/h_chocolate/New()
|
||||
..()
|
||||
reagents.add_reagent("hot_coco", 30)
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/drinks/dry_ramen
|
||||
name = "Cup Ramen"
|
||||
desc = "Just add 10ml water, self heats! A taste that reminds you of your school years."
|
||||
icon_state = "ramen"
|
||||
center_of_mass = list("x"=16, "y"=11)
|
||||
/obj/item/weapon/reagent_containers/food/drinks/dry_ramen/New()
|
||||
..()
|
||||
reagents.add_reagent("dry_ramen", 30)
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/drinks/sillycup
|
||||
name = "paper cup"
|
||||
desc = "A paper water cup."
|
||||
icon_state = "water_cup_e"
|
||||
possible_transfer_amounts = null
|
||||
volume = 10
|
||||
center_of_mass = list("x"=16, "y"=12)
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/drinks/sillycup/New()
|
||||
..()
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/drinks/sillycup/on_reagent_change()
|
||||
..()
|
||||
if(reagents.total_volume)
|
||||
icon_state = "water_cup"
|
||||
else
|
||||
icon_state = "water_cup_e"
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/drinks/sillycup/MouseDrop(obj/over_object as obj)
|
||||
if(!reagents.total_volume && istype(over_object, /obj/structure/reagent_dispensers/water_cooler))
|
||||
if(over_object.Adjacent(usr))
|
||||
var/obj/structure/reagent_dispensers/water_cooler/W = over_object
|
||||
if(W.cupholder && W.cups < 10)
|
||||
W.cups++
|
||||
usr << "<span class='notice'>You put the [src] in the cup dispenser.</span>"
|
||||
qdel(src)
|
||||
W.update_icon()
|
||||
else
|
||||
return ..()
|
||||
|
||||
//////////////////////////drinkingglass and shaker//
|
||||
//Note by Darem: This code handles the mixing of drinks. New drinks go in three places: In Chemistry-Reagents.dm (for the drink
|
||||
// itself), in Chemistry-Recipes.dm (for the reaction that changes the components into the drink), and here (for the drinking glass
|
||||
// icon states.
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/drinks/shaker
|
||||
name = "shaker"
|
||||
desc = "A metal shaker to mix drinks in."
|
||||
icon_state = "shaker"
|
||||
amount_per_transfer_from_this = 10
|
||||
volume = 120
|
||||
center_of_mass = list("x"=17, "y"=10)
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/drinks/shaker/on_reagent_change()
|
||||
..()
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/drinks/teapot
|
||||
name = "teapot"
|
||||
desc = "An elegant teapot. It simply oozes class."
|
||||
icon_state = "teapot"
|
||||
item_state = "teapot"
|
||||
amount_per_transfer_from_this = 10
|
||||
volume = 120
|
||||
center_of_mass = list("x"=17, "y"=7)
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/drinks/teapot/on_reagent_change()
|
||||
..()
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/drinks/flask
|
||||
name = "\improper Colony Director's flask"
|
||||
desc = "A metal flask belonging to the Colony Director"
|
||||
icon_state = "flask"
|
||||
volume = 60
|
||||
center_of_mass = list("x"=17, "y"=7)
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/drinks/flask/on_reagent_change()
|
||||
..()
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/drinks/flask/shiny
|
||||
name = "shiny flask"
|
||||
desc = "A shiny metal flask. It appears to have a Greek symbol inscribed on it."
|
||||
icon_state = "shinyflask"
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/drinks/flask/lithium
|
||||
name = "lithium flask"
|
||||
desc = "A flask with a Lithium Atom symbol on it."
|
||||
icon_state = "lithiumflask"
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/drinks/flask/detflask
|
||||
name = "\improper Detective's flask"
|
||||
desc = "A metal flask with a leather band and golden badge belonging to the detective."
|
||||
icon_state = "detflask"
|
||||
volume = 60
|
||||
center_of_mass = list("x"=17, "y"=8)
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/drinks/flask/barflask
|
||||
name = "flask"
|
||||
desc = "For those who can't be bothered to hang out at the bar to drink."
|
||||
icon_state = "barflask"
|
||||
volume = 60
|
||||
center_of_mass = list("x"=17, "y"=7)
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/drinks/flask/vacuumflask
|
||||
name = "vacuum flask"
|
||||
desc = "Keeping your drinks at the perfect temperature since 1892."
|
||||
icon_state = "vacuumflask"
|
||||
volume = 60
|
||||
center_of_mass = list("x"=15, "y"=4)
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/drinks/britcup
|
||||
name = "cup"
|
||||
desc = "A cup with the British flag emblazoned on it."
|
||||
icon_state = "britcup"
|
||||
volume = 30
|
||||
center_of_mass = list("x"=15, "y"=13)
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/drinks/britcup/on_reagent_change()
|
||||
..()
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,178 +1,178 @@
|
||||
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/drinks/drinkingglass
|
||||
name = "glass"
|
||||
desc = "Your standard drinking glass."
|
||||
icon_state = "glass_empty"
|
||||
amount_per_transfer_from_this = 5
|
||||
volume = 30
|
||||
unacidable = 1 //glass
|
||||
center_of_mass = list("x"=16, "y"=10)
|
||||
matter = list("glass" = 500)
|
||||
|
||||
on_reagent_change()
|
||||
/*if(reagents.reagent_list.len > 1 )
|
||||
icon_state = "glass_brown"
|
||||
name = "Glass of Hooch"
|
||||
desc = "Two or more drinks, mixed together."*/
|
||||
/*else if(reagents.reagent_list.len == 1)
|
||||
for(var/datum/reagent/R in reagents.reagent_list)
|
||||
switch(R.id)*/
|
||||
if (reagents.reagent_list.len > 0)
|
||||
var/datum/reagent/R = reagents.get_master_reagent()
|
||||
|
||||
if(R.glass_icon_state)
|
||||
icon_state = R.glass_icon_state
|
||||
else
|
||||
icon_state = "glass_brown"
|
||||
|
||||
if(R.glass_name)
|
||||
name = R.glass_name
|
||||
else
|
||||
name = "Glass of.. what?"
|
||||
|
||||
if(R.glass_desc)
|
||||
desc = R.glass_desc
|
||||
else
|
||||
desc = "You can't really tell what this is."
|
||||
|
||||
if(R.glass_center_of_mass)
|
||||
center_of_mass = R.glass_center_of_mass
|
||||
else
|
||||
center_of_mass = list("x"=16, "y"=10)
|
||||
|
||||
if(R.price_tag)
|
||||
price_tag = R.price_tag
|
||||
else
|
||||
price_tag = null
|
||||
else
|
||||
icon_state = "glass_empty"
|
||||
name = "glass"
|
||||
desc = "Your standard drinking glass."
|
||||
center_of_mass = list("x"=16, "y"=10)
|
||||
return
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/drinks/cup
|
||||
name = "coffee cup"
|
||||
desc = "The container of oriental luxuries."
|
||||
icon_state = "cup_empty"
|
||||
amount_per_transfer_from_this = 5
|
||||
volume = 30
|
||||
center_of_mass = list("x"=16, "y"=16)
|
||||
|
||||
on_reagent_change()
|
||||
if (reagents.reagent_list.len > 0)
|
||||
var/datum/reagent/R = reagents.get_master_reagent()
|
||||
|
||||
if(R.cup_icon_state)
|
||||
icon_state = R.cup_icon_state
|
||||
else
|
||||
icon_state = "cup_brown"
|
||||
|
||||
if(R.cup_name)
|
||||
name = R.cup_name
|
||||
else
|
||||
name = "Cup of.. what?"
|
||||
|
||||
if(R.cup_desc)
|
||||
desc = R.cup_desc
|
||||
else
|
||||
desc = "You can't really tell what this is."
|
||||
|
||||
if(R.cup_center_of_mass)
|
||||
center_of_mass = R.cup_center_of_mass
|
||||
else
|
||||
center_of_mass = list("x"=16, "y"=16)
|
||||
|
||||
if(R.price_tag)
|
||||
price_tag = R.price_tag
|
||||
else
|
||||
price_tag = null
|
||||
|
||||
else
|
||||
icon_state = "cup_empty"
|
||||
name = "coffee cup"
|
||||
desc = "The container of oriental luxuries."
|
||||
center_of_mass = list("x"=16, "y"=16)
|
||||
return
|
||||
|
||||
// for /obj/machinery/vending/sovietsoda
|
||||
/obj/item/weapon/reagent_containers/food/drinks/drinkingglass/soda
|
||||
New()
|
||||
..()
|
||||
reagents.add_reagent("sodawater", 50)
|
||||
on_reagent_change()
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/drinks/drinkingglass/cola
|
||||
New()
|
||||
..()
|
||||
reagents.add_reagent("cola", 50)
|
||||
on_reagent_change()
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/drinks/drinkingglass/shotglass
|
||||
name = "shot glass"
|
||||
desc = "No glasses were shot in the making of this glass."
|
||||
icon_state = "shotglass"
|
||||
amount_per_transfer_from_this = 10
|
||||
volume = 10
|
||||
matter = list("glass" = 175)
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/drinks/drinkingglass/shotglass/on_reagent_change()
|
||||
overlays.Cut()
|
||||
|
||||
if(reagents.total_volume)
|
||||
var/image/filling = image('icons/obj/reagentfillings.dmi', src, "[icon_state]1")
|
||||
|
||||
switch(reagents.total_volume)
|
||||
if(0 to 3) filling.icon_state = "[icon_state]1"
|
||||
if(4 to 7) filling.icon_state = "[icon_state]5"
|
||||
if(8 to INFINITY) filling.icon_state = "[icon_state]12"
|
||||
|
||||
filling.color += reagents.get_color()
|
||||
overlays += filling
|
||||
name = "shot glass of " + reagents.get_master_reagent_name() //No matter what, the glass will tell you the reagent's name. Might be too abusable in the future.
|
||||
else
|
||||
name = "shot glass"
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/drinks/drinkingglass/fitnessflask
|
||||
name = "fitness shaker"
|
||||
desc = "Big enough to contain enough protein to get perfectly swole. Don't mind the bits."
|
||||
icon_state = "fitness-cup_black"
|
||||
volume = 100
|
||||
matter = list("plastic" = 2000)
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/drinks/drinkingglass/fitnessflask/New()
|
||||
..()
|
||||
icon_state = pick("fitness-cup_black", "fitness-cup_red", "fitness-cup_black")
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/drinks/drinkingglass/fitnessflask/on_reagent_change()
|
||||
overlays.Cut()
|
||||
|
||||
if(reagents.total_volume)
|
||||
var/image/filling = image('icons/obj/reagentfillings.dmi', src, "fitness-cup10")
|
||||
|
||||
switch(reagents.total_volume)
|
||||
if(0 to 10) filling.icon_state = "fitness-cup10"
|
||||
if(11 to 20) filling.icon_state = "fitness-cup20"
|
||||
if(21 to 29) filling.icon_state = "fitness-cup30"
|
||||
if(30 to 39) filling.icon_state = "fitness-cup40"
|
||||
if(40 to 49) filling.icon_state = "fitness-cup50"
|
||||
if(50 to 59) filling.icon_state = "fitness-cup60"
|
||||
if(60 to 69) filling.icon_state = "fitness-cup70"
|
||||
if(70 to 79) filling.icon_state = "fitness-cup80"
|
||||
if(80 to 89) filling.icon_state = "fitness-cup90"
|
||||
if(90 to INFINITY) filling.icon_state = "fitness-cup100"
|
||||
|
||||
filling.color += reagents.get_color()
|
||||
overlays += filling
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/drinks/drinkingglass/fitnessflask/proteinshake
|
||||
name = "protein shake"
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/drinks/drinkingglass/fitnessflask/proteinshake/New()
|
||||
..()
|
||||
reagents.add_reagent("nutriment", 30)
|
||||
reagents.add_reagent("iron", 10)
|
||||
reagents.add_reagent("protein", 15)
|
||||
reagents.add_reagent("water", 45)
|
||||
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/drinks/drinkingglass
|
||||
name = "glass"
|
||||
desc = "Your standard drinking glass."
|
||||
icon_state = "glass_empty"
|
||||
amount_per_transfer_from_this = 5
|
||||
volume = 30
|
||||
unacidable = 1 //glass
|
||||
center_of_mass = list("x"=16, "y"=10)
|
||||
matter = list("glass" = 500)
|
||||
|
||||
on_reagent_change()
|
||||
/*if(reagents.reagent_list.len > 1 )
|
||||
icon_state = "glass_brown"
|
||||
name = "Glass of Hooch"
|
||||
desc = "Two or more drinks, mixed together."*/
|
||||
/*else if(reagents.reagent_list.len == 1)
|
||||
for(var/datum/reagent/R in reagents.reagent_list)
|
||||
switch(R.id)*/
|
||||
if (reagents.reagent_list.len > 0)
|
||||
var/datum/reagent/R = reagents.get_master_reagent()
|
||||
|
||||
if(R.glass_icon_state)
|
||||
icon_state = R.glass_icon_state
|
||||
else
|
||||
icon_state = "glass_brown"
|
||||
|
||||
if(R.glass_name)
|
||||
name = R.glass_name
|
||||
else
|
||||
name = "Glass of.. what?"
|
||||
|
||||
if(R.glass_desc)
|
||||
desc = R.glass_desc
|
||||
else
|
||||
desc = "You can't really tell what this is."
|
||||
|
||||
if(R.glass_center_of_mass)
|
||||
center_of_mass = R.glass_center_of_mass
|
||||
else
|
||||
center_of_mass = list("x"=16, "y"=10)
|
||||
|
||||
if(R.price_tag)
|
||||
price_tag = R.price_tag
|
||||
else
|
||||
price_tag = null
|
||||
else
|
||||
icon_state = "glass_empty"
|
||||
name = "glass"
|
||||
desc = "Your standard drinking glass."
|
||||
center_of_mass = list("x"=16, "y"=10)
|
||||
return
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/drinks/cup
|
||||
name = "coffee cup"
|
||||
desc = "The container of oriental luxuries."
|
||||
icon_state = "cup_empty"
|
||||
amount_per_transfer_from_this = 5
|
||||
volume = 30
|
||||
center_of_mass = list("x"=16, "y"=16)
|
||||
|
||||
on_reagent_change()
|
||||
if (reagents.reagent_list.len > 0)
|
||||
var/datum/reagent/R = reagents.get_master_reagent()
|
||||
|
||||
if(R.cup_icon_state)
|
||||
icon_state = R.cup_icon_state
|
||||
else
|
||||
icon_state = "cup_brown"
|
||||
|
||||
if(R.cup_name)
|
||||
name = R.cup_name
|
||||
else
|
||||
name = "Cup of.. what?"
|
||||
|
||||
if(R.cup_desc)
|
||||
desc = R.cup_desc
|
||||
else
|
||||
desc = "You can't really tell what this is."
|
||||
|
||||
if(R.cup_center_of_mass)
|
||||
center_of_mass = R.cup_center_of_mass
|
||||
else
|
||||
center_of_mass = list("x"=16, "y"=16)
|
||||
|
||||
if(R.price_tag)
|
||||
price_tag = R.price_tag
|
||||
else
|
||||
price_tag = null
|
||||
|
||||
else
|
||||
icon_state = "cup_empty"
|
||||
name = "coffee cup"
|
||||
desc = "The container of oriental luxuries."
|
||||
center_of_mass = list("x"=16, "y"=16)
|
||||
return
|
||||
|
||||
// for /obj/machinery/vending/sovietsoda
|
||||
/obj/item/weapon/reagent_containers/food/drinks/drinkingglass/soda
|
||||
New()
|
||||
..()
|
||||
reagents.add_reagent("sodawater", 50)
|
||||
on_reagent_change()
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/drinks/drinkingglass/cola
|
||||
New()
|
||||
..()
|
||||
reagents.add_reagent("cola", 50)
|
||||
on_reagent_change()
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/drinks/drinkingglass/shotglass
|
||||
name = "shot glass"
|
||||
desc = "No glasses were shot in the making of this glass."
|
||||
icon_state = "shotglass"
|
||||
amount_per_transfer_from_this = 10
|
||||
volume = 10
|
||||
matter = list("glass" = 175)
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/drinks/drinkingglass/shotglass/on_reagent_change()
|
||||
overlays.Cut()
|
||||
|
||||
if(reagents.total_volume)
|
||||
var/image/filling = image('icons/obj/reagentfillings.dmi', src, "[icon_state]1")
|
||||
|
||||
switch(reagents.total_volume)
|
||||
if(0 to 3) filling.icon_state = "[icon_state]1"
|
||||
if(4 to 7) filling.icon_state = "[icon_state]5"
|
||||
if(8 to INFINITY) filling.icon_state = "[icon_state]12"
|
||||
|
||||
filling.color += reagents.get_color()
|
||||
overlays += filling
|
||||
name = "shot glass of " + reagents.get_master_reagent_name() //No matter what, the glass will tell you the reagent's name. Might be too abusable in the future.
|
||||
else
|
||||
name = "shot glass"
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/drinks/drinkingglass/fitnessflask
|
||||
name = "fitness shaker"
|
||||
desc = "Big enough to contain enough protein to get perfectly swole. Don't mind the bits."
|
||||
icon_state = "fitness-cup_black"
|
||||
volume = 100
|
||||
matter = list("plastic" = 2000)
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/drinks/drinkingglass/fitnessflask/New()
|
||||
..()
|
||||
icon_state = pick("fitness-cup_black", "fitness-cup_red", "fitness-cup_black")
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/drinks/drinkingglass/fitnessflask/on_reagent_change()
|
||||
overlays.Cut()
|
||||
|
||||
if(reagents.total_volume)
|
||||
var/image/filling = image('icons/obj/reagentfillings.dmi', src, "fitness-cup10")
|
||||
|
||||
switch(reagents.total_volume)
|
||||
if(0 to 10) filling.icon_state = "fitness-cup10"
|
||||
if(11 to 20) filling.icon_state = "fitness-cup20"
|
||||
if(21 to 29) filling.icon_state = "fitness-cup30"
|
||||
if(30 to 39) filling.icon_state = "fitness-cup40"
|
||||
if(40 to 49) filling.icon_state = "fitness-cup50"
|
||||
if(50 to 59) filling.icon_state = "fitness-cup60"
|
||||
if(60 to 69) filling.icon_state = "fitness-cup70"
|
||||
if(70 to 79) filling.icon_state = "fitness-cup80"
|
||||
if(80 to 89) filling.icon_state = "fitness-cup90"
|
||||
if(90 to INFINITY) filling.icon_state = "fitness-cup100"
|
||||
|
||||
filling.color += reagents.get_color()
|
||||
overlays += filling
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/drinks/drinkingglass/fitnessflask/proteinshake
|
||||
name = "protein shake"
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/drinks/drinkingglass/fitnessflask/proteinshake/New()
|
||||
..()
|
||||
reagents.add_reagent("nutriment", 30)
|
||||
reagents.add_reagent("iron", 10)
|
||||
reagents.add_reagent("protein", 15)
|
||||
reagents.add_reagent("water", 45)
|
||||
on_reagent_change()
|
||||
@@ -1,25 +1,25 @@
|
||||
///jar
|
||||
/obj/item/weapon/reagent_containers/food/drinks/jar
|
||||
name = "empty jar"
|
||||
desc = "A jar. You're not sure what it's supposed to hold."
|
||||
icon_state = "jar"
|
||||
item_state = "beaker"
|
||||
center_of_mass = list("x"=15, "y"=8)
|
||||
unacidable = 1
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/drinks/jar/on_reagent_change()
|
||||
if (reagents.reagent_list.len > 0)
|
||||
switch(reagents.get_master_reagent_id())
|
||||
if("slime")
|
||||
icon_state = "jar_slime"
|
||||
name = "slime jam"
|
||||
desc = "A jar of slime jam. Delicious!"
|
||||
else
|
||||
icon_state ="jar_what"
|
||||
name = "jar of something"
|
||||
desc = "You can't really tell what this is."
|
||||
else
|
||||
icon_state = "jar"
|
||||
name = "empty jar"
|
||||
desc = "A jar. You're not sure what it's supposed to hold."
|
||||
return
|
||||
///jar
|
||||
/obj/item/weapon/reagent_containers/food/drinks/jar
|
||||
name = "empty jar"
|
||||
desc = "A jar. You're not sure what it's supposed to hold."
|
||||
icon_state = "jar"
|
||||
item_state = "beaker"
|
||||
center_of_mass = list("x"=15, "y"=8)
|
||||
unacidable = 1
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/drinks/jar/on_reagent_change()
|
||||
if (reagents.reagent_list.len > 0)
|
||||
switch(reagents.get_master_reagent_id())
|
||||
if("slime")
|
||||
icon_state = "jar_slime"
|
||||
name = "slime jam"
|
||||
desc = "A jar of slime jam. Delicious!"
|
||||
else
|
||||
icon_state ="jar_what"
|
||||
name = "jar of something"
|
||||
desc = "You can't really tell what this is."
|
||||
else
|
||||
icon_state = "jar"
|
||||
name = "empty jar"
|
||||
desc = "A jar. You're not sure what it's supposed to hold."
|
||||
return
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,37 +1,37 @@
|
||||
/obj/item/weapon/reagent_containers/food/snacks/meat
|
||||
name = "meat"
|
||||
desc = "A slab of meat."
|
||||
icon_state = "meat"
|
||||
health = 180
|
||||
filling_color = "#FF1C1C"
|
||||
center_of_mass = list("x"=16, "y"=14)
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/meat/New()
|
||||
..()
|
||||
reagents.add_reagent("protein", 9)
|
||||
src.bitesize = 3
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/meat/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
if(istype(W,/obj/item/weapon/material/knife))
|
||||
new /obj/item/weapon/reagent_containers/food/snacks/rawcutlet(src)
|
||||
new /obj/item/weapon/reagent_containers/food/snacks/rawcutlet(src)
|
||||
new /obj/item/weapon/reagent_containers/food/snacks/rawcutlet(src)
|
||||
user << "You cut the meat into thin strips."
|
||||
qdel(src)
|
||||
else
|
||||
..()
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/meat/syntiflesh
|
||||
name = "synthetic meat"
|
||||
desc = "A synthetic slab of flesh."
|
||||
|
||||
// Seperate definitions because some food likes to know if it's human.
|
||||
// TODO: rewrite kitchen code to check a var on the meat item so we can remove
|
||||
// all these sybtypes.
|
||||
/obj/item/weapon/reagent_containers/food/snacks/meat/human
|
||||
/obj/item/weapon/reagent_containers/food/snacks/meat/monkey
|
||||
//same as plain meat
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/meat/corgi
|
||||
name = "Corgi meat"
|
||||
/obj/item/weapon/reagent_containers/food/snacks/meat
|
||||
name = "meat"
|
||||
desc = "A slab of meat."
|
||||
icon_state = "meat"
|
||||
health = 180
|
||||
filling_color = "#FF1C1C"
|
||||
center_of_mass = list("x"=16, "y"=14)
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/meat/New()
|
||||
..()
|
||||
reagents.add_reagent("protein", 9)
|
||||
src.bitesize = 3
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/meat/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
if(istype(W,/obj/item/weapon/material/knife))
|
||||
new /obj/item/weapon/reagent_containers/food/snacks/rawcutlet(src)
|
||||
new /obj/item/weapon/reagent_containers/food/snacks/rawcutlet(src)
|
||||
new /obj/item/weapon/reagent_containers/food/snacks/rawcutlet(src)
|
||||
user << "You cut the meat into thin strips."
|
||||
qdel(src)
|
||||
else
|
||||
..()
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/meat/syntiflesh
|
||||
name = "synthetic meat"
|
||||
desc = "A synthetic slab of flesh."
|
||||
|
||||
// Seperate definitions because some food likes to know if it's human.
|
||||
// TODO: rewrite kitchen code to check a var on the meat item so we can remove
|
||||
// all these sybtypes.
|
||||
/obj/item/weapon/reagent_containers/food/snacks/meat/human
|
||||
/obj/item/weapon/reagent_containers/food/snacks/meat/monkey
|
||||
//same as plain meat
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/meat/corgi
|
||||
name = "Corgi meat"
|
||||
desc = "Tastes like... well, you know."
|
||||
@@ -1,175 +1,175 @@
|
||||
|
||||
//Not to be confused with /obj/item/weapon/reagent_containers/food/drinks/bottle
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/bottle
|
||||
name = "bottle"
|
||||
desc = "A small bottle."
|
||||
icon = 'icons/obj/chemical.dmi'
|
||||
icon_state = null
|
||||
item_state = "atoxinbottle"
|
||||
amount_per_transfer_from_this = 10
|
||||
possible_transfer_amounts = list(5,10,15,25,30,60)
|
||||
flags = 0
|
||||
volume = 60
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/bottle/on_reagent_change()
|
||||
update_icon()
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/bottle/pickup(mob/user)
|
||||
..()
|
||||
update_icon()
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/bottle/dropped(mob/user)
|
||||
..()
|
||||
update_icon()
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/bottle/attack_hand()
|
||||
..()
|
||||
update_icon()
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/bottle/New()
|
||||
..()
|
||||
if(!icon_state)
|
||||
icon_state = "bottle-[rand(1,4)]"
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/bottle/update_icon()
|
||||
overlays.Cut()
|
||||
|
||||
if(reagents.total_volume && (icon_state == "bottle-1" || icon_state == "bottle-2" || icon_state == "bottle-3" || icon_state == "bottle-4"))
|
||||
var/image/filling = image('icons/obj/reagentfillings.dmi', src, "[icon_state]10")
|
||||
|
||||
var/percent = round((reagents.total_volume / volume) * 100)
|
||||
switch(percent)
|
||||
if(0 to 9) filling.icon_state = "[icon_state]--10"
|
||||
if(10 to 24) filling.icon_state = "[icon_state]-10"
|
||||
if(25 to 49) filling.icon_state = "[icon_state]-25"
|
||||
if(50 to 74) filling.icon_state = "[icon_state]-50"
|
||||
if(75 to 79) filling.icon_state = "[icon_state]-75"
|
||||
if(80 to 90) filling.icon_state = "[icon_state]-80"
|
||||
if(91 to INFINITY) filling.icon_state = "[icon_state]-100"
|
||||
|
||||
filling.color = reagents.get_color()
|
||||
overlays += filling
|
||||
|
||||
if (!is_open_container())
|
||||
var/image/lid = image(icon, src, "lid_bottle")
|
||||
overlays += lid
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/bottle/inaprovaline
|
||||
name = "inaprovaline bottle"
|
||||
desc = "A small bottle. Contains inaprovaline - used to stabilize patients."
|
||||
icon = 'icons/obj/chemical.dmi'
|
||||
icon_state = "bottle-4"
|
||||
prefill = list("inaprovaline" = 60)
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/bottle/toxin
|
||||
name = "toxin bottle"
|
||||
desc = "A small bottle of toxins. Do not drink, it is poisonous."
|
||||
icon = 'icons/obj/chemical.dmi'
|
||||
icon_state = "bottle-3"
|
||||
prefill = list("toxin" = 60)
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/bottle/cyanide
|
||||
name = "cyanide bottle"
|
||||
desc = "A small bottle of cyanide. Bitter almonds?"
|
||||
icon = 'icons/obj/chemical.dmi'
|
||||
icon_state = "bottle-3"
|
||||
prefill = list("cyanide" = 30) //volume changed to match chloral
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/bottle/stoxin
|
||||
name = "soporific bottle"
|
||||
desc = "A small bottle of soporific. Just the fumes make you sleepy."
|
||||
icon = 'icons/obj/chemical.dmi'
|
||||
icon_state = "bottle-3"
|
||||
prefill = list("stoxin" = 60)
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/bottle/chloralhydrate
|
||||
name = "chloral hydrate bottle"
|
||||
desc = "A small bottle of Choral Hydrate. Mickey's Favorite!"
|
||||
icon = 'icons/obj/chemical.dmi'
|
||||
icon_state = "bottle-3"
|
||||
prefill = list("chloralhydrate" = 30) //Intentionally low since it is so strong. Still enough to knock someone out.
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/bottle/antitoxin
|
||||
name = "dylovene bottle"
|
||||
desc = "A small bottle of dylovene. Counters poisons, and repairs damage. A wonder drug."
|
||||
icon = 'icons/obj/chemical.dmi'
|
||||
icon_state = "bottle-4"
|
||||
prefill = list("anti_toxin" = 60)
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/bottle/mutagen
|
||||
name = "unstable mutagen bottle"
|
||||
desc = "A small bottle of unstable mutagen. Randomly changes the DNA structure of whoever comes in contact."
|
||||
icon = 'icons/obj/chemical.dmi'
|
||||
icon_state = "bottle-1"
|
||||
prefill = list("mutagen" = 60)
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/bottle/ammonia
|
||||
name = "ammonia bottle"
|
||||
desc = "A small bottle."
|
||||
icon = 'icons/obj/chemical.dmi'
|
||||
icon_state = "bottle-1"
|
||||
prefill = list("ammonia" = 60)
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/bottle/eznutrient
|
||||
name = "\improper EZ NUtrient bottle"
|
||||
desc = "A small bottle."
|
||||
icon = 'icons/obj/chemical.dmi'
|
||||
icon_state = "bottle-4"
|
||||
prefill = list("eznutrient" = 60)
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/bottle/left4zed
|
||||
name = "\improper Left-4-Zed bottle"
|
||||
desc = "A small bottle."
|
||||
icon = 'icons/obj/chemical.dmi'
|
||||
icon_state = "bottle-4"
|
||||
prefill = list("left4zed" = 60)
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/bottle/robustharvest
|
||||
name = "\improper Robust Harvest"
|
||||
desc = "A small bottle."
|
||||
icon = 'icons/obj/chemical.dmi'
|
||||
icon_state = "bottle-4"
|
||||
prefill = list("robustharvest" = 60)
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/bottle/diethylamine
|
||||
name = "diethylamine bottle"
|
||||
desc = "A small bottle."
|
||||
icon = 'icons/obj/chemical.dmi'
|
||||
icon_state = "bottle-4"
|
||||
prefill = list("diethylamine" = 60)
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/bottle/pacid
|
||||
name = "polytrinic acid bottle"
|
||||
desc = "A small bottle. Contains a small amount of Polytrinic Acid"
|
||||
icon = 'icons/obj/chemical.dmi'
|
||||
icon_state = "bottle-4"
|
||||
prefill = list("pacid" = 60)
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/bottle/adminordrazine
|
||||
name = "adminordrazine bottle"
|
||||
desc = "A small bottle. Contains the liquid essence of the gods."
|
||||
icon = 'icons/obj/drinks.dmi'
|
||||
icon_state = "holyflask"
|
||||
prefill = list("adminordrazine" = 60)
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/bottle/capsaicin
|
||||
name = "capsaicin bottle"
|
||||
desc = "A small bottle. Contains hot sauce."
|
||||
icon = 'icons/obj/chemical.dmi'
|
||||
icon_state = "bottle-4"
|
||||
prefill = list("capsaicin" = 60)
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/bottle/frostoil
|
||||
name = "frost oil bottle"
|
||||
desc = "A small bottle. Contains cold sauce."
|
||||
icon = 'icons/obj/chemical.dmi'
|
||||
icon_state = "bottle-4"
|
||||
prefill = list("frostoil" = 60)
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/bottle/biomass
|
||||
name = "biomass bottle"
|
||||
desc = "A bottle of raw biomass! Gross!"
|
||||
icon = 'icons/obj/chemical.dmi'
|
||||
icon_state = "bottle-3"
|
||||
|
||||
//Not to be confused with /obj/item/weapon/reagent_containers/food/drinks/bottle
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/bottle
|
||||
name = "bottle"
|
||||
desc = "A small bottle."
|
||||
icon = 'icons/obj/chemical.dmi'
|
||||
icon_state = null
|
||||
item_state = "atoxinbottle"
|
||||
amount_per_transfer_from_this = 10
|
||||
possible_transfer_amounts = list(5,10,15,25,30,60)
|
||||
flags = 0
|
||||
volume = 60
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/bottle/on_reagent_change()
|
||||
update_icon()
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/bottle/pickup(mob/user)
|
||||
..()
|
||||
update_icon()
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/bottle/dropped(mob/user)
|
||||
..()
|
||||
update_icon()
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/bottle/attack_hand()
|
||||
..()
|
||||
update_icon()
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/bottle/New()
|
||||
..()
|
||||
if(!icon_state)
|
||||
icon_state = "bottle-[rand(1,4)]"
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/bottle/update_icon()
|
||||
overlays.Cut()
|
||||
|
||||
if(reagents.total_volume && (icon_state == "bottle-1" || icon_state == "bottle-2" || icon_state == "bottle-3" || icon_state == "bottle-4"))
|
||||
var/image/filling = image('icons/obj/reagentfillings.dmi', src, "[icon_state]10")
|
||||
|
||||
var/percent = round((reagents.total_volume / volume) * 100)
|
||||
switch(percent)
|
||||
if(0 to 9) filling.icon_state = "[icon_state]--10"
|
||||
if(10 to 24) filling.icon_state = "[icon_state]-10"
|
||||
if(25 to 49) filling.icon_state = "[icon_state]-25"
|
||||
if(50 to 74) filling.icon_state = "[icon_state]-50"
|
||||
if(75 to 79) filling.icon_state = "[icon_state]-75"
|
||||
if(80 to 90) filling.icon_state = "[icon_state]-80"
|
||||
if(91 to INFINITY) filling.icon_state = "[icon_state]-100"
|
||||
|
||||
filling.color = reagents.get_color()
|
||||
overlays += filling
|
||||
|
||||
if (!is_open_container())
|
||||
var/image/lid = image(icon, src, "lid_bottle")
|
||||
overlays += lid
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/bottle/inaprovaline
|
||||
name = "inaprovaline bottle"
|
||||
desc = "A small bottle. Contains inaprovaline - used to stabilize patients."
|
||||
icon = 'icons/obj/chemical.dmi'
|
||||
icon_state = "bottle-4"
|
||||
prefill = list("inaprovaline" = 60)
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/bottle/toxin
|
||||
name = "toxin bottle"
|
||||
desc = "A small bottle of toxins. Do not drink, it is poisonous."
|
||||
icon = 'icons/obj/chemical.dmi'
|
||||
icon_state = "bottle-3"
|
||||
prefill = list("toxin" = 60)
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/bottle/cyanide
|
||||
name = "cyanide bottle"
|
||||
desc = "A small bottle of cyanide. Bitter almonds?"
|
||||
icon = 'icons/obj/chemical.dmi'
|
||||
icon_state = "bottle-3"
|
||||
prefill = list("cyanide" = 30) //volume changed to match chloral
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/bottle/stoxin
|
||||
name = "soporific bottle"
|
||||
desc = "A small bottle of soporific. Just the fumes make you sleepy."
|
||||
icon = 'icons/obj/chemical.dmi'
|
||||
icon_state = "bottle-3"
|
||||
prefill = list("stoxin" = 60)
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/bottle/chloralhydrate
|
||||
name = "chloral hydrate bottle"
|
||||
desc = "A small bottle of Choral Hydrate. Mickey's Favorite!"
|
||||
icon = 'icons/obj/chemical.dmi'
|
||||
icon_state = "bottle-3"
|
||||
prefill = list("chloralhydrate" = 30) //Intentionally low since it is so strong. Still enough to knock someone out.
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/bottle/antitoxin
|
||||
name = "dylovene bottle"
|
||||
desc = "A small bottle of dylovene. Counters poisons, and repairs damage. A wonder drug."
|
||||
icon = 'icons/obj/chemical.dmi'
|
||||
icon_state = "bottle-4"
|
||||
prefill = list("anti_toxin" = 60)
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/bottle/mutagen
|
||||
name = "unstable mutagen bottle"
|
||||
desc = "A small bottle of unstable mutagen. Randomly changes the DNA structure of whoever comes in contact."
|
||||
icon = 'icons/obj/chemical.dmi'
|
||||
icon_state = "bottle-1"
|
||||
prefill = list("mutagen" = 60)
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/bottle/ammonia
|
||||
name = "ammonia bottle"
|
||||
desc = "A small bottle."
|
||||
icon = 'icons/obj/chemical.dmi'
|
||||
icon_state = "bottle-1"
|
||||
prefill = list("ammonia" = 60)
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/bottle/eznutrient
|
||||
name = "\improper EZ NUtrient bottle"
|
||||
desc = "A small bottle."
|
||||
icon = 'icons/obj/chemical.dmi'
|
||||
icon_state = "bottle-4"
|
||||
prefill = list("eznutrient" = 60)
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/bottle/left4zed
|
||||
name = "\improper Left-4-Zed bottle"
|
||||
desc = "A small bottle."
|
||||
icon = 'icons/obj/chemical.dmi'
|
||||
icon_state = "bottle-4"
|
||||
prefill = list("left4zed" = 60)
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/bottle/robustharvest
|
||||
name = "\improper Robust Harvest"
|
||||
desc = "A small bottle."
|
||||
icon = 'icons/obj/chemical.dmi'
|
||||
icon_state = "bottle-4"
|
||||
prefill = list("robustharvest" = 60)
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/bottle/diethylamine
|
||||
name = "diethylamine bottle"
|
||||
desc = "A small bottle."
|
||||
icon = 'icons/obj/chemical.dmi'
|
||||
icon_state = "bottle-4"
|
||||
prefill = list("diethylamine" = 60)
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/bottle/pacid
|
||||
name = "polytrinic acid bottle"
|
||||
desc = "A small bottle. Contains a small amount of Polytrinic Acid"
|
||||
icon = 'icons/obj/chemical.dmi'
|
||||
icon_state = "bottle-4"
|
||||
prefill = list("pacid" = 60)
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/bottle/adminordrazine
|
||||
name = "adminordrazine bottle"
|
||||
desc = "A small bottle. Contains the liquid essence of the gods."
|
||||
icon = 'icons/obj/drinks.dmi'
|
||||
icon_state = "holyflask"
|
||||
prefill = list("adminordrazine" = 60)
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/bottle/capsaicin
|
||||
name = "capsaicin bottle"
|
||||
desc = "A small bottle. Contains hot sauce."
|
||||
icon = 'icons/obj/chemical.dmi'
|
||||
icon_state = "bottle-4"
|
||||
prefill = list("capsaicin" = 60)
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/bottle/frostoil
|
||||
name = "frost oil bottle"
|
||||
desc = "A small bottle. Contains cold sauce."
|
||||
icon = 'icons/obj/chemical.dmi'
|
||||
icon_state = "bottle-4"
|
||||
prefill = list("frostoil" = 60)
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/bottle/biomass
|
||||
name = "biomass bottle"
|
||||
desc = "A bottle of raw biomass! Gross!"
|
||||
icon = 'icons/obj/chemical.dmi'
|
||||
icon_state = "bottle-3"
|
||||
prefill = list("biomass" = 60)
|
||||
@@ -1,25 +1,25 @@
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/bottle/robot
|
||||
amount_per_transfer_from_this = 10
|
||||
possible_transfer_amounts = list(5,10,15,25,30,50,100)
|
||||
flags = OPENCONTAINER
|
||||
volume = 60
|
||||
var/reagent = ""
|
||||
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/bottle/robot/inaprovaline
|
||||
name = "internal inaprovaline bottle"
|
||||
desc = "A small bottle. Contains inaprovaline - used to stabilize patients."
|
||||
icon = 'icons/obj/chemical.dmi'
|
||||
icon_state = "bottle-4"
|
||||
reagent = "inaprovaline"
|
||||
prefill = list("inaprovaline" = 60)
|
||||
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/bottle/robot/antitoxin
|
||||
name = "internal anti-toxin bottle"
|
||||
desc = "A small bottle of Anti-toxins. Counters poisons, and repairs damage, a wonder drug."
|
||||
icon = 'icons/obj/chemical.dmi'
|
||||
icon_state = "bottle-4"
|
||||
reagent = "anti_toxin"
|
||||
prefill = list("anti_toxin" = 60)
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/bottle/robot
|
||||
amount_per_transfer_from_this = 10
|
||||
possible_transfer_amounts = list(5,10,15,25,30,50,100)
|
||||
flags = OPENCONTAINER
|
||||
volume = 60
|
||||
var/reagent = ""
|
||||
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/bottle/robot/inaprovaline
|
||||
name = "internal inaprovaline bottle"
|
||||
desc = "A small bottle. Contains inaprovaline - used to stabilize patients."
|
||||
icon = 'icons/obj/chemical.dmi'
|
||||
icon_state = "bottle-4"
|
||||
reagent = "inaprovaline"
|
||||
prefill = list("inaprovaline" = 60)
|
||||
|
||||
|
||||
/obj/item/weapon/reagent_containers/glass/bottle/robot/antitoxin
|
||||
name = "internal anti-toxin bottle"
|
||||
desc = "A small bottle of Anti-toxins. Counters poisons, and repairs damage, a wonder drug."
|
||||
icon = 'icons/obj/chemical.dmi'
|
||||
icon_state = "bottle-4"
|
||||
reagent = "anti_toxin"
|
||||
prefill = list("anti_toxin" = 60)
|
||||
@@ -1,236 +1,236 @@
|
||||
|
||||
/obj/machinery/gibber
|
||||
name = "gibber"
|
||||
desc = "The name isn't descriptive enough?"
|
||||
icon = 'icons/obj/kitchen.dmi'
|
||||
icon_state = "grinder"
|
||||
density = 1
|
||||
anchored = 1
|
||||
req_access = list(access_kitchen,access_morgue)
|
||||
|
||||
var/operating = 0 //Is it on?
|
||||
var/dirty = 0 // Does it need cleaning?
|
||||
var/mob/living/occupant // Mob who has been put inside
|
||||
var/gib_time = 40 // Time from starting until meat appears
|
||||
var/gib_throw_dir = WEST // Direction to spit meat and gibs in.
|
||||
|
||||
use_power = 1
|
||||
idle_power_usage = 2
|
||||
active_power_usage = 500
|
||||
|
||||
//auto-gibs anything that bumps into it
|
||||
/obj/machinery/gibber/autogibber
|
||||
var/turf/input_plate
|
||||
|
||||
/obj/machinery/gibber/autogibber/New()
|
||||
..()
|
||||
spawn(5)
|
||||
for(var/i in cardinal)
|
||||
var/obj/machinery/mineral/input/input_obj = locate( /obj/machinery/mineral/input, get_step(src.loc, i) )
|
||||
if(input_obj)
|
||||
if(isturf(input_obj.loc))
|
||||
input_plate = input_obj.loc
|
||||
gib_throw_dir = i
|
||||
qdel(input_obj)
|
||||
break
|
||||
|
||||
if(!input_plate)
|
||||
log_misc("a [src] didn't find an input plate.")
|
||||
return
|
||||
|
||||
/obj/machinery/gibber/autogibber/Bumped(var/atom/A)
|
||||
if(!input_plate) return
|
||||
|
||||
if(ismob(A))
|
||||
var/mob/M = A
|
||||
|
||||
if(M.loc == input_plate
|
||||
)
|
||||
M.loc = src
|
||||
M.gib()
|
||||
|
||||
|
||||
/obj/machinery/gibber/New()
|
||||
..()
|
||||
src.overlays += image('icons/obj/kitchen.dmi', "grjam")
|
||||
|
||||
/obj/machinery/gibber/update_icon()
|
||||
overlays.Cut()
|
||||
if (dirty)
|
||||
src.overlays += image('icons/obj/kitchen.dmi', "grbloody")
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
if (!occupant)
|
||||
src.overlays += image('icons/obj/kitchen.dmi', "grjam")
|
||||
else if (operating)
|
||||
src.overlays += image('icons/obj/kitchen.dmi', "gruse")
|
||||
else
|
||||
src.overlays += image('icons/obj/kitchen.dmi', "gridle")
|
||||
|
||||
/obj/machinery/gibber/relaymove(mob/user as mob)
|
||||
src.go_out()
|
||||
return
|
||||
|
||||
/obj/machinery/gibber/attack_hand(mob/user as mob)
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
if(operating)
|
||||
user << "<span class='danger'>The gibber is locked and running, wait for it to finish.</span>"
|
||||
return
|
||||
else
|
||||
src.startgibbing(user)
|
||||
|
||||
/obj/machinery/gibber/examine()
|
||||
..()
|
||||
usr << "The safety guard is [emagged ? "<span class='danger'>disabled</span>" : "enabled"]."
|
||||
|
||||
/obj/machinery/gibber/emag_act(var/remaining_charges, var/mob/user)
|
||||
emagged = !emagged
|
||||
user << "<span class='danger'>You [emagged ? "disable" : "enable"] the gibber safety guard.</span>"
|
||||
return 1
|
||||
|
||||
/obj/machinery/gibber/attackby(var/obj/item/W, var/mob/user)
|
||||
var/obj/item/weapon/grab/G = W
|
||||
|
||||
if(default_unfasten_wrench(user, W, 40))
|
||||
return
|
||||
|
||||
if(!istype(G))
|
||||
return ..()
|
||||
|
||||
if(G.state < 2)
|
||||
user << "<span class='danger'>You need a better grip to do that!</span>"
|
||||
return
|
||||
|
||||
move_into_gibber(user,G.affecting)
|
||||
// Grab() process should clean up the grab item, no need to del it.
|
||||
|
||||
/obj/machinery/gibber/MouseDrop_T(mob/target, mob/user)
|
||||
if(user.stat || user.restrained())
|
||||
return
|
||||
move_into_gibber(user,target)
|
||||
|
||||
/obj/machinery/gibber/proc/move_into_gibber(var/mob/user,var/mob/living/victim)
|
||||
|
||||
if(src.occupant)
|
||||
user << "<span class='danger'>The gibber is full, empty it first!</span>"
|
||||
return
|
||||
|
||||
if(operating)
|
||||
user << "<span class='danger'>The gibber is locked and running, wait for it to finish.</span>"
|
||||
return
|
||||
|
||||
if(!(istype(victim, /mob/living/carbon)) && !(istype(victim, /mob/living/simple_animal)) )
|
||||
user << "<span class='danger'>This is not suitable for the gibber!</span>"
|
||||
return
|
||||
|
||||
if(istype(victim,/mob/living/carbon/human) && !emagged)
|
||||
user << "<span class='danger'>The gibber safety guard is engaged!</span>"
|
||||
return
|
||||
|
||||
|
||||
if(victim.abiotic(1))
|
||||
user << "<span class='danger'>Subject may not have abiotic items on.</span>"
|
||||
return
|
||||
|
||||
user.visible_message("<span class='danger'>[user] starts to put [victim] into the gibber!</span>")
|
||||
src.add_fingerprint(user)
|
||||
if(do_after(user, 30) && victim.Adjacent(src) && user.Adjacent(src) && victim.Adjacent(user) && !occupant)
|
||||
user.visible_message("<span class='danger'>[user] stuffs [victim] into the gibber!</span>")
|
||||
if(victim.client)
|
||||
victim.client.perspective = EYE_PERSPECTIVE
|
||||
victim.client.eye = src
|
||||
victim.loc = src
|
||||
src.occupant = victim
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/gibber/verb/eject()
|
||||
set category = "Object"
|
||||
set name = "Empty Gibber"
|
||||
set src in oview(1)
|
||||
|
||||
if (usr.stat != 0)
|
||||
return
|
||||
src.go_out()
|
||||
add_fingerprint(usr)
|
||||
return
|
||||
|
||||
/obj/machinery/gibber/proc/go_out()
|
||||
if(operating || !src.occupant)
|
||||
return
|
||||
for(var/obj/O in src)
|
||||
O.loc = src.loc
|
||||
if (src.occupant.client)
|
||||
src.occupant.client.eye = src.occupant.client.mob
|
||||
src.occupant.client.perspective = MOB_PERSPECTIVE
|
||||
src.occupant.loc = src.loc
|
||||
src.occupant = null
|
||||
update_icon()
|
||||
return
|
||||
|
||||
|
||||
/obj/machinery/gibber/proc/startgibbing(mob/user as mob)
|
||||
if(src.operating)
|
||||
return
|
||||
if(!src.occupant)
|
||||
visible_message("<span class='danger'>You hear a loud metallic grinding sound.</span>")
|
||||
return
|
||||
|
||||
use_power(1000)
|
||||
visible_message("<span class='danger'>You hear a loud [occupant.isSynthetic() ? "metallic" : "squelchy"] grinding sound.</span>")
|
||||
src.operating = 1
|
||||
update_icon()
|
||||
|
||||
var/slab_name = occupant.name
|
||||
var/slab_count = 3
|
||||
var/slab_type = /obj/item/weapon/reagent_containers/food/snacks/meat
|
||||
var/slab_nutrition = src.occupant.nutrition / 15
|
||||
|
||||
// Some mobs have specific meat item types.
|
||||
if(istype(src.occupant,/mob/living/simple_animal))
|
||||
var/mob/living/simple_animal/critter = src.occupant
|
||||
if(critter.meat_amount)
|
||||
slab_count = critter.meat_amount
|
||||
if(critter.meat_type)
|
||||
slab_type = critter.meat_type
|
||||
else if(istype(src.occupant,/mob/living/carbon/human))
|
||||
var/mob/living/carbon/human/H = occupant
|
||||
slab_name = src.occupant.real_name
|
||||
slab_type = H.isSynthetic() ? /obj/item/stack/material/steel : H.species.meat_type
|
||||
|
||||
// Small mobs don't give as much nutrition.
|
||||
if(issmall(src.occupant))
|
||||
slab_nutrition *= 0.5
|
||||
slab_nutrition /= slab_count
|
||||
|
||||
for(var/i=1 to slab_count)
|
||||
var/obj/item/weapon/reagent_containers/food/snacks/meat/new_meat = new slab_type(src, rand(3,8))
|
||||
if(istype(new_meat))
|
||||
new_meat.name = "[slab_name] [new_meat.name]"
|
||||
new_meat.reagents.add_reagent("nutriment",slab_nutrition)
|
||||
if(src.occupant.reagents)
|
||||
src.occupant.reagents.trans_to_obj(new_meat, round(occupant.reagents.total_volume/slab_count,1))
|
||||
|
||||
add_attack_logs(user,occupant,"Used [src] to gib")
|
||||
|
||||
src.occupant.ghostize()
|
||||
|
||||
spawn(gib_time)
|
||||
|
||||
src.operating = 0
|
||||
src.occupant.gib()
|
||||
qdel(src.occupant)
|
||||
|
||||
playsound(src.loc, 'sound/effects/splat.ogg', 50, 1)
|
||||
operating = 0
|
||||
for (var/obj/item/thing in contents)
|
||||
// There's a chance that the gibber will fail to destroy some evidence.
|
||||
if(istype(thing,/obj/item/organ) && prob(80))
|
||||
qdel(thing)
|
||||
continue
|
||||
thing.forceMove(get_turf(thing)) // Drop it onto the turf for throwing.
|
||||
thing.throw_at(get_edge_target_turf(src,gib_throw_dir),rand(0,3),emagged ? 100 : 50) // Being pelted with bits of meat and bone would hurt.
|
||||
|
||||
update_icon()
|
||||
|
||||
|
||||
|
||||
/obj/machinery/gibber
|
||||
name = "gibber"
|
||||
desc = "The name isn't descriptive enough?"
|
||||
icon = 'icons/obj/kitchen.dmi'
|
||||
icon_state = "grinder"
|
||||
density = 1
|
||||
anchored = 1
|
||||
req_access = list(access_kitchen,access_morgue)
|
||||
|
||||
var/operating = 0 //Is it on?
|
||||
var/dirty = 0 // Does it need cleaning?
|
||||
var/mob/living/occupant // Mob who has been put inside
|
||||
var/gib_time = 40 // Time from starting until meat appears
|
||||
var/gib_throw_dir = WEST // Direction to spit meat and gibs in.
|
||||
|
||||
use_power = 1
|
||||
idle_power_usage = 2
|
||||
active_power_usage = 500
|
||||
|
||||
//auto-gibs anything that bumps into it
|
||||
/obj/machinery/gibber/autogibber
|
||||
var/turf/input_plate
|
||||
|
||||
/obj/machinery/gibber/autogibber/New()
|
||||
..()
|
||||
spawn(5)
|
||||
for(var/i in cardinal)
|
||||
var/obj/machinery/mineral/input/input_obj = locate( /obj/machinery/mineral/input, get_step(src.loc, i) )
|
||||
if(input_obj)
|
||||
if(isturf(input_obj.loc))
|
||||
input_plate = input_obj.loc
|
||||
gib_throw_dir = i
|
||||
qdel(input_obj)
|
||||
break
|
||||
|
||||
if(!input_plate)
|
||||
log_misc("a [src] didn't find an input plate.")
|
||||
return
|
||||
|
||||
/obj/machinery/gibber/autogibber/Bumped(var/atom/A)
|
||||
if(!input_plate) return
|
||||
|
||||
if(ismob(A))
|
||||
var/mob/M = A
|
||||
|
||||
if(M.loc == input_plate
|
||||
)
|
||||
M.loc = src
|
||||
M.gib()
|
||||
|
||||
|
||||
/obj/machinery/gibber/New()
|
||||
..()
|
||||
src.overlays += image('icons/obj/kitchen.dmi', "grjam")
|
||||
|
||||
/obj/machinery/gibber/update_icon()
|
||||
overlays.Cut()
|
||||
if (dirty)
|
||||
src.overlays += image('icons/obj/kitchen.dmi', "grbloody")
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
if (!occupant)
|
||||
src.overlays += image('icons/obj/kitchen.dmi', "grjam")
|
||||
else if (operating)
|
||||
src.overlays += image('icons/obj/kitchen.dmi', "gruse")
|
||||
else
|
||||
src.overlays += image('icons/obj/kitchen.dmi', "gridle")
|
||||
|
||||
/obj/machinery/gibber/relaymove(mob/user as mob)
|
||||
src.go_out()
|
||||
return
|
||||
|
||||
/obj/machinery/gibber/attack_hand(mob/user as mob)
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
if(operating)
|
||||
user << "<span class='danger'>The gibber is locked and running, wait for it to finish.</span>"
|
||||
return
|
||||
else
|
||||
src.startgibbing(user)
|
||||
|
||||
/obj/machinery/gibber/examine()
|
||||
..()
|
||||
usr << "The safety guard is [emagged ? "<span class='danger'>disabled</span>" : "enabled"]."
|
||||
|
||||
/obj/machinery/gibber/emag_act(var/remaining_charges, var/mob/user)
|
||||
emagged = !emagged
|
||||
user << "<span class='danger'>You [emagged ? "disable" : "enable"] the gibber safety guard.</span>"
|
||||
return 1
|
||||
|
||||
/obj/machinery/gibber/attackby(var/obj/item/W, var/mob/user)
|
||||
var/obj/item/weapon/grab/G = W
|
||||
|
||||
if(default_unfasten_wrench(user, W, 40))
|
||||
return
|
||||
|
||||
if(!istype(G))
|
||||
return ..()
|
||||
|
||||
if(G.state < 2)
|
||||
user << "<span class='danger'>You need a better grip to do that!</span>"
|
||||
return
|
||||
|
||||
move_into_gibber(user,G.affecting)
|
||||
// Grab() process should clean up the grab item, no need to del it.
|
||||
|
||||
/obj/machinery/gibber/MouseDrop_T(mob/target, mob/user)
|
||||
if(user.stat || user.restrained())
|
||||
return
|
||||
move_into_gibber(user,target)
|
||||
|
||||
/obj/machinery/gibber/proc/move_into_gibber(var/mob/user,var/mob/living/victim)
|
||||
|
||||
if(src.occupant)
|
||||
user << "<span class='danger'>The gibber is full, empty it first!</span>"
|
||||
return
|
||||
|
||||
if(operating)
|
||||
user << "<span class='danger'>The gibber is locked and running, wait for it to finish.</span>"
|
||||
return
|
||||
|
||||
if(!(istype(victim, /mob/living/carbon)) && !(istype(victim, /mob/living/simple_animal)) )
|
||||
user << "<span class='danger'>This is not suitable for the gibber!</span>"
|
||||
return
|
||||
|
||||
if(istype(victim,/mob/living/carbon/human) && !emagged)
|
||||
user << "<span class='danger'>The gibber safety guard is engaged!</span>"
|
||||
return
|
||||
|
||||
|
||||
if(victim.abiotic(1))
|
||||
user << "<span class='danger'>Subject may not have abiotic items on.</span>"
|
||||
return
|
||||
|
||||
user.visible_message("<span class='danger'>[user] starts to put [victim] into the gibber!</span>")
|
||||
src.add_fingerprint(user)
|
||||
if(do_after(user, 30) && victim.Adjacent(src) && user.Adjacent(src) && victim.Adjacent(user) && !occupant)
|
||||
user.visible_message("<span class='danger'>[user] stuffs [victim] into the gibber!</span>")
|
||||
if(victim.client)
|
||||
victim.client.perspective = EYE_PERSPECTIVE
|
||||
victim.client.eye = src
|
||||
victim.loc = src
|
||||
src.occupant = victim
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/gibber/verb/eject()
|
||||
set category = "Object"
|
||||
set name = "Empty Gibber"
|
||||
set src in oview(1)
|
||||
|
||||
if (usr.stat != 0)
|
||||
return
|
||||
src.go_out()
|
||||
add_fingerprint(usr)
|
||||
return
|
||||
|
||||
/obj/machinery/gibber/proc/go_out()
|
||||
if(operating || !src.occupant)
|
||||
return
|
||||
for(var/obj/O in src)
|
||||
O.loc = src.loc
|
||||
if (src.occupant.client)
|
||||
src.occupant.client.eye = src.occupant.client.mob
|
||||
src.occupant.client.perspective = MOB_PERSPECTIVE
|
||||
src.occupant.loc = src.loc
|
||||
src.occupant = null
|
||||
update_icon()
|
||||
return
|
||||
|
||||
|
||||
/obj/machinery/gibber/proc/startgibbing(mob/user as mob)
|
||||
if(src.operating)
|
||||
return
|
||||
if(!src.occupant)
|
||||
visible_message("<span class='danger'>You hear a loud metallic grinding sound.</span>")
|
||||
return
|
||||
|
||||
use_power(1000)
|
||||
visible_message("<span class='danger'>You hear a loud [occupant.isSynthetic() ? "metallic" : "squelchy"] grinding sound.</span>")
|
||||
src.operating = 1
|
||||
update_icon()
|
||||
|
||||
var/slab_name = occupant.name
|
||||
var/slab_count = 3
|
||||
var/slab_type = /obj/item/weapon/reagent_containers/food/snacks/meat
|
||||
var/slab_nutrition = src.occupant.nutrition / 15
|
||||
|
||||
// Some mobs have specific meat item types.
|
||||
if(istype(src.occupant,/mob/living/simple_animal))
|
||||
var/mob/living/simple_animal/critter = src.occupant
|
||||
if(critter.meat_amount)
|
||||
slab_count = critter.meat_amount
|
||||
if(critter.meat_type)
|
||||
slab_type = critter.meat_type
|
||||
else if(istype(src.occupant,/mob/living/carbon/human))
|
||||
var/mob/living/carbon/human/H = occupant
|
||||
slab_name = src.occupant.real_name
|
||||
slab_type = H.isSynthetic() ? /obj/item/stack/material/steel : H.species.meat_type
|
||||
|
||||
// Small mobs don't give as much nutrition.
|
||||
if(issmall(src.occupant))
|
||||
slab_nutrition *= 0.5
|
||||
slab_nutrition /= slab_count
|
||||
|
||||
for(var/i=1 to slab_count)
|
||||
var/obj/item/weapon/reagent_containers/food/snacks/meat/new_meat = new slab_type(src, rand(3,8))
|
||||
if(istype(new_meat))
|
||||
new_meat.name = "[slab_name] [new_meat.name]"
|
||||
new_meat.reagents.add_reagent("nutriment",slab_nutrition)
|
||||
if(src.occupant.reagents)
|
||||
src.occupant.reagents.trans_to_obj(new_meat, round(occupant.reagents.total_volume/slab_count,1))
|
||||
|
||||
add_attack_logs(user,occupant,"Used [src] to gib")
|
||||
|
||||
src.occupant.ghostize()
|
||||
|
||||
spawn(gib_time)
|
||||
|
||||
src.operating = 0
|
||||
src.occupant.gib()
|
||||
qdel(src.occupant)
|
||||
|
||||
playsound(src.loc, 'sound/effects/splat.ogg', 50, 1)
|
||||
operating = 0
|
||||
for (var/obj/item/thing in contents)
|
||||
// There's a chance that the gibber will fail to destroy some evidence.
|
||||
if(istype(thing,/obj/item/organ) && prob(80))
|
||||
qdel(thing)
|
||||
continue
|
||||
thing.forceMove(get_turf(thing)) // Drop it onto the turf for throwing.
|
||||
thing.throw_at(get_edge_target_turf(src,gib_throw_dir),rand(0,3),emagged ? 100 : 50) // Being pelted with bits of meat and bone would hurt.
|
||||
|
||||
update_icon()
|
||||
|
||||
|
||||
@@ -1,392 +1,392 @@
|
||||
/obj/machinery/microwave
|
||||
name = "microwave"
|
||||
icon = 'icons/obj/kitchen.dmi'
|
||||
icon_state = "mw"
|
||||
density = 1
|
||||
anchored = 1
|
||||
use_power = 1
|
||||
idle_power_usage = 5
|
||||
active_power_usage = 100
|
||||
flags = OPENCONTAINER | NOREACT
|
||||
circuit = /obj/item/weapon/circuitboard/microwave
|
||||
var/operating = 0 // Is it on?
|
||||
var/dirty = 0 // = {0..100} Does it need cleaning?
|
||||
var/broken = 0 // ={0,1,2} How broken is it???
|
||||
var/global/list/datum/recipe/available_recipes // List of the recipes you can use
|
||||
var/global/list/acceptable_items // List of the items you can put in
|
||||
var/global/list/acceptable_reagents // List of the reagents you can put in
|
||||
var/global/max_n_of_items = 0
|
||||
|
||||
|
||||
// see code/modules/food/recipes_microwave.dm for recipes
|
||||
|
||||
/*******************
|
||||
* Initialising
|
||||
********************/
|
||||
|
||||
/obj/machinery/microwave/New()
|
||||
..()
|
||||
reagents = new/datum/reagents(100)
|
||||
reagents.my_atom = src
|
||||
|
||||
component_parts = list()
|
||||
component_parts += new /obj/item/weapon/stock_parts/console_screen(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/motor(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/capacitor(src)
|
||||
|
||||
if (!available_recipes)
|
||||
available_recipes = new
|
||||
for (var/type in (typesof(/datum/recipe)-/datum/recipe))
|
||||
available_recipes+= new type
|
||||
acceptable_items = new
|
||||
acceptable_reagents = new
|
||||
for (var/datum/recipe/recipe in available_recipes)
|
||||
for (var/item in recipe.items)
|
||||
acceptable_items |= item
|
||||
for (var/reagent in recipe.reagents)
|
||||
acceptable_reagents |= reagent
|
||||
if (recipe.items)
|
||||
max_n_of_items = max(max_n_of_items,recipe.items.len)
|
||||
// This will do until I can think of a fun recipe to use dionaea in -
|
||||
// will also allow anything using the holder item to be microwaved into
|
||||
// impure carbon. ~Z
|
||||
acceptable_items |= /obj/item/weapon/holder
|
||||
acceptable_items |= /obj/item/weapon/reagent_containers/food/snacks/grown
|
||||
|
||||
RefreshParts()
|
||||
|
||||
/*******************
|
||||
* Item Adding
|
||||
********************/
|
||||
|
||||
/obj/machinery/microwave/attackby(var/obj/item/O as obj, var/mob/user as mob)
|
||||
if(src.broken > 0)
|
||||
if(src.broken == 2 && O.is_screwdriver()) // If it's broken and they're using a screwdriver
|
||||
user.visible_message( \
|
||||
"<span class='notice'>\The [user] starts to fix part of the microwave.</span>", \
|
||||
"<span class='notice'>You start to fix part of the microwave.</span>" \
|
||||
)
|
||||
playsound(src, O.usesound, 50, 1)
|
||||
if (do_after(user,20 * O.toolspeed))
|
||||
user.visible_message( \
|
||||
"<span class='notice'>\The [user] fixes part of the microwave.</span>", \
|
||||
"<span class='notice'>You have fixed part of the microwave.</span>" \
|
||||
)
|
||||
src.broken = 1 // Fix it a bit
|
||||
else if(src.broken == 1 && O.is_wrench()) // If it's broken and they're doing the wrench
|
||||
user.visible_message( \
|
||||
"<span class='notice'>\The [user] starts to fix part of the microwave.</span>", \
|
||||
"<span class='notice'>You start to fix part of the microwave.</span>" \
|
||||
)
|
||||
if (do_after(user,20 * O.toolspeed))
|
||||
user.visible_message( \
|
||||
"<span class='notice'>\The [user] fixes the microwave.</span>", \
|
||||
"<span class='notice'>You have fixed the microwave.</span>" \
|
||||
)
|
||||
src.icon_state = "mw"
|
||||
src.broken = 0 // Fix it!
|
||||
src.dirty = 0 // just to be sure
|
||||
src.flags = OPENCONTAINER | NOREACT
|
||||
else
|
||||
to_chat(user, "<span class='warning'>It's broken!</span>")
|
||||
return 1
|
||||
else if(default_deconstruction_screwdriver(user, O))
|
||||
return
|
||||
else if(default_deconstruction_crowbar(user, O))
|
||||
return
|
||||
else if(default_unfasten_wrench(user, O, 10))
|
||||
return
|
||||
|
||||
else if(src.dirty==100) // The microwave is all dirty so can't be used!
|
||||
if(istype(O, /obj/item/weapon/reagent_containers/spray/cleaner) || istype(O, /obj/item/weapon/soap)) // If they're trying to clean it then let them
|
||||
user.visible_message( \
|
||||
"<span class='notice'>\The [user] starts to clean the microwave.</span>", \
|
||||
"<span class='notice'>You start to clean the microwave.</span>" \
|
||||
)
|
||||
if (do_after(user,20))
|
||||
user.visible_message( \
|
||||
"<span class='notice'>\The [user] has cleaned the microwave.</span>", \
|
||||
"<span class='notice'>You have cleaned the microwave.</span>" \
|
||||
)
|
||||
src.dirty = 0 // It's clean!
|
||||
src.broken = 0 // just to be sure
|
||||
src.icon_state = "mw"
|
||||
src.flags = OPENCONTAINER | NOREACT
|
||||
else //Otherwise bad luck!!
|
||||
to_chat(user, "<span class='warning'>It's dirty!</span>")
|
||||
return 1
|
||||
else if(is_type_in_list(O,acceptable_items))
|
||||
if (contents.len>=(max_n_of_items + component_parts.len + 1)) //Adds component_parts to the maximum number of items. The 1 is from the circuit
|
||||
to_chat(user, "<span class='warning'>This [src] is full of ingredients, you cannot put more.</span>")
|
||||
return 1
|
||||
if(istype(O, /obj/item/stack) && O:get_amount() > 1) // This is bad, but I can't think of how to change it
|
||||
var/obj/item/stack/S = O
|
||||
new O.type (src)
|
||||
S.use(1)
|
||||
user.visible_message( \
|
||||
"<span class='notice'>\The [user] has added one of [O] to \the [src].</span>", \
|
||||
"<span class='notice'>You add one of [O] to \the [src].</span>")
|
||||
return
|
||||
else
|
||||
// user.remove_from_mob(O) //This just causes problems so far as I can tell. -Pete
|
||||
user.drop_item()
|
||||
O.loc = src
|
||||
user.visible_message( \
|
||||
"<span class='notice'>\The [user] has added \the [O] to \the [src].</span>", \
|
||||
"<span class='notice'>You add \the [O] to \the [src].</span>")
|
||||
return
|
||||
else 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) \
|
||||
)
|
||||
if (!O.reagents)
|
||||
return 1
|
||||
for (var/datum/reagent/R in O.reagents.reagent_list)
|
||||
if (!(R.id in acceptable_reagents))
|
||||
to_chat(user, "<span class='warning'>Your [O] contains components unsuitable for cookery.</span>")
|
||||
return 1
|
||||
return
|
||||
else if(istype(O,/obj/item/weapon/grab))
|
||||
var/obj/item/weapon/grab/G = O
|
||||
to_chat(user, "<span class='warning'>This is ridiculous. You can not fit \the [G.affecting] in this [src].</span>")
|
||||
return 1
|
||||
else
|
||||
to_chat(user, "<span class='warning'>You have no idea what you can cook with this [O].</span>")
|
||||
..()
|
||||
src.updateUsrDialog()
|
||||
|
||||
/obj/machinery/microwave/attack_ai(mob/user as mob)
|
||||
if(istype(user, /mob/living/silicon/robot) && Adjacent(user))
|
||||
attack_hand(user)
|
||||
|
||||
/obj/machinery/microwave/attack_hand(mob/user as mob)
|
||||
user.set_machine(src)
|
||||
interact(user)
|
||||
|
||||
/*******************
|
||||
* Microwave Menu
|
||||
********************/
|
||||
|
||||
/obj/machinery/microwave/interact(mob/user as mob) // The microwave Menu
|
||||
var/dat = ""
|
||||
if(src.broken > 0)
|
||||
dat = {"<TT>Bzzzzttttt</TT>"}
|
||||
else if(src.operating)
|
||||
dat = {"<TT>Microwaving in progress!<BR>Please wait...!</TT>"}
|
||||
else if(src.dirty==100)
|
||||
dat = {"<TT>This microwave is dirty!<BR>Please clean it before use!</TT>"}
|
||||
else
|
||||
var/list/items_counts = new
|
||||
var/list/items_measures = new
|
||||
var/list/items_measures_p = new
|
||||
for (var/obj/O in ((contents - component_parts) - circuit))
|
||||
var/display_name = O.name
|
||||
if (istype(O,/obj/item/weapon/reagent_containers/food/snacks/egg))
|
||||
items_measures[display_name] = "egg"
|
||||
items_measures_p[display_name] = "eggs"
|
||||
if (istype(O,/obj/item/weapon/reagent_containers/food/snacks/tofu))
|
||||
items_measures[display_name] = "tofu chunk"
|
||||
items_measures_p[display_name] = "tofu chunks"
|
||||
if (istype(O,/obj/item/weapon/reagent_containers/food/snacks/meat)) //any meat
|
||||
items_measures[display_name] = "slab of meat"
|
||||
items_measures_p[display_name] = "slabs of meat"
|
||||
if (istype(O,/obj/item/weapon/reagent_containers/food/snacks/donkpocket))
|
||||
display_name = "Turnovers"
|
||||
items_measures[display_name] = "turnover"
|
||||
items_measures_p[display_name] = "turnovers"
|
||||
if (istype(O,/obj/item/weapon/reagent_containers/food/snacks/carpmeat))
|
||||
items_measures[display_name] = "fillet of meat"
|
||||
items_measures_p[display_name] = "fillets of meat"
|
||||
items_counts[display_name]++
|
||||
for (var/O in items_counts)
|
||||
var/N = items_counts[O]
|
||||
if (!(O in items_measures))
|
||||
dat += {"<B>[capitalize(O)]:</B> [N] [lowertext(O)]\s<BR>"}
|
||||
else
|
||||
if (N==1)
|
||||
dat += {"<B>[capitalize(O)]:</B> [N] [items_measures[O]]<BR>"}
|
||||
else
|
||||
dat += {"<B>[capitalize(O)]:</B> [N] [items_measures_p[O]]<BR>"}
|
||||
|
||||
for (var/datum/reagent/R in reagents.reagent_list)
|
||||
var/display_name = R.name
|
||||
if (R.id == "capsaicin")
|
||||
display_name = "Hotsauce"
|
||||
if (R.id == "frostoil")
|
||||
display_name = "Coldsauce"
|
||||
dat += {"<B>[display_name]:</B> [R.volume] unit\s<BR>"}
|
||||
|
||||
if (items_counts.len==0 && reagents.reagent_list.len==0)
|
||||
dat = {"<B>The microwave is empty</B><BR>"}
|
||||
else
|
||||
dat = {"<b>Ingredients:</b><br>[dat]"}
|
||||
dat += {"<HR><BR>\
|
||||
<A href='?src=\ref[src];action=cook'>Turn on!<BR>\
|
||||
<A href='?src=\ref[src];action=dispose'>Eject ingredients!<BR>\
|
||||
"}
|
||||
|
||||
to_chat(user, browse("<HEAD><TITLE>Microwave Controls</TITLE></HEAD><TT>[dat]</TT>", "window=microwave"))
|
||||
onclose(user, "microwave")
|
||||
return
|
||||
|
||||
|
||||
|
||||
/***********************************
|
||||
* Microwave Menu Handling/Cooking
|
||||
************************************/
|
||||
|
||||
/obj/machinery/microwave/proc/cook()
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
start()
|
||||
if (reagents.total_volume==0 && !(locate(/obj) in ((contents - component_parts) - circuit))) //dry run
|
||||
if (!wzhzhzh(10))
|
||||
abort()
|
||||
return
|
||||
stop()
|
||||
return
|
||||
|
||||
var/datum/recipe/recipe = select_recipe(available_recipes,src)
|
||||
var/obj/cooked
|
||||
if (!recipe)
|
||||
dirty += 1
|
||||
if (prob(max(10,dirty*5)))
|
||||
if (!wzhzhzh(4))
|
||||
abort()
|
||||
return
|
||||
muck_start()
|
||||
wzhzhzh(4)
|
||||
muck_finish()
|
||||
cooked = fail()
|
||||
cooked.loc = src.loc
|
||||
return
|
||||
else if (has_extra_item())
|
||||
if (!wzhzhzh(4))
|
||||
abort()
|
||||
return
|
||||
broke()
|
||||
cooked = fail()
|
||||
cooked.loc = src.loc
|
||||
return
|
||||
else
|
||||
if (!wzhzhzh(10))
|
||||
abort()
|
||||
return
|
||||
stop()
|
||||
cooked = fail()
|
||||
cooked.loc = src.loc
|
||||
return
|
||||
else
|
||||
var/halftime = round(recipe.time/10/2)
|
||||
if (!wzhzhzh(halftime))
|
||||
abort()
|
||||
return
|
||||
if (!wzhzhzh(halftime))
|
||||
abort()
|
||||
cooked = fail()
|
||||
cooked.loc = src.loc
|
||||
return
|
||||
cooked = recipe.make_food(src)
|
||||
stop()
|
||||
if(cooked)
|
||||
cooked.loc = src.loc
|
||||
return
|
||||
|
||||
/obj/machinery/microwave/proc/wzhzhzh(var/seconds as num) // Whoever named this proc is fucking literally Satan. ~ Z
|
||||
for (var/i=1 to seconds)
|
||||
if (stat & (NOPOWER|BROKEN))
|
||||
return 0
|
||||
use_power(500)
|
||||
sleep(10)
|
||||
return 1
|
||||
|
||||
/obj/machinery/microwave/proc/has_extra_item()
|
||||
for (var/obj/O in ((contents - component_parts) - circuit))
|
||||
if ( \
|
||||
!istype(O,/obj/item/weapon/reagent_containers/food) && \
|
||||
!istype(O, /obj/item/weapon/grown) \
|
||||
)
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/obj/machinery/microwave/proc/start()
|
||||
src.visible_message("<span class='notice'>The microwave turns on.</span>", "<span class='notice'>You hear a microwave.</span>")
|
||||
src.operating = 1
|
||||
src.icon_state = "mw1"
|
||||
src.updateUsrDialog()
|
||||
|
||||
/obj/machinery/microwave/proc/abort()
|
||||
src.operating = 0 // Turn it off again aferwards
|
||||
src.icon_state = "mw"
|
||||
src.updateUsrDialog()
|
||||
|
||||
/obj/machinery/microwave/proc/stop()
|
||||
playsound(src.loc, 'sound/machines/ding.ogg', 50, 1)
|
||||
src.operating = 0 // Turn it off again aferwards
|
||||
src.icon_state = "mw"
|
||||
src.updateUsrDialog()
|
||||
|
||||
/obj/machinery/microwave/proc/dispose()
|
||||
for (var/obj/O in ((contents-component_parts)-circuit))
|
||||
O.loc = src.loc
|
||||
if (src.reagents.total_volume)
|
||||
src.dirty++
|
||||
src.reagents.clear_reagents()
|
||||
usr << "<span class='notice'>You dispose of the microwave contents.</span>"
|
||||
src.updateUsrDialog()
|
||||
|
||||
/obj/machinery/microwave/proc/muck_start()
|
||||
playsound(src.loc, 'sound/effects/splat.ogg', 50, 1) // Play a splat sound
|
||||
src.icon_state = "mwbloody1" // Make it look dirty!!
|
||||
|
||||
/obj/machinery/microwave/proc/muck_finish()
|
||||
playsound(src.loc, 'sound/machines/ding.ogg', 50, 1)
|
||||
src.visible_message("<span class='warning'>The microwave gets covered in muck!</span>")
|
||||
src.dirty = 100 // Make it dirty so it can't be used util cleaned
|
||||
src.flags = null //So you can't add condiments
|
||||
src.icon_state = "mwbloody" // Make it look dirty too
|
||||
src.operating = 0 // Turn it off again aferwards
|
||||
src.updateUsrDialog()
|
||||
|
||||
/obj/machinery/microwave/proc/broke()
|
||||
var/datum/effect/effect/system/spark_spread/s = new
|
||||
s.set_up(2, 1, src)
|
||||
s.start()
|
||||
src.icon_state = "mwb" // Make it look all busted up and shit
|
||||
src.visible_message("<span class='warning'>The microwave breaks!</span>") //Let them know they're stupid
|
||||
src.broken = 2 // Make it broken so it can't be used util fixed
|
||||
src.flags = null //So you can't add condiments
|
||||
src.operating = 0 // Turn it off again aferwards
|
||||
src.updateUsrDialog()
|
||||
|
||||
/obj/machinery/microwave/proc/fail()
|
||||
var/obj/item/weapon/reagent_containers/food/snacks/badrecipe/ffuu = new(src)
|
||||
var/amount = 0
|
||||
for (var/obj/O in (((contents - ffuu) - component_parts) - circuit))
|
||||
amount++
|
||||
if (O.reagents)
|
||||
var/id = O.reagents.get_master_reagent_id()
|
||||
if (id)
|
||||
amount+=O.reagents.get_reagent_amount(id)
|
||||
qdel(O)
|
||||
src.reagents.clear_reagents()
|
||||
ffuu.reagents.add_reagent("carbon", amount)
|
||||
ffuu.reagents.add_reagent("toxin", amount/10)
|
||||
return ffuu
|
||||
|
||||
/obj/machinery/microwave/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
|
||||
usr.set_machine(src)
|
||||
if(src.operating)
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
|
||||
switch(href_list["action"])
|
||||
if ("cook")
|
||||
cook()
|
||||
|
||||
if ("dispose")
|
||||
dispose()
|
||||
return
|
||||
/obj/machinery/microwave
|
||||
name = "microwave"
|
||||
icon = 'icons/obj/kitchen.dmi'
|
||||
icon_state = "mw"
|
||||
density = 1
|
||||
anchored = 1
|
||||
use_power = 1
|
||||
idle_power_usage = 5
|
||||
active_power_usage = 100
|
||||
flags = OPENCONTAINER | NOREACT
|
||||
circuit = /obj/item/weapon/circuitboard/microwave
|
||||
var/operating = 0 // Is it on?
|
||||
var/dirty = 0 // = {0..100} Does it need cleaning?
|
||||
var/broken = 0 // ={0,1,2} How broken is it???
|
||||
var/global/list/datum/recipe/available_recipes // List of the recipes you can use
|
||||
var/global/list/acceptable_items // List of the items you can put in
|
||||
var/global/list/acceptable_reagents // List of the reagents you can put in
|
||||
var/global/max_n_of_items = 0
|
||||
|
||||
|
||||
// see code/modules/food/recipes_microwave.dm for recipes
|
||||
|
||||
/*******************
|
||||
* Initialising
|
||||
********************/
|
||||
|
||||
/obj/machinery/microwave/New()
|
||||
..()
|
||||
reagents = new/datum/reagents(100)
|
||||
reagents.my_atom = src
|
||||
|
||||
component_parts = list()
|
||||
component_parts += new /obj/item/weapon/stock_parts/console_screen(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/motor(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/capacitor(src)
|
||||
|
||||
if (!available_recipes)
|
||||
available_recipes = new
|
||||
for (var/type in (typesof(/datum/recipe)-/datum/recipe))
|
||||
available_recipes+= new type
|
||||
acceptable_items = new
|
||||
acceptable_reagents = new
|
||||
for (var/datum/recipe/recipe in available_recipes)
|
||||
for (var/item in recipe.items)
|
||||
acceptable_items |= item
|
||||
for (var/reagent in recipe.reagents)
|
||||
acceptable_reagents |= reagent
|
||||
if (recipe.items)
|
||||
max_n_of_items = max(max_n_of_items,recipe.items.len)
|
||||
// This will do until I can think of a fun recipe to use dionaea in -
|
||||
// will also allow anything using the holder item to be microwaved into
|
||||
// impure carbon. ~Z
|
||||
acceptable_items |= /obj/item/weapon/holder
|
||||
acceptable_items |= /obj/item/weapon/reagent_containers/food/snacks/grown
|
||||
|
||||
RefreshParts()
|
||||
|
||||
/*******************
|
||||
* Item Adding
|
||||
********************/
|
||||
|
||||
/obj/machinery/microwave/attackby(var/obj/item/O as obj, var/mob/user as mob)
|
||||
if(src.broken > 0)
|
||||
if(src.broken == 2 && O.is_screwdriver()) // If it's broken and they're using a screwdriver
|
||||
user.visible_message( \
|
||||
"<span class='notice'>\The [user] starts to fix part of the microwave.</span>", \
|
||||
"<span class='notice'>You start to fix part of the microwave.</span>" \
|
||||
)
|
||||
playsound(src, O.usesound, 50, 1)
|
||||
if (do_after(user,20 * O.toolspeed))
|
||||
user.visible_message( \
|
||||
"<span class='notice'>\The [user] fixes part of the microwave.</span>", \
|
||||
"<span class='notice'>You have fixed part of the microwave.</span>" \
|
||||
)
|
||||
src.broken = 1 // Fix it a bit
|
||||
else if(src.broken == 1 && O.is_wrench()) // If it's broken and they're doing the wrench
|
||||
user.visible_message( \
|
||||
"<span class='notice'>\The [user] starts to fix part of the microwave.</span>", \
|
||||
"<span class='notice'>You start to fix part of the microwave.</span>" \
|
||||
)
|
||||
if (do_after(user,20 * O.toolspeed))
|
||||
user.visible_message( \
|
||||
"<span class='notice'>\The [user] fixes the microwave.</span>", \
|
||||
"<span class='notice'>You have fixed the microwave.</span>" \
|
||||
)
|
||||
src.icon_state = "mw"
|
||||
src.broken = 0 // Fix it!
|
||||
src.dirty = 0 // just to be sure
|
||||
src.flags = OPENCONTAINER | NOREACT
|
||||
else
|
||||
to_chat(user, "<span class='warning'>It's broken!</span>")
|
||||
return 1
|
||||
else if(default_deconstruction_screwdriver(user, O))
|
||||
return
|
||||
else if(default_deconstruction_crowbar(user, O))
|
||||
return
|
||||
else if(default_unfasten_wrench(user, O, 10))
|
||||
return
|
||||
|
||||
else if(src.dirty==100) // The microwave is all dirty so can't be used!
|
||||
if(istype(O, /obj/item/weapon/reagent_containers/spray/cleaner) || istype(O, /obj/item/weapon/soap)) // If they're trying to clean it then let them
|
||||
user.visible_message( \
|
||||
"<span class='notice'>\The [user] starts to clean the microwave.</span>", \
|
||||
"<span class='notice'>You start to clean the microwave.</span>" \
|
||||
)
|
||||
if (do_after(user,20))
|
||||
user.visible_message( \
|
||||
"<span class='notice'>\The [user] has cleaned the microwave.</span>", \
|
||||
"<span class='notice'>You have cleaned the microwave.</span>" \
|
||||
)
|
||||
src.dirty = 0 // It's clean!
|
||||
src.broken = 0 // just to be sure
|
||||
src.icon_state = "mw"
|
||||
src.flags = OPENCONTAINER | NOREACT
|
||||
else //Otherwise bad luck!!
|
||||
to_chat(user, "<span class='warning'>It's dirty!</span>")
|
||||
return 1
|
||||
else if(is_type_in_list(O,acceptable_items))
|
||||
if (contents.len>=(max_n_of_items + component_parts.len + 1)) //Adds component_parts to the maximum number of items. The 1 is from the circuit
|
||||
to_chat(user, "<span class='warning'>This [src] is full of ingredients, you cannot put more.</span>")
|
||||
return 1
|
||||
if(istype(O, /obj/item/stack) && O:get_amount() > 1) // This is bad, but I can't think of how to change it
|
||||
var/obj/item/stack/S = O
|
||||
new O.type (src)
|
||||
S.use(1)
|
||||
user.visible_message( \
|
||||
"<span class='notice'>\The [user] has added one of [O] to \the [src].</span>", \
|
||||
"<span class='notice'>You add one of [O] to \the [src].</span>")
|
||||
return
|
||||
else
|
||||
// user.remove_from_mob(O) //This just causes problems so far as I can tell. -Pete
|
||||
user.drop_item()
|
||||
O.loc = src
|
||||
user.visible_message( \
|
||||
"<span class='notice'>\The [user] has added \the [O] to \the [src].</span>", \
|
||||
"<span class='notice'>You add \the [O] to \the [src].</span>")
|
||||
return
|
||||
else 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) \
|
||||
)
|
||||
if (!O.reagents)
|
||||
return 1
|
||||
for (var/datum/reagent/R in O.reagents.reagent_list)
|
||||
if (!(R.id in acceptable_reagents))
|
||||
to_chat(user, "<span class='warning'>Your [O] contains components unsuitable for cookery.</span>")
|
||||
return 1
|
||||
return
|
||||
else if(istype(O,/obj/item/weapon/grab))
|
||||
var/obj/item/weapon/grab/G = O
|
||||
to_chat(user, "<span class='warning'>This is ridiculous. You can not fit \the [G.affecting] in this [src].</span>")
|
||||
return 1
|
||||
else
|
||||
to_chat(user, "<span class='warning'>You have no idea what you can cook with this [O].</span>")
|
||||
..()
|
||||
src.updateUsrDialog()
|
||||
|
||||
/obj/machinery/microwave/attack_ai(mob/user as mob)
|
||||
if(istype(user, /mob/living/silicon/robot) && Adjacent(user))
|
||||
attack_hand(user)
|
||||
|
||||
/obj/machinery/microwave/attack_hand(mob/user as mob)
|
||||
user.set_machine(src)
|
||||
interact(user)
|
||||
|
||||
/*******************
|
||||
* Microwave Menu
|
||||
********************/
|
||||
|
||||
/obj/machinery/microwave/interact(mob/user as mob) // The microwave Menu
|
||||
var/dat = ""
|
||||
if(src.broken > 0)
|
||||
dat = {"<TT>Bzzzzttttt</TT>"}
|
||||
else if(src.operating)
|
||||
dat = {"<TT>Microwaving in progress!<BR>Please wait...!</TT>"}
|
||||
else if(src.dirty==100)
|
||||
dat = {"<TT>This microwave is dirty!<BR>Please clean it before use!</TT>"}
|
||||
else
|
||||
var/list/items_counts = new
|
||||
var/list/items_measures = new
|
||||
var/list/items_measures_p = new
|
||||
for (var/obj/O in ((contents - component_parts) - circuit))
|
||||
var/display_name = O.name
|
||||
if (istype(O,/obj/item/weapon/reagent_containers/food/snacks/egg))
|
||||
items_measures[display_name] = "egg"
|
||||
items_measures_p[display_name] = "eggs"
|
||||
if (istype(O,/obj/item/weapon/reagent_containers/food/snacks/tofu))
|
||||
items_measures[display_name] = "tofu chunk"
|
||||
items_measures_p[display_name] = "tofu chunks"
|
||||
if (istype(O,/obj/item/weapon/reagent_containers/food/snacks/meat)) //any meat
|
||||
items_measures[display_name] = "slab of meat"
|
||||
items_measures_p[display_name] = "slabs of meat"
|
||||
if (istype(O,/obj/item/weapon/reagent_containers/food/snacks/donkpocket))
|
||||
display_name = "Turnovers"
|
||||
items_measures[display_name] = "turnover"
|
||||
items_measures_p[display_name] = "turnovers"
|
||||
if (istype(O,/obj/item/weapon/reagent_containers/food/snacks/carpmeat))
|
||||
items_measures[display_name] = "fillet of meat"
|
||||
items_measures_p[display_name] = "fillets of meat"
|
||||
items_counts[display_name]++
|
||||
for (var/O in items_counts)
|
||||
var/N = items_counts[O]
|
||||
if (!(O in items_measures))
|
||||
dat += {"<B>[capitalize(O)]:</B> [N] [lowertext(O)]\s<BR>"}
|
||||
else
|
||||
if (N==1)
|
||||
dat += {"<B>[capitalize(O)]:</B> [N] [items_measures[O]]<BR>"}
|
||||
else
|
||||
dat += {"<B>[capitalize(O)]:</B> [N] [items_measures_p[O]]<BR>"}
|
||||
|
||||
for (var/datum/reagent/R in reagents.reagent_list)
|
||||
var/display_name = R.name
|
||||
if (R.id == "capsaicin")
|
||||
display_name = "Hotsauce"
|
||||
if (R.id == "frostoil")
|
||||
display_name = "Coldsauce"
|
||||
dat += {"<B>[display_name]:</B> [R.volume] unit\s<BR>"}
|
||||
|
||||
if (items_counts.len==0 && reagents.reagent_list.len==0)
|
||||
dat = {"<B>The microwave is empty</B><BR>"}
|
||||
else
|
||||
dat = {"<b>Ingredients:</b><br>[dat]"}
|
||||
dat += {"<HR><BR>\
|
||||
<A href='?src=\ref[src];action=cook'>Turn on!<BR>\
|
||||
<A href='?src=\ref[src];action=dispose'>Eject ingredients!<BR>\
|
||||
"}
|
||||
|
||||
to_chat(user, browse("<HEAD><TITLE>Microwave Controls</TITLE></HEAD><TT>[dat]</TT>", "window=microwave"))
|
||||
onclose(user, "microwave")
|
||||
return
|
||||
|
||||
|
||||
|
||||
/***********************************
|
||||
* Microwave Menu Handling/Cooking
|
||||
************************************/
|
||||
|
||||
/obj/machinery/microwave/proc/cook()
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
start()
|
||||
if (reagents.total_volume==0 && !(locate(/obj) in ((contents - component_parts) - circuit))) //dry run
|
||||
if (!wzhzhzh(10))
|
||||
abort()
|
||||
return
|
||||
stop()
|
||||
return
|
||||
|
||||
var/datum/recipe/recipe = select_recipe(available_recipes,src)
|
||||
var/obj/cooked
|
||||
if (!recipe)
|
||||
dirty += 1
|
||||
if (prob(max(10,dirty*5)))
|
||||
if (!wzhzhzh(4))
|
||||
abort()
|
||||
return
|
||||
muck_start()
|
||||
wzhzhzh(4)
|
||||
muck_finish()
|
||||
cooked = fail()
|
||||
cooked.loc = src.loc
|
||||
return
|
||||
else if (has_extra_item())
|
||||
if (!wzhzhzh(4))
|
||||
abort()
|
||||
return
|
||||
broke()
|
||||
cooked = fail()
|
||||
cooked.loc = src.loc
|
||||
return
|
||||
else
|
||||
if (!wzhzhzh(10))
|
||||
abort()
|
||||
return
|
||||
stop()
|
||||
cooked = fail()
|
||||
cooked.loc = src.loc
|
||||
return
|
||||
else
|
||||
var/halftime = round(recipe.time/10/2)
|
||||
if (!wzhzhzh(halftime))
|
||||
abort()
|
||||
return
|
||||
if (!wzhzhzh(halftime))
|
||||
abort()
|
||||
cooked = fail()
|
||||
cooked.loc = src.loc
|
||||
return
|
||||
cooked = recipe.make_food(src)
|
||||
stop()
|
||||
if(cooked)
|
||||
cooked.loc = src.loc
|
||||
return
|
||||
|
||||
/obj/machinery/microwave/proc/wzhzhzh(var/seconds as num) // Whoever named this proc is fucking literally Satan. ~ Z
|
||||
for (var/i=1 to seconds)
|
||||
if (stat & (NOPOWER|BROKEN))
|
||||
return 0
|
||||
use_power(500)
|
||||
sleep(10)
|
||||
return 1
|
||||
|
||||
/obj/machinery/microwave/proc/has_extra_item()
|
||||
for (var/obj/O in ((contents - component_parts) - circuit))
|
||||
if ( \
|
||||
!istype(O,/obj/item/weapon/reagent_containers/food) && \
|
||||
!istype(O, /obj/item/weapon/grown) \
|
||||
)
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/obj/machinery/microwave/proc/start()
|
||||
src.visible_message("<span class='notice'>The microwave turns on.</span>", "<span class='notice'>You hear a microwave.</span>")
|
||||
src.operating = 1
|
||||
src.icon_state = "mw1"
|
||||
src.updateUsrDialog()
|
||||
|
||||
/obj/machinery/microwave/proc/abort()
|
||||
src.operating = 0 // Turn it off again aferwards
|
||||
src.icon_state = "mw"
|
||||
src.updateUsrDialog()
|
||||
|
||||
/obj/machinery/microwave/proc/stop()
|
||||
playsound(src.loc, 'sound/machines/ding.ogg', 50, 1)
|
||||
src.operating = 0 // Turn it off again aferwards
|
||||
src.icon_state = "mw"
|
||||
src.updateUsrDialog()
|
||||
|
||||
/obj/machinery/microwave/proc/dispose()
|
||||
for (var/obj/O in ((contents-component_parts)-circuit))
|
||||
O.loc = src.loc
|
||||
if (src.reagents.total_volume)
|
||||
src.dirty++
|
||||
src.reagents.clear_reagents()
|
||||
usr << "<span class='notice'>You dispose of the microwave contents.</span>"
|
||||
src.updateUsrDialog()
|
||||
|
||||
/obj/machinery/microwave/proc/muck_start()
|
||||
playsound(src.loc, 'sound/effects/splat.ogg', 50, 1) // Play a splat sound
|
||||
src.icon_state = "mwbloody1" // Make it look dirty!!
|
||||
|
||||
/obj/machinery/microwave/proc/muck_finish()
|
||||
playsound(src.loc, 'sound/machines/ding.ogg', 50, 1)
|
||||
src.visible_message("<span class='warning'>The microwave gets covered in muck!</span>")
|
||||
src.dirty = 100 // Make it dirty so it can't be used util cleaned
|
||||
src.flags = null //So you can't add condiments
|
||||
src.icon_state = "mwbloody" // Make it look dirty too
|
||||
src.operating = 0 // Turn it off again aferwards
|
||||
src.updateUsrDialog()
|
||||
|
||||
/obj/machinery/microwave/proc/broke()
|
||||
var/datum/effect/effect/system/spark_spread/s = new
|
||||
s.set_up(2, 1, src)
|
||||
s.start()
|
||||
src.icon_state = "mwb" // Make it look all busted up and shit
|
||||
src.visible_message("<span class='warning'>The microwave breaks!</span>") //Let them know they're stupid
|
||||
src.broken = 2 // Make it broken so it can't be used util fixed
|
||||
src.flags = null //So you can't add condiments
|
||||
src.operating = 0 // Turn it off again aferwards
|
||||
src.updateUsrDialog()
|
||||
|
||||
/obj/machinery/microwave/proc/fail()
|
||||
var/obj/item/weapon/reagent_containers/food/snacks/badrecipe/ffuu = new(src)
|
||||
var/amount = 0
|
||||
for (var/obj/O in (((contents - ffuu) - component_parts) - circuit))
|
||||
amount++
|
||||
if (O.reagents)
|
||||
var/id = O.reagents.get_master_reagent_id()
|
||||
if (id)
|
||||
amount+=O.reagents.get_reagent_amount(id)
|
||||
qdel(O)
|
||||
src.reagents.clear_reagents()
|
||||
ffuu.reagents.add_reagent("carbon", amount)
|
||||
ffuu.reagents.add_reagent("toxin", amount/10)
|
||||
return ffuu
|
||||
|
||||
/obj/machinery/microwave/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
|
||||
usr.set_machine(src)
|
||||
if(src.operating)
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
|
||||
switch(href_list["action"])
|
||||
if ("cook")
|
||||
cook()
|
||||
|
||||
if ("dispose")
|
||||
dispose()
|
||||
return
|
||||
@@ -1,388 +1,388 @@
|
||||
/* SmartFridge. Much todo
|
||||
*/
|
||||
/obj/machinery/smartfridge
|
||||
name = "\improper SmartFridge"
|
||||
icon = 'icons/obj/vending.dmi'
|
||||
icon_state = "smartfridge"
|
||||
density = 1
|
||||
anchored = 1
|
||||
use_power = 1
|
||||
idle_power_usage = 5
|
||||
active_power_usage = 100
|
||||
flags = NOREACT
|
||||
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/list/item_records = list()
|
||||
var/datum/stored_item/currently_vending = null //What we're putting out of the machine.
|
||||
var/seconds_electrified = 0;
|
||||
var/shoot_inventory = 0
|
||||
var/locked = 0
|
||||
var/scan_id = 1
|
||||
var/is_secure = 0
|
||||
var/wrenchable = 0
|
||||
var/datum/wires/smartfridge/wires = null
|
||||
|
||||
/obj/machinery/smartfridge/secure
|
||||
is_secure = 1
|
||||
|
||||
/obj/machinery/smartfridge/New()
|
||||
..()
|
||||
if(is_secure)
|
||||
wires = new/datum/wires/smartfridge/secure(src)
|
||||
else
|
||||
wires = new/datum/wires/smartfridge(src)
|
||||
|
||||
/obj/machinery/smartfridge/Destroy()
|
||||
qdel(wires)
|
||||
for(var/A in item_records) //Get rid of item records.
|
||||
qdel(A)
|
||||
wires = null
|
||||
return ..()
|
||||
|
||||
/obj/machinery/smartfridge/proc/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 1
|
||||
return 0
|
||||
|
||||
/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"
|
||||
|
||||
/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)
|
||||
|
||||
/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
|
||||
|
||||
|
||||
/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)
|
||||
if(istype(O,/obj/item/weapon/reagent_containers/glass/))
|
||||
return 1
|
||||
if(istype(O,/obj/item/weapon/storage/pill_bottle/))
|
||||
return 1
|
||||
if(istype(O,/obj/item/weapon/reagent_containers/pill/))
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/obj/machinery/smartfridge/secure/virology
|
||||
name = "\improper Refrigerated Virus Storage"
|
||||
desc = "A refrigerated storage unit for storing viral material."
|
||||
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/))
|
||||
return 1
|
||||
if(istype(O,/obj/item/weapon/virusdish/))
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/obj/machinery/smartfridge/chemistry
|
||||
name = "\improper Smart Chemical Storage"
|
||||
desc = "A refrigerated storage unit for medicine and chemical storage."
|
||||
|
||||
/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
|
||||
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."
|
||||
|
||||
/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
|
||||
|
||||
/obj/machinery/smartfridge/drying_rack
|
||||
name = "\improper Drying Rack"
|
||||
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"
|
||||
|
||||
/obj/machinery/smartfridge/drying_rack/accept_check(var/obj/item/O as obj)
|
||||
if(istype(O, /obj/item/weapon/reagent_containers/food/snacks/))
|
||||
var/obj/item/weapon/reagent_containers/food/snacks/S = O
|
||||
if (S.dried_type)
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/obj/machinery/smartfridge/drying_rack/process()
|
||||
..()
|
||||
if(stat & (BROKEN|NOPOWER))
|
||||
return
|
||||
if(contents.len)
|
||||
dry()
|
||||
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"
|
||||
|
||||
/obj/machinery/smartfridge/drying_rack/proc/dry()
|
||||
for(var/datum/stored_item/I in item_records)
|
||||
for(var/obj/item/weapon/reagent_containers/food/snacks/S in I.instances)
|
||||
if(S.dry) continue
|
||||
if(S.dried_type == S.type)
|
||||
S.dry = 1
|
||||
S.name = "dried [S.name]"
|
||||
S.color = "#AAAAAA"
|
||||
I.instances -= S
|
||||
S.forceMove(get_turf(src))
|
||||
else
|
||||
var/D = S.dried_type
|
||||
new D(get_turf(src))
|
||||
qdel(S)
|
||||
return
|
||||
return
|
||||
|
||||
/obj/machinery/smartfridge/process()
|
||||
if(stat & (BROKEN|NOPOWER))
|
||||
return
|
||||
if(src.seconds_electrified > 0)
|
||||
src.seconds_electrified--
|
||||
if(src.shoot_inventory && prob(2))
|
||||
src.throw_item()
|
||||
|
||||
/obj/machinery/smartfridge/power_change()
|
||||
var/old_stat = stat
|
||||
..()
|
||||
if(old_stat != stat)
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/smartfridge/update_icon()
|
||||
if(stat & (BROKEN|NOPOWER))
|
||||
icon_state = icon_off
|
||||
else
|
||||
icon_state = icon_on
|
||||
|
||||
/*******************
|
||||
* Item Adding
|
||||
********************/
|
||||
|
||||
/obj/machinery/smartfridge/attackby(var/obj/item/O as obj, var/mob/user as mob)
|
||||
if(O.is_screwdriver())
|
||||
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)
|
||||
GLOB.nanomanager.update_uis(src)
|
||||
return
|
||||
|
||||
if(wrenchable && default_unfasten_wrench(user, O, 20))
|
||||
return
|
||||
|
||||
if(istype(O, /obj/item/device/multitool) || O.is_wirecutter())
|
||||
if(panel_open)
|
||||
attack_hand(user)
|
||||
return
|
||||
|
||||
if(stat & NOPOWER)
|
||||
to_chat(user, "<span class='notice'>\The [src] is unpowered and useless.</span>")
|
||||
return
|
||||
|
||||
if(accept_check(O))
|
||||
user.remove_from_mob(O)
|
||||
stock(O)
|
||||
user.visible_message("<span class='notice'>[user] has added \the [O] to \the [src].</span>", "<span class='notice'>You add \the [O] to \the [src].</span>")
|
||||
|
||||
|
||||
else if(istype(O, /obj/item/weapon/storage/bag))
|
||||
var/obj/item/weapon/storage/bag/P = O
|
||||
var/plants_loaded = 0
|
||||
for(var/obj/G in P.contents)
|
||||
if(accept_check(G))
|
||||
P.remove_from_storage(G) //fixes ui bug - Pull Request 5515
|
||||
stock(G)
|
||||
plants_loaded = 1
|
||||
if(plants_loaded)
|
||||
user.visible_message("<span class='notice'>[user] loads \the [src] with \the [P].</span>", "<span class='notice'>You load \the [src] with \the [P].</span>")
|
||||
if(P.contents.len > 0)
|
||||
to_chat(user, "<span class='notice'>Some items are refused.</span>")
|
||||
|
||||
else if(istype(O, /obj/item/weapon/gripper)) // Grippers. ~Mechoid.
|
||||
var/obj/item/weapon/gripper/B = O //B, for Borg.
|
||||
if(!B.wrapped)
|
||||
to_chat(user, "\The [B] is not holding anything.")
|
||||
return
|
||||
else
|
||||
var/B_held = B.wrapped
|
||||
to_chat(user, "You use \the [B] to put \the [B_held] into \the [src].")
|
||||
return
|
||||
|
||||
else
|
||||
to_chat(user, "<span class='notice'>\The [src] smartly refuses [O].</span>")
|
||||
return 1
|
||||
|
||||
/obj/machinery/smartfridge/secure/emag_act(var/remaining_charges, var/mob/user)
|
||||
if(!emagged)
|
||||
emagged = 1
|
||||
locked = -1
|
||||
to_chat(user, "You short out the product lock on [src].")
|
||||
return 1
|
||||
|
||||
/obj/machinery/smartfridge/proc/stock(obj/item/O)
|
||||
var/hasRecord = FALSE //Check to see if this passes or not.
|
||||
for(var/datum/stored_item/I in item_records)
|
||||
if((O.type == I.item_path) && (O.name == I.item_name))
|
||||
I.add_product(O)
|
||||
hasRecord = TRUE
|
||||
break
|
||||
if(!hasRecord)
|
||||
var/datum/stored_item/item = new/datum/stored_item(src, O.type, O.name)
|
||||
item.add_product(O)
|
||||
item_records.Add(item)
|
||||
GLOB.nanomanager.update_uis(src)
|
||||
|
||||
/obj/machinery/smartfridge/proc/vend(datum/stored_item/I)
|
||||
I.get_product(get_turf(src))
|
||||
GLOB.nanomanager.update_uis(src)
|
||||
|
||||
/obj/machinery/smartfridge/attack_ai(mob/user as mob)
|
||||
attack_hand(user)
|
||||
|
||||
/obj/machinery/smartfridge/attack_hand(mob/user as mob)
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
wires.Interact(user)
|
||||
ui_interact(user)
|
||||
|
||||
/*******************
|
||||
* SmartFridge Menu
|
||||
********************/
|
||||
|
||||
/obj/machinery/smartfridge/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1)
|
||||
user.set_machine(src)
|
||||
|
||||
var/data[0]
|
||||
data["contents"] = null
|
||||
data["electrified"] = seconds_electrified > 0
|
||||
data["shoot_inventory"] = shoot_inventory
|
||||
data["locked"] = locked
|
||||
data["secure"] = is_secure
|
||||
|
||||
var/list/items[0]
|
||||
for (var/i=1 to length(item_records))
|
||||
var/datum/stored_item/I = item_records[i]
|
||||
var/count = I.get_amount()
|
||||
if(count > 0)
|
||||
items.Add(list(list("display_name" = html_encode(capitalize(I.item_name)), "vend" = i, "quantity" = count)))
|
||||
|
||||
if(items.len > 0)
|
||||
data["contents"] = items
|
||||
|
||||
ui = GLOB.nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "smartfridge.tmpl", src.name, 400, 500)
|
||||
ui.set_initial_data(data)
|
||||
ui.open()
|
||||
|
||||
/obj/machinery/smartfridge/Topic(href, href_list)
|
||||
if(..()) return 0
|
||||
|
||||
var/mob/user = usr
|
||||
var/datum/nanoui/ui = GLOB.nanomanager.get_open_ui(user, src, "main")
|
||||
|
||||
src.add_fingerprint(user)
|
||||
|
||||
if(href_list["close"])
|
||||
user.unset_machine()
|
||||
ui.close()
|
||||
return 0
|
||||
|
||||
if(href_list["vend"])
|
||||
var/index = text2num(href_list["vend"])
|
||||
var/amount = text2num(href_list["amount"])
|
||||
var/datum/stored_item/I = item_records[index]
|
||||
var/count = I.get_amount()
|
||||
|
||||
// Sanity check, there are probably ways to press the button when it shouldn't be possible.
|
||||
if(count > 0)
|
||||
if((count - amount) < 0)
|
||||
amount = count
|
||||
for(var/i = 1 to amount)
|
||||
vend(I)
|
||||
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/obj/machinery/smartfridge/proc/throw_item()
|
||||
var/obj/throw_item = null
|
||||
var/mob/living/target = locate() in view(7,src)
|
||||
if(!target)
|
||||
return 0
|
||||
|
||||
for(var/datum/stored_item/I in item_records)
|
||||
throw_item = I.get_product(get_turf(src))
|
||||
if (!throw_item)
|
||||
continue
|
||||
break
|
||||
|
||||
if(!throw_item)
|
||||
return 0
|
||||
spawn(0)
|
||||
throw_item.throw_at(target,16,3,src)
|
||||
src.visible_message("<span class='warning'>[src] launches [throw_item.name] at [target.name]!</span>")
|
||||
return 1
|
||||
|
||||
/************************
|
||||
* Secure SmartFridges
|
||||
*************************/
|
||||
|
||||
/obj/machinery/smartfridge/secure/Topic(href, href_list)
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return 0
|
||||
if(usr.contents.Find(src) || (in_range(src, usr) && istype(loc, /turf)))
|
||||
if(!allowed(usr) && !emagged && locked != -1 && href_list["vend"])
|
||||
to_chat(usr, "<span class='warning'>Access denied.</span>")
|
||||
return 0
|
||||
return ..()
|
||||
/* SmartFridge. Much todo
|
||||
*/
|
||||
/obj/machinery/smartfridge
|
||||
name = "\improper SmartFridge"
|
||||
icon = 'icons/obj/vending.dmi'
|
||||
icon_state = "smartfridge"
|
||||
density = 1
|
||||
anchored = 1
|
||||
use_power = 1
|
||||
idle_power_usage = 5
|
||||
active_power_usage = 100
|
||||
flags = NOREACT
|
||||
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/list/item_records = list()
|
||||
var/datum/stored_item/currently_vending = null //What we're putting out of the machine.
|
||||
var/seconds_electrified = 0;
|
||||
var/shoot_inventory = 0
|
||||
var/locked = 0
|
||||
var/scan_id = 1
|
||||
var/is_secure = 0
|
||||
var/wrenchable = 0
|
||||
var/datum/wires/smartfridge/wires = null
|
||||
|
||||
/obj/machinery/smartfridge/secure
|
||||
is_secure = 1
|
||||
|
||||
/obj/machinery/smartfridge/New()
|
||||
..()
|
||||
if(is_secure)
|
||||
wires = new/datum/wires/smartfridge/secure(src)
|
||||
else
|
||||
wires = new/datum/wires/smartfridge(src)
|
||||
|
||||
/obj/machinery/smartfridge/Destroy()
|
||||
qdel(wires)
|
||||
for(var/A in item_records) //Get rid of item records.
|
||||
qdel(A)
|
||||
wires = null
|
||||
return ..()
|
||||
|
||||
/obj/machinery/smartfridge/proc/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 1
|
||||
return 0
|
||||
|
||||
/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"
|
||||
|
||||
/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)
|
||||
|
||||
/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
|
||||
|
||||
|
||||
/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)
|
||||
if(istype(O,/obj/item/weapon/reagent_containers/glass/))
|
||||
return 1
|
||||
if(istype(O,/obj/item/weapon/storage/pill_bottle/))
|
||||
return 1
|
||||
if(istype(O,/obj/item/weapon/reagent_containers/pill/))
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/obj/machinery/smartfridge/secure/virology
|
||||
name = "\improper Refrigerated Virus Storage"
|
||||
desc = "A refrigerated storage unit for storing viral material."
|
||||
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/))
|
||||
return 1
|
||||
if(istype(O,/obj/item/weapon/virusdish/))
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/obj/machinery/smartfridge/chemistry
|
||||
name = "\improper Smart Chemical Storage"
|
||||
desc = "A refrigerated storage unit for medicine and chemical storage."
|
||||
|
||||
/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
|
||||
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."
|
||||
|
||||
/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
|
||||
|
||||
/obj/machinery/smartfridge/drying_rack
|
||||
name = "\improper Drying Rack"
|
||||
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"
|
||||
|
||||
/obj/machinery/smartfridge/drying_rack/accept_check(var/obj/item/O as obj)
|
||||
if(istype(O, /obj/item/weapon/reagent_containers/food/snacks/))
|
||||
var/obj/item/weapon/reagent_containers/food/snacks/S = O
|
||||
if (S.dried_type)
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/obj/machinery/smartfridge/drying_rack/process()
|
||||
..()
|
||||
if(stat & (BROKEN|NOPOWER))
|
||||
return
|
||||
if(contents.len)
|
||||
dry()
|
||||
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"
|
||||
|
||||
/obj/machinery/smartfridge/drying_rack/proc/dry()
|
||||
for(var/datum/stored_item/I in item_records)
|
||||
for(var/obj/item/weapon/reagent_containers/food/snacks/S in I.instances)
|
||||
if(S.dry) continue
|
||||
if(S.dried_type == S.type)
|
||||
S.dry = 1
|
||||
S.name = "dried [S.name]"
|
||||
S.color = "#AAAAAA"
|
||||
I.instances -= S
|
||||
S.forceMove(get_turf(src))
|
||||
else
|
||||
var/D = S.dried_type
|
||||
new D(get_turf(src))
|
||||
qdel(S)
|
||||
return
|
||||
return
|
||||
|
||||
/obj/machinery/smartfridge/process()
|
||||
if(stat & (BROKEN|NOPOWER))
|
||||
return
|
||||
if(src.seconds_electrified > 0)
|
||||
src.seconds_electrified--
|
||||
if(src.shoot_inventory && prob(2))
|
||||
src.throw_item()
|
||||
|
||||
/obj/machinery/smartfridge/power_change()
|
||||
var/old_stat = stat
|
||||
..()
|
||||
if(old_stat != stat)
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/smartfridge/update_icon()
|
||||
if(stat & (BROKEN|NOPOWER))
|
||||
icon_state = icon_off
|
||||
else
|
||||
icon_state = icon_on
|
||||
|
||||
/*******************
|
||||
* Item Adding
|
||||
********************/
|
||||
|
||||
/obj/machinery/smartfridge/attackby(var/obj/item/O as obj, var/mob/user as mob)
|
||||
if(O.is_screwdriver())
|
||||
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)
|
||||
GLOB.nanomanager.update_uis(src)
|
||||
return
|
||||
|
||||
if(wrenchable && default_unfasten_wrench(user, O, 20))
|
||||
return
|
||||
|
||||
if(istype(O, /obj/item/device/multitool) || O.is_wirecutter())
|
||||
if(panel_open)
|
||||
attack_hand(user)
|
||||
return
|
||||
|
||||
if(stat & NOPOWER)
|
||||
to_chat(user, "<span class='notice'>\The [src] is unpowered and useless.</span>")
|
||||
return
|
||||
|
||||
if(accept_check(O))
|
||||
user.remove_from_mob(O)
|
||||
stock(O)
|
||||
user.visible_message("<span class='notice'>[user] has added \the [O] to \the [src].</span>", "<span class='notice'>You add \the [O] to \the [src].</span>")
|
||||
|
||||
|
||||
else if(istype(O, /obj/item/weapon/storage/bag))
|
||||
var/obj/item/weapon/storage/bag/P = O
|
||||
var/plants_loaded = 0
|
||||
for(var/obj/G in P.contents)
|
||||
if(accept_check(G))
|
||||
P.remove_from_storage(G) //fixes ui bug - Pull Request 5515
|
||||
stock(G)
|
||||
plants_loaded = 1
|
||||
if(plants_loaded)
|
||||
user.visible_message("<span class='notice'>[user] loads \the [src] with \the [P].</span>", "<span class='notice'>You load \the [src] with \the [P].</span>")
|
||||
if(P.contents.len > 0)
|
||||
to_chat(user, "<span class='notice'>Some items are refused.</span>")
|
||||
|
||||
else if(istype(O, /obj/item/weapon/gripper)) // Grippers. ~Mechoid.
|
||||
var/obj/item/weapon/gripper/B = O //B, for Borg.
|
||||
if(!B.wrapped)
|
||||
to_chat(user, "\The [B] is not holding anything.")
|
||||
return
|
||||
else
|
||||
var/B_held = B.wrapped
|
||||
to_chat(user, "You use \the [B] to put \the [B_held] into \the [src].")
|
||||
return
|
||||
|
||||
else
|
||||
to_chat(user, "<span class='notice'>\The [src] smartly refuses [O].</span>")
|
||||
return 1
|
||||
|
||||
/obj/machinery/smartfridge/secure/emag_act(var/remaining_charges, var/mob/user)
|
||||
if(!emagged)
|
||||
emagged = 1
|
||||
locked = -1
|
||||
to_chat(user, "You short out the product lock on [src].")
|
||||
return 1
|
||||
|
||||
/obj/machinery/smartfridge/proc/stock(obj/item/O)
|
||||
var/hasRecord = FALSE //Check to see if this passes or not.
|
||||
for(var/datum/stored_item/I in item_records)
|
||||
if((O.type == I.item_path) && (O.name == I.item_name))
|
||||
I.add_product(O)
|
||||
hasRecord = TRUE
|
||||
break
|
||||
if(!hasRecord)
|
||||
var/datum/stored_item/item = new/datum/stored_item(src, O.type, O.name)
|
||||
item.add_product(O)
|
||||
item_records.Add(item)
|
||||
GLOB.nanomanager.update_uis(src)
|
||||
|
||||
/obj/machinery/smartfridge/proc/vend(datum/stored_item/I)
|
||||
I.get_product(get_turf(src))
|
||||
GLOB.nanomanager.update_uis(src)
|
||||
|
||||
/obj/machinery/smartfridge/attack_ai(mob/user as mob)
|
||||
attack_hand(user)
|
||||
|
||||
/obj/machinery/smartfridge/attack_hand(mob/user as mob)
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
wires.Interact(user)
|
||||
ui_interact(user)
|
||||
|
||||
/*******************
|
||||
* SmartFridge Menu
|
||||
********************/
|
||||
|
||||
/obj/machinery/smartfridge/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1)
|
||||
user.set_machine(src)
|
||||
|
||||
var/data[0]
|
||||
data["contents"] = null
|
||||
data["electrified"] = seconds_electrified > 0
|
||||
data["shoot_inventory"] = shoot_inventory
|
||||
data["locked"] = locked
|
||||
data["secure"] = is_secure
|
||||
|
||||
var/list/items[0]
|
||||
for (var/i=1 to length(item_records))
|
||||
var/datum/stored_item/I = item_records[i]
|
||||
var/count = I.get_amount()
|
||||
if(count > 0)
|
||||
items.Add(list(list("display_name" = html_encode(capitalize(I.item_name)), "vend" = i, "quantity" = count)))
|
||||
|
||||
if(items.len > 0)
|
||||
data["contents"] = items
|
||||
|
||||
ui = GLOB.nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "smartfridge.tmpl", src.name, 400, 500)
|
||||
ui.set_initial_data(data)
|
||||
ui.open()
|
||||
|
||||
/obj/machinery/smartfridge/Topic(href, href_list)
|
||||
if(..()) return 0
|
||||
|
||||
var/mob/user = usr
|
||||
var/datum/nanoui/ui = GLOB.nanomanager.get_open_ui(user, src, "main")
|
||||
|
||||
src.add_fingerprint(user)
|
||||
|
||||
if(href_list["close"])
|
||||
user.unset_machine()
|
||||
ui.close()
|
||||
return 0
|
||||
|
||||
if(href_list["vend"])
|
||||
var/index = text2num(href_list["vend"])
|
||||
var/amount = text2num(href_list["amount"])
|
||||
var/datum/stored_item/I = item_records[index]
|
||||
var/count = I.get_amount()
|
||||
|
||||
// Sanity check, there are probably ways to press the button when it shouldn't be possible.
|
||||
if(count > 0)
|
||||
if((count - amount) < 0)
|
||||
amount = count
|
||||
for(var/i = 1 to amount)
|
||||
vend(I)
|
||||
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/obj/machinery/smartfridge/proc/throw_item()
|
||||
var/obj/throw_item = null
|
||||
var/mob/living/target = locate() in view(7,src)
|
||||
if(!target)
|
||||
return 0
|
||||
|
||||
for(var/datum/stored_item/I in item_records)
|
||||
throw_item = I.get_product(get_turf(src))
|
||||
if (!throw_item)
|
||||
continue
|
||||
break
|
||||
|
||||
if(!throw_item)
|
||||
return 0
|
||||
spawn(0)
|
||||
throw_item.throw_at(target,16,3,src)
|
||||
src.visible_message("<span class='warning'>[src] launches [throw_item.name] at [target.name]!</span>")
|
||||
return 1
|
||||
|
||||
/************************
|
||||
* Secure SmartFridges
|
||||
*************************/
|
||||
|
||||
/obj/machinery/smartfridge/secure/Topic(href, href_list)
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return 0
|
||||
if(usr.contents.Find(src) || (in_range(src, usr) && istype(loc, /turf)))
|
||||
if(!allowed(usr) && !emagged && locked != -1 && href_list["vend"])
|
||||
to_chat(usr, "<span class='warning'>Access denied.</span>")
|
||||
return 0
|
||||
return ..()
|
||||
63
polaris.dme
63
polaris.dme
@@ -753,17 +753,6 @@
|
||||
#include "code\game\machinery\embedded_controller\embedded_controller_base.dm"
|
||||
#include "code\game\machinery\embedded_controller\embedded_program_base.dm"
|
||||
#include "code\game\machinery\embedded_controller\simple_docking_controller.dm"
|
||||
#include "code\game\machinery\kitchen\gibber.dm"
|
||||
#include "code\game\machinery\kitchen\icecream.dm"
|
||||
#include "code\game\machinery\kitchen\microwave.dm"
|
||||
#include "code\game\machinery\kitchen\smartfridge.dm"
|
||||
#include "code\game\machinery\kitchen\cooking_machines\_cooker.dm"
|
||||
#include "code\game\machinery\kitchen\cooking_machines\_cooker_output.dm"
|
||||
#include "code\game\machinery\kitchen\cooking_machines\candy.dm"
|
||||
#include "code\game\machinery\kitchen\cooking_machines\cereal.dm"
|
||||
#include "code\game\machinery\kitchen\cooking_machines\fryer.dm"
|
||||
#include "code\game\machinery\kitchen\cooking_machines\grill.dm"
|
||||
#include "code\game\machinery\kitchen\cooking_machines\oven.dm"
|
||||
#include "code\game\machinery\pipe\construction.dm"
|
||||
#include "code\game\machinery\pipe\pipe_dispenser.dm"
|
||||
#include "code\game\machinery\pipe\pipe_recipes.dm"
|
||||
@@ -1562,8 +1551,40 @@
|
||||
#include "code\modules\flufftext\Hallucination.dm"
|
||||
#include "code\modules\flufftext\look_up.dm"
|
||||
#include "code\modules\flufftext\TextFilters.dm"
|
||||
#include "code\modules\food\food.dm"
|
||||
#include "code\modules\food\recipe_dump.dm"
|
||||
#include "code\modules\food\recipes_microwave.dm"
|
||||
#include "code\modules\food\drinkingglass\drinkingglass.dm"
|
||||
#include "code\modules\food\drinkingglass\extras.dm"
|
||||
#include "code\modules\food\drinkingglass\glass_boxes.dm"
|
||||
#include "code\modules\food\drinkingglass\glass_types.dm"
|
||||
#include "code\modules\food\drinkingglass\metaglass.dm"
|
||||
#include "code\modules\food\drinkingglass\shaker.dm"
|
||||
#include "code\modules\food\food\cans.dm"
|
||||
#include "code\modules\food\food\condiment.dm"
|
||||
#include "code\modules\food\food\drinks.dm"
|
||||
#include "code\modules\food\food\lunch.dm"
|
||||
#include "code\modules\food\food\sandwich.dm"
|
||||
#include "code\modules\food\food\snacks.dm"
|
||||
#include "code\modules\food\food\drinks\bottle.dm"
|
||||
#include "code\modules\food\food\drinks\cup.dm"
|
||||
#include "code\modules\food\food\drinks\drinkingglass.dm"
|
||||
#include "code\modules\food\food\drinks\jar.dm"
|
||||
#include "code\modules\food\food\drinks\bottle\robot.dm"
|
||||
#include "code\modules\food\food\snacks\meat.dm"
|
||||
#include "code\modules\food\glass\bottle.dm"
|
||||
#include "code\modules\food\glass\bottle\robot.dm"
|
||||
#include "code\modules\food\kitchen\gibber.dm"
|
||||
#include "code\modules\food\kitchen\icecream.dm"
|
||||
#include "code\modules\food\kitchen\microwave.dm"
|
||||
#include "code\modules\food\kitchen\smartfridge.dm"
|
||||
#include "code\modules\food\kitchen\cooking_machines\_cooker.dm"
|
||||
#include "code\modules\food\kitchen\cooking_machines\_cooker_output.dm"
|
||||
#include "code\modules\food\kitchen\cooking_machines\candy.dm"
|
||||
#include "code\modules\food\kitchen\cooking_machines\cereal.dm"
|
||||
#include "code\modules\food\kitchen\cooking_machines\fryer.dm"
|
||||
#include "code\modules\food\kitchen\cooking_machines\grill.dm"
|
||||
#include "code\modules\food\kitchen\cooking_machines\oven.dm"
|
||||
#include "code\modules\gamemaster\controller.dm"
|
||||
#include "code\modules\gamemaster\defines.dm"
|
||||
#include "code\modules\gamemaster\game_master.dm"
|
||||
@@ -2248,31 +2269,11 @@
|
||||
#include "code\modules\reagents\reagent_containers\blood_pack.dm"
|
||||
#include "code\modules\reagents\reagent_containers\borghydro.dm"
|
||||
#include "code\modules\reagents\reagent_containers\dropper.dm"
|
||||
#include "code\modules\reagents\reagent_containers\food.dm"
|
||||
#include "code\modules\reagents\reagent_containers\glass.dm"
|
||||
#include "code\modules\reagents\reagent_containers\hypospray.dm"
|
||||
#include "code\modules\reagents\reagent_containers\pill.dm"
|
||||
#include "code\modules\reagents\reagent_containers\spray.dm"
|
||||
#include "code\modules\reagents\reagent_containers\syringes.dm"
|
||||
#include "code\modules\reagents\reagent_containers\drinkingglass\drinkingglass.dm"
|
||||
#include "code\modules\reagents\reagent_containers\drinkingglass\extras.dm"
|
||||
#include "code\modules\reagents\reagent_containers\drinkingglass\glass_boxes.dm"
|
||||
#include "code\modules\reagents\reagent_containers\drinkingglass\glass_types.dm"
|
||||
#include "code\modules\reagents\reagent_containers\drinkingglass\metaglass.dm"
|
||||
#include "code\modules\reagents\reagent_containers\drinkingglass\shaker.dm"
|
||||
#include "code\modules\reagents\reagent_containers\food\cans.dm"
|
||||
#include "code\modules\reagents\reagent_containers\food\condiment.dm"
|
||||
#include "code\modules\reagents\reagent_containers\food\drinks.dm"
|
||||
#include "code\modules\reagents\reagent_containers\food\lunch.dm"
|
||||
#include "code\modules\reagents\reagent_containers\food\sandwich.dm"
|
||||
#include "code\modules\reagents\reagent_containers\food\snacks.dm"
|
||||
#include "code\modules\reagents\reagent_containers\food\drinks\bottle.dm"
|
||||
#include "code\modules\reagents\reagent_containers\food\drinks\cup.dm"
|
||||
#include "code\modules\reagents\reagent_containers\food\drinks\jar.dm"
|
||||
#include "code\modules\reagents\reagent_containers\food\drinks\bottle\robot.dm"
|
||||
#include "code\modules\reagents\reagent_containers\food\snacks\meat.dm"
|
||||
#include "code\modules\reagents\reagent_containers\glass\bottle.dm"
|
||||
#include "code\modules\reagents\reagent_containers\glass\bottle\robot.dm"
|
||||
#include "code\modules\recycling\conveyor2.dm"
|
||||
#include "code\modules\recycling\disposal-construction.dm"
|
||||
#include "code\modules\recycling\disposal.dm"
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
4a21477a8bedf5b1a1eed6cf751e9a74cd10778d
|
||||
Binary file not shown.
Reference in New Issue
Block a user