Move almost everythign food related into the kitchen module.

Not moving reagents and tools.
This commit is contained in:
lbnesquik
2018-10-05 02:56:36 +02:00
parent b32583c6ae
commit 5641b828c5
35 changed files with 6426 additions and 6424 deletions

View File

@@ -1,38 +1,38 @@
#define CELLS 8 #define CELLS 8
#define CELLSIZE (32/CELLS) #define CELLSIZE (32/CELLS)
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
/// Food. /// Food.
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
/obj/item/weapon/reagent_containers/food /obj/item/weapon/reagent_containers/food
possible_transfer_amounts = null possible_transfer_amounts = null
volume = 50 //Sets the default container amount for all food items. volume = 50 //Sets the default container amount for all food items.
var/filling_color = "#FFFFFF" //Used by sandwiches. var/filling_color = "#FFFFFF" //Used by sandwiches.
var/list/center_of_mass = list() // Used for table placement var/list/center_of_mass = list() // Used for table placement
/obj/item/weapon/reagent_containers/food/New() /obj/item/weapon/reagent_containers/food/New()
..() ..()
if (center_of_mass.len && !pixel_x && !pixel_y) if (center_of_mass.len && !pixel_x && !pixel_y)
src.pixel_x = rand(-6.0, 6) //Randomizes postion src.pixel_x = rand(-6.0, 6) //Randomizes postion
src.pixel_y = rand(-6.0, 6) src.pixel_y = rand(-6.0, 6)
/obj/item/weapon/reagent_containers/food/afterattack(atom/A, mob/user, proximity, params) /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)) if(center_of_mass.len && proximity && params && istype(A, /obj/structure/table))
//Places the item on a grid //Places the item on a grid
var/list/mouse_control = params2list(params) var/list/mouse_control = params2list(params)
var/mouse_x = text2num(mouse_control["icon-x"]) var/mouse_x = text2num(mouse_control["icon-x"])
var/mouse_y = text2num(mouse_control["icon-y"]) var/mouse_y = text2num(mouse_control["icon-y"])
if(!isnum(mouse_x) || !isnum(mouse_y)) if(!isnum(mouse_x) || !isnum(mouse_y))
return return
var/cell_x = max(0, min(CELLS-1, round(mouse_x/CELLSIZE))) var/cell_x = max(0, min(CELLS-1, round(mouse_x/CELLSIZE)))
var/cell_y = max(0, min(CELLS-1, round(mouse_y/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_x = (CELLSIZE * (0.5 + cell_x)) - center_of_mass["x"]
pixel_y = (CELLSIZE * (0.5 + cell_y)) - center_of_mass["y"] pixel_y = (CELLSIZE * (0.5 + cell_y)) - center_of_mass["y"]
#undef CELLS #undef CELLS
#undef CELLSIZE #undef CELLSIZE

View File

@@ -1,178 +1,178 @@
///////////////////////////////////////////////Condiments ///////////////////////////////////////////////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 //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 // 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. // 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. //Food items that aren't eaten normally and leave an empty container behind.
/obj/item/weapon/reagent_containers/food/condiment /obj/item/weapon/reagent_containers/food/condiment
name = "Condiment Container" name = "Condiment Container"
desc = "Just your average condiment container." desc = "Just your average condiment container."
icon = 'icons/obj/food.dmi' icon = 'icons/obj/food.dmi'
icon_state = "emptycondiment" icon_state = "emptycondiment"
flags = OPENCONTAINER flags = OPENCONTAINER
possible_transfer_amounts = list(1,5,10) possible_transfer_amounts = list(1,5,10)
center_of_mass = list("x"=16, "y"=6) center_of_mass = list("x"=16, "y"=6)
volume = 50 volume = 50
/obj/item/weapon/reagent_containers/food/condiment/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob) /obj/item/weapon/reagent_containers/food/condiment/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
return return
/obj/item/weapon/reagent_containers/food/condiment/attack_self(var/mob/user as mob) /obj/item/weapon/reagent_containers/food/condiment/attack_self(var/mob/user as mob)
return return
/obj/item/weapon/reagent_containers/food/condiment/attack(var/mob/M as mob, var/mob/user as mob, var/def_zone) /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)) if(standard_feed_mob(user, M))
return return
/obj/item/weapon/reagent_containers/food/condiment/afterattack(var/obj/target, var/mob/user, var/flag) /obj/item/weapon/reagent_containers/food/condiment/afterattack(var/obj/target, var/mob/user, var/flag)
if(standard_dispenser_refill(user, target)) if(standard_dispenser_refill(user, target))
return return
if(standard_pour_into(user, target)) if(standard_pour_into(user, target))
return return
if(istype(target, /obj/item/weapon/reagent_containers/food/snacks)) // These are not opencontainers but we can transfer to them 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) if(!reagents || !reagents.total_volume)
user << "<span class='notice'>There is no condiment left in \the [src].</span>" user << "<span class='notice'>There is no condiment left in \the [src].</span>"
return return
if(!target.reagents.get_free_space()) if(!target.reagents.get_free_space())
user << "<span class='notice'>You can't add more condiment to \the [target].</span>" user << "<span class='notice'>You can't add more condiment to \the [target].</span>"
return return
var/trans = reagents.trans_to_obj(target, amount_per_transfer_from_this) 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>" user << "<span class='notice'>You add [trans] units of the condiment to \the [target].</span>"
else else
..() ..()
/obj/item/weapon/reagent_containers/food/condiment/feed_sound(var/mob/user) /obj/item/weapon/reagent_containers/food/condiment/feed_sound(var/mob/user)
playsound(user.loc, 'sound/items/drink.ogg', rand(10, 50), 1) playsound(user.loc, 'sound/items/drink.ogg', rand(10, 50), 1)
/obj/item/weapon/reagent_containers/food/condiment/self_feed_message(var/mob/user) /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>" user << "<span class='notice'>You swallow some of contents of \the [src].</span>"
/obj/item/weapon/reagent_containers/food/condiment/on_reagent_change() /obj/item/weapon/reagent_containers/food/condiment/on_reagent_change()
if(reagents.reagent_list.len > 0) if(reagents.reagent_list.len > 0)
switch(reagents.get_master_reagent_id()) switch(reagents.get_master_reagent_id())
if("ketchup") if("ketchup")
name = "Ketchup" name = "Ketchup"
desc = "You feel more American already." desc = "You feel more American already."
icon_state = "ketchup" icon_state = "ketchup"
center_of_mass = list("x"=16, "y"=6) center_of_mass = list("x"=16, "y"=6)
if("capsaicin") if("capsaicin")
name = "Hotsauce" name = "Hotsauce"
desc = "You can almost TASTE the stomach ulcers now!" desc = "You can almost TASTE the stomach ulcers now!"
icon_state = "hotsauce" icon_state = "hotsauce"
center_of_mass = list("x"=16, "y"=6) center_of_mass = list("x"=16, "y"=6)
if("enzyme") if("enzyme")
name = "Universal Enzyme" name = "Universal Enzyme"
desc = "Used in cooking various dishes." desc = "Used in cooking various dishes."
icon_state = "enzyme" icon_state = "enzyme"
center_of_mass = list("x"=16, "y"=6) center_of_mass = list("x"=16, "y"=6)
if("soysauce") if("soysauce")
name = "Soy Sauce" name = "Soy Sauce"
desc = "A salty soy-based flavoring." desc = "A salty soy-based flavoring."
icon_state = "soysauce" icon_state = "soysauce"
center_of_mass = list("x"=16, "y"=6) center_of_mass = list("x"=16, "y"=6)
if("frostoil") if("frostoil")
name = "Coldsauce" name = "Coldsauce"
desc = "Leaves the tongue numb in its passage." desc = "Leaves the tongue numb in its passage."
icon_state = "coldsauce" icon_state = "coldsauce"
center_of_mass = list("x"=16, "y"=6) center_of_mass = list("x"=16, "y"=6)
if("sodiumchloride") if("sodiumchloride")
name = "Salt Shaker" name = "Salt Shaker"
desc = "Salt. From space oceans, presumably." desc = "Salt. From space oceans, presumably."
icon_state = "saltshaker" icon_state = "saltshaker"
center_of_mass = list("x"=16, "y"=10) center_of_mass = list("x"=16, "y"=10)
if("blackpepper") if("blackpepper")
name = "Pepper Mill" name = "Pepper Mill"
desc = "Often used to flavor food or make people sneeze." desc = "Often used to flavor food or make people sneeze."
icon_state = "peppermillsmall" icon_state = "peppermillsmall"
center_of_mass = list("x"=16, "y"=10) center_of_mass = list("x"=16, "y"=10)
if("cornoil") if("cornoil")
name = "Corn Oil" name = "Corn Oil"
desc = "A delicious oil used in cooking. Made from corn." desc = "A delicious oil used in cooking. Made from corn."
icon_state = "oliveoil" icon_state = "oliveoil"
center_of_mass = list("x"=16, "y"=6) center_of_mass = list("x"=16, "y"=6)
if("sugar") if("sugar")
name = "Sugar" name = "Sugar"
desc = "Tastey space sugar!" desc = "Tastey space sugar!"
center_of_mass = list("x"=16, "y"=6) center_of_mass = list("x"=16, "y"=6)
else else
name = "Misc Condiment Bottle" name = "Misc Condiment Bottle"
if (reagents.reagent_list.len==1) if (reagents.reagent_list.len==1)
desc = "Looks like it is [reagents.get_master_reagent_name()], but you are not sure." desc = "Looks like it is [reagents.get_master_reagent_name()], but you are not sure."
else else
desc = "A mixture of various condiments. [reagents.get_master_reagent_name()] is one of them." desc = "A mixture of various condiments. [reagents.get_master_reagent_name()] is one of them."
icon_state = "mixedcondiments" icon_state = "mixedcondiments"
center_of_mass = list("x"=16, "y"=6) center_of_mass = list("x"=16, "y"=6)
else else
icon_state = "emptycondiment" icon_state = "emptycondiment"
name = "Condiment Bottle" name = "Condiment Bottle"
desc = "An empty condiment bottle." desc = "An empty condiment bottle."
center_of_mass = list("x"=16, "y"=6) center_of_mass = list("x"=16, "y"=6)
return return
/obj/item/weapon/reagent_containers/food/condiment/enzyme /obj/item/weapon/reagent_containers/food/condiment/enzyme
name = "Universal Enzyme" name = "Universal Enzyme"
desc = "Used in cooking various dishes." desc = "Used in cooking various dishes."
icon_state = "enzyme" icon_state = "enzyme"
/obj/item/weapon/reagent_containers/food/condiment/enzyme/New() /obj/item/weapon/reagent_containers/food/condiment/enzyme/New()
..() ..()
reagents.add_reagent("enzyme", 50) reagents.add_reagent("enzyme", 50)
/obj/item/weapon/reagent_containers/food/condiment/sugar/New() /obj/item/weapon/reagent_containers/food/condiment/sugar/New()
..() ..()
reagents.add_reagent("sugar", 50) reagents.add_reagent("sugar", 50)
/obj/item/weapon/reagent_containers/food/condiment/small /obj/item/weapon/reagent_containers/food/condiment/small
possible_transfer_amounts = list(1,20) possible_transfer_amounts = list(1,20)
amount_per_transfer_from_this = 1 amount_per_transfer_from_this = 1
volume = 20 volume = 20
center_of_mass = list() center_of_mass = list()
/obj/item/weapon/reagent_containers/food/condiment/small/on_reagent_change() /obj/item/weapon/reagent_containers/food/condiment/small/on_reagent_change()
return return
/obj/item/weapon/reagent_containers/food/condiment/small/saltshaker //Seperate from above since it's a small shaker rather then /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. name = "salt shaker" // a large one.
desc = "Salt. From space oceans, presumably." desc = "Salt. From space oceans, presumably."
icon_state = "saltshakersmall" icon_state = "saltshakersmall"
/obj/item/weapon/reagent_containers/food/condiment/small/saltshaker/New() /obj/item/weapon/reagent_containers/food/condiment/small/saltshaker/New()
..() ..()
reagents.add_reagent("sodiumchloride", 20) reagents.add_reagent("sodiumchloride", 20)
/obj/item/weapon/reagent_containers/food/condiment/small/peppermill /obj/item/weapon/reagent_containers/food/condiment/small/peppermill
name = "pepper mill" name = "pepper mill"
desc = "Often used to flavor food or make people sneeze." desc = "Often used to flavor food or make people sneeze."
icon_state = "peppermillsmall" icon_state = "peppermillsmall"
/obj/item/weapon/reagent_containers/food/condiment/small/peppermill/New() /obj/item/weapon/reagent_containers/food/condiment/small/peppermill/New()
..() ..()
reagents.add_reagent("blackpepper", 20) reagents.add_reagent("blackpepper", 20)
/obj/item/weapon/reagent_containers/food/condiment/small/sugar /obj/item/weapon/reagent_containers/food/condiment/small/sugar
name = "sugar" name = "sugar"
desc = "Sweetness in a bottle" desc = "Sweetness in a bottle"
icon_state = "sugarsmall" icon_state = "sugarsmall"
/obj/item/weapon/reagent_containers/food/condiment/small/sugar/New() /obj/item/weapon/reagent_containers/food/condiment/small/sugar/New()
..() ..()
reagents.add_reagent("sugar", 20) reagents.add_reagent("sugar", 20)
/obj/item/weapon/reagent_containers/food/condiment/flour /obj/item/weapon/reagent_containers/food/condiment/flour
name = "flour sack" name = "flour sack"
desc = "A big bag of flour. Good for baking!" desc = "A big bag of flour. Good for baking!"
icon = 'icons/obj/food.dmi' icon = 'icons/obj/food.dmi'
icon_state = "flour" icon_state = "flour"
/obj/item/weapon/reagent_containers/food/condiment/flour/on_reagent_change() /obj/item/weapon/reagent_containers/food/condiment/flour/on_reagent_change()
return return
/obj/item/weapon/reagent_containers/food/condiment/flour/New() /obj/item/weapon/reagent_containers/food/condiment/flour/New()
..() ..()
reagents.add_reagent("flour", 30) reagents.add_reagent("flour", 30)
src.pixel_x = rand(-10.0, 10) src.pixel_x = rand(-10.0, 10)
src.pixel_y = rand(-10.0, 10) src.pixel_y = rand(-10.0, 10)

View File

@@ -1,313 +1,313 @@
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
/// Drinks. /// Drinks.
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
/obj/item/weapon/reagent_containers/food/drinks /obj/item/weapon/reagent_containers/food/drinks
name = "drink" name = "drink"
desc = "yummy" desc = "yummy"
icon = 'icons/obj/drinks.dmi' icon = 'icons/obj/drinks.dmi'
icon_state = null icon_state = null
flags = OPENCONTAINER flags = OPENCONTAINER
amount_per_transfer_from_this = 5 amount_per_transfer_from_this = 5
volume = 50 volume = 50
/obj/item/weapon/reagent_containers/food/drinks/on_reagent_change() /obj/item/weapon/reagent_containers/food/drinks/on_reagent_change()
if (reagents.reagent_list.len > 0) if (reagents.reagent_list.len > 0)
var/datum/reagent/R = reagents.get_master_reagent() var/datum/reagent/R = reagents.get_master_reagent()
if(R.price_tag) if(R.price_tag)
price_tag = R.price_tag price_tag = R.price_tag
else else
price_tag = null price_tag = null
return return
/obj/item/weapon/reagent_containers/food/drinks/attack_self(mob/user as mob) /obj/item/weapon/reagent_containers/food/drinks/attack_self(mob/user as mob)
if(!is_open_container()) if(!is_open_container())
open(user) open(user)
/obj/item/weapon/reagent_containers/food/drinks/proc/open(mob/user) /obj/item/weapon/reagent_containers/food/drinks/proc/open(mob/user)
playsound(loc,"canopen", rand(10,50), 1) playsound(loc,"canopen", rand(10,50), 1)
user << "<span class='notice'>You open [src] with an audible pop!</span>" user << "<span class='notice'>You open [src] with an audible pop!</span>"
flags |= OPENCONTAINER flags |= OPENCONTAINER
/obj/item/weapon/reagent_containers/food/drinks/attack(mob/M as mob, mob/user as mob, def_zone) /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) if(force && !(flags & NOBLUDGEON) && user.a_intent == I_HURT)
return ..() return ..()
if(standard_feed_mob(user, M)) if(standard_feed_mob(user, M))
return return
return 0 return 0
/obj/item/weapon/reagent_containers/food/drinks/afterattack(obj/target, mob/user, proximity) /obj/item/weapon/reagent_containers/food/drinks/afterattack(obj/target, mob/user, proximity)
if(!proximity) return if(!proximity) return
if(standard_dispenser_refill(user, target)) if(standard_dispenser_refill(user, target))
return return
if(standard_pour_into(user, target)) if(standard_pour_into(user, target))
return return
return ..() return ..()
/obj/item/weapon/reagent_containers/food/drinks/standard_feed_mob(var/mob/user, var/mob/target) /obj/item/weapon/reagent_containers/food/drinks/standard_feed_mob(var/mob/user, var/mob/target)
if(!is_open_container()) if(!is_open_container())
user << "<span class='notice'>You need to open [src]!</span>" user << "<span class='notice'>You need to open [src]!</span>"
return 1 return 1
return ..() return ..()
/obj/item/weapon/reagent_containers/food/drinks/standard_dispenser_refill(var/mob/user, var/obj/structure/reagent_dispensers/target) /obj/item/weapon/reagent_containers/food/drinks/standard_dispenser_refill(var/mob/user, var/obj/structure/reagent_dispensers/target)
if(!is_open_container()) if(!is_open_container())
user << "<span class='notice'>You need to open [src]!</span>" user << "<span class='notice'>You need to open [src]!</span>"
return 1 return 1
return ..() return ..()
/obj/item/weapon/reagent_containers/food/drinks/standard_pour_into(var/mob/user, var/atom/target) /obj/item/weapon/reagent_containers/food/drinks/standard_pour_into(var/mob/user, var/atom/target)
if(!is_open_container()) if(!is_open_container())
user << "<span class='notice'>You need to open [src]!</span>" user << "<span class='notice'>You need to open [src]!</span>"
return 1 return 1
return ..() return ..()
/obj/item/weapon/reagent_containers/food/drinks/self_feed_message(var/mob/user) /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>" user << "<span class='notice'>You swallow a gulp from \the [src].</span>"
/obj/item/weapon/reagent_containers/food/drinks/feed_sound(var/mob/user) /obj/item/weapon/reagent_containers/food/drinks/feed_sound(var/mob/user)
playsound(user.loc, 'sound/items/drink.ogg', rand(10, 50), 1) playsound(user.loc, 'sound/items/drink.ogg', rand(10, 50), 1)
/obj/item/weapon/reagent_containers/food/drinks/examine(mob/user) /obj/item/weapon/reagent_containers/food/drinks/examine(mob/user)
if(!..(user, 1)) if(!..(user, 1))
return return
if(!reagents || reagents.total_volume == 0) if(!reagents || reagents.total_volume == 0)
user << "<span class='notice'>\The [src] is empty!</span>" user << "<span class='notice'>\The [src] is empty!</span>"
else if (reagents.total_volume <= volume * 0.25) else if (reagents.total_volume <= volume * 0.25)
user << "<span class='notice'>\The [src] is almost empty!</span>" user << "<span class='notice'>\The [src] is almost empty!</span>"
else if (reagents.total_volume <= volume * 0.66) else if (reagents.total_volume <= volume * 0.66)
user << "<span class='notice'>\The [src] is half full!</span>" user << "<span class='notice'>\The [src] is half full!</span>"
else if (reagents.total_volume <= volume * 0.90) else if (reagents.total_volume <= volume * 0.90)
user << "<span class='notice'>\The [src] is almost full!</span>" user << "<span class='notice'>\The [src] is almost full!</span>"
else else
user << "<span class='notice'>\The [src] is full!</span>" user << "<span class='notice'>\The [src] is full!</span>"
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
/// Drinks. END /// Drinks. END
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
/obj/item/weapon/reagent_containers/food/drinks/golden_cup /obj/item/weapon/reagent_containers/food/drinks/golden_cup
desc = "A golden cup" desc = "A golden cup"
name = "golden cup" name = "golden cup"
icon_state = "golden_cup" icon_state = "golden_cup"
item_state = "" //nope :( item_state = "" //nope :(
w_class = ITEMSIZE_LARGE w_class = ITEMSIZE_LARGE
force = 14 force = 14
throwforce = 10 throwforce = 10
amount_per_transfer_from_this = 20 amount_per_transfer_from_this = 20
possible_transfer_amounts = null possible_transfer_amounts = null
volume = 150 volume = 150
flags = CONDUCT | OPENCONTAINER flags = CONDUCT | OPENCONTAINER
/obj/item/weapon/reagent_containers/food/drinks/golden_cup/on_reagent_change() /obj/item/weapon/reagent_containers/food/drinks/golden_cup/on_reagent_change()
..() ..()
///////////////////////////////////////////////Drinks ///////////////////////////////////////////////Drinks
//Notes by Darem: Drinks are simply containers that start preloaded. Unlike condiments, the contents can be ingested directly //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. // 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. // Formatting is the same as food.
/obj/item/weapon/reagent_containers/food/drinks/milk /obj/item/weapon/reagent_containers/food/drinks/milk
name = "milk carton" name = "milk carton"
desc = "It's milk. White and nutritious goodness!" desc = "It's milk. White and nutritious goodness!"
icon_state = "milk" icon_state = "milk"
item_state = "carton" item_state = "carton"
center_of_mass = list("x"=16, "y"=9) center_of_mass = list("x"=16, "y"=9)
/obj/item/weapon/reagent_containers/food/drinks/milk/New() /obj/item/weapon/reagent_containers/food/drinks/milk/New()
..() ..()
reagents.add_reagent("milk", 50) reagents.add_reagent("milk", 50)
/obj/item/weapon/reagent_containers/food/drinks/soymilk /obj/item/weapon/reagent_containers/food/drinks/soymilk
name = "soymilk carton" name = "soymilk carton"
desc = "It's soy milk. White and nutritious goodness!" desc = "It's soy milk. White and nutritious goodness!"
icon_state = "soymilk" icon_state = "soymilk"
item_state = "carton" item_state = "carton"
center_of_mass = list("x"=16, "y"=9) center_of_mass = list("x"=16, "y"=9)
/obj/item/weapon/reagent_containers/food/drinks/soymilk/New() /obj/item/weapon/reagent_containers/food/drinks/soymilk/New()
..() ..()
reagents.add_reagent("soymilk", 50) reagents.add_reagent("soymilk", 50)
/obj/item/weapon/reagent_containers/food/drinks/smallmilk /obj/item/weapon/reagent_containers/food/drinks/smallmilk
name = "small milk carton" name = "small milk carton"
desc = "It's milk. White and nutritious goodness!" desc = "It's milk. White and nutritious goodness!"
volume = 30 volume = 30
icon_state = "mini-milk" icon_state = "mini-milk"
item_state = "carton" item_state = "carton"
center_of_mass = list("x"=16, "y"=9) center_of_mass = list("x"=16, "y"=9)
/obj/item/weapon/reagent_containers/food/drinks/smallmilk/New() /obj/item/weapon/reagent_containers/food/drinks/smallmilk/New()
..() ..()
reagents.add_reagent("milk", 30) reagents.add_reagent("milk", 30)
/obj/item/weapon/reagent_containers/food/drinks/smallchocmilk /obj/item/weapon/reagent_containers/food/drinks/smallchocmilk
name = "small chocolate milk carton" name = "small chocolate milk carton"
desc = "It's milk! This one is in delicious chocolate flavour." desc = "It's milk! This one is in delicious chocolate flavour."
volume = 30 volume = 30
icon_state = "mini-milk_choco" icon_state = "mini-milk_choco"
item_state = "carton" item_state = "carton"
center_of_mass = list("x"=16, "y"=9) center_of_mass = list("x"=16, "y"=9)
/obj/item/weapon/reagent_containers/food/drinks/smallchocmilk/New() /obj/item/weapon/reagent_containers/food/drinks/smallchocmilk/New()
..() ..()
reagents.add_reagent("chocolate_milk", 30) reagents.add_reagent("chocolate_milk", 30)
/obj/item/weapon/reagent_containers/food/drinks/coffee /obj/item/weapon/reagent_containers/food/drinks/coffee
name = "\improper Robust Coffee" name = "\improper Robust Coffee"
desc = "Careful, the beverage you're about to enjoy is extremely hot." desc = "Careful, the beverage you're about to enjoy is extremely hot."
icon_state = "coffee" icon_state = "coffee"
center_of_mass = list("x"=15, "y"=10) center_of_mass = list("x"=15, "y"=10)
/obj/item/weapon/reagent_containers/food/drinks/coffee/New() /obj/item/weapon/reagent_containers/food/drinks/coffee/New()
..() ..()
reagents.add_reagent("coffee", 30) reagents.add_reagent("coffee", 30)
/obj/item/weapon/reagent_containers/food/drinks/tea /obj/item/weapon/reagent_containers/food/drinks/tea
name = "cup of Duke Purple 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." 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" icon_state = "teacup"
item_state = "coffee" item_state = "coffee"
center_of_mass = list("x"=16, "y"=14) center_of_mass = list("x"=16, "y"=14)
/obj/item/weapon/reagent_containers/food/drinks/tea/New() /obj/item/weapon/reagent_containers/food/drinks/tea/New()
..() ..()
reagents.add_reagent("tea", 30) reagents.add_reagent("tea", 30)
/obj/item/weapon/reagent_containers/food/drinks/ice /obj/item/weapon/reagent_containers/food/drinks/ice
name = "cup of ice" name = "cup of ice"
desc = "Careful, cold ice, do not chew." desc = "Careful, cold ice, do not chew."
icon_state = "coffee" icon_state = "coffee"
center_of_mass = list("x"=15, "y"=10) center_of_mass = list("x"=15, "y"=10)
/obj/item/weapon/reagent_containers/food/drinks/ice/New() /obj/item/weapon/reagent_containers/food/drinks/ice/New()
..() ..()
reagents.add_reagent("ice", 30) reagents.add_reagent("ice", 30)
/obj/item/weapon/reagent_containers/food/drinks/h_chocolate /obj/item/weapon/reagent_containers/food/drinks/h_chocolate
name = "cup of Dutch hot coco" name = "cup of Dutch hot coco"
desc = "Made in Space South America." desc = "Made in Space South America."
icon_state = "hot_coco" icon_state = "hot_coco"
item_state = "coffee" item_state = "coffee"
center_of_mass = list("x"=15, "y"=13) center_of_mass = list("x"=15, "y"=13)
/obj/item/weapon/reagent_containers/food/drinks/h_chocolate/New() /obj/item/weapon/reagent_containers/food/drinks/h_chocolate/New()
..() ..()
reagents.add_reagent("hot_coco", 30) reagents.add_reagent("hot_coco", 30)
/obj/item/weapon/reagent_containers/food/drinks/dry_ramen /obj/item/weapon/reagent_containers/food/drinks/dry_ramen
name = "Cup Ramen" name = "Cup Ramen"
desc = "Just add 10ml water, self heats! A taste that reminds you of your school years." desc = "Just add 10ml water, self heats! A taste that reminds you of your school years."
icon_state = "ramen" icon_state = "ramen"
center_of_mass = list("x"=16, "y"=11) center_of_mass = list("x"=16, "y"=11)
/obj/item/weapon/reagent_containers/food/drinks/dry_ramen/New() /obj/item/weapon/reagent_containers/food/drinks/dry_ramen/New()
..() ..()
reagents.add_reagent("dry_ramen", 30) reagents.add_reagent("dry_ramen", 30)
/obj/item/weapon/reagent_containers/food/drinks/sillycup /obj/item/weapon/reagent_containers/food/drinks/sillycup
name = "paper cup" name = "paper cup"
desc = "A paper water cup." desc = "A paper water cup."
icon_state = "water_cup_e" icon_state = "water_cup_e"
possible_transfer_amounts = null possible_transfer_amounts = null
volume = 10 volume = 10
center_of_mass = list("x"=16, "y"=12) 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/New()
..() ..()
/obj/item/weapon/reagent_containers/food/drinks/sillycup/on_reagent_change() /obj/item/weapon/reagent_containers/food/drinks/sillycup/on_reagent_change()
..() ..()
if(reagents.total_volume) if(reagents.total_volume)
icon_state = "water_cup" icon_state = "water_cup"
else else
icon_state = "water_cup_e" icon_state = "water_cup_e"
/obj/item/weapon/reagent_containers/food/drinks/sillycup/MouseDrop(obj/over_object as obj) /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(!reagents.total_volume && istype(over_object, /obj/structure/reagent_dispensers/water_cooler))
if(over_object.Adjacent(usr)) if(over_object.Adjacent(usr))
var/obj/structure/reagent_dispensers/water_cooler/W = over_object var/obj/structure/reagent_dispensers/water_cooler/W = over_object
if(W.cupholder && W.cups < 10) if(W.cupholder && W.cups < 10)
W.cups++ W.cups++
usr << "<span class='notice'>You put the [src] in the cup dispenser.</span>" usr << "<span class='notice'>You put the [src] in the cup dispenser.</span>"
qdel(src) qdel(src)
W.update_icon() W.update_icon()
else else
return ..() return ..()
//////////////////////////drinkingglass and shaker// //////////////////////////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 //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 // itself), in Chemistry-Recipes.dm (for the reaction that changes the components into the drink), and here (for the drinking glass
// icon states. // icon states.
/obj/item/weapon/reagent_containers/food/drinks/shaker /obj/item/weapon/reagent_containers/food/drinks/shaker
name = "shaker" name = "shaker"
desc = "A metal shaker to mix drinks in." desc = "A metal shaker to mix drinks in."
icon_state = "shaker" icon_state = "shaker"
amount_per_transfer_from_this = 10 amount_per_transfer_from_this = 10
volume = 120 volume = 120
center_of_mass = list("x"=17, "y"=10) 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/shaker/on_reagent_change()
..() ..()
/obj/item/weapon/reagent_containers/food/drinks/teapot /obj/item/weapon/reagent_containers/food/drinks/teapot
name = "teapot" name = "teapot"
desc = "An elegant teapot. It simply oozes class." desc = "An elegant teapot. It simply oozes class."
icon_state = "teapot" icon_state = "teapot"
item_state = "teapot" item_state = "teapot"
amount_per_transfer_from_this = 10 amount_per_transfer_from_this = 10
volume = 120 volume = 120
center_of_mass = list("x"=17, "y"=7) 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/teapot/on_reagent_change()
..() ..()
/obj/item/weapon/reagent_containers/food/drinks/flask /obj/item/weapon/reagent_containers/food/drinks/flask
name = "\improper Colony Director's flask" name = "\improper Colony Director's flask"
desc = "A metal flask belonging to the Colony Director" desc = "A metal flask belonging to the Colony Director"
icon_state = "flask" icon_state = "flask"
volume = 60 volume = 60
center_of_mass = list("x"=17, "y"=7) 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/on_reagent_change()
..() ..()
/obj/item/weapon/reagent_containers/food/drinks/flask/shiny /obj/item/weapon/reagent_containers/food/drinks/flask/shiny
name = "shiny flask" name = "shiny flask"
desc = "A shiny metal flask. It appears to have a Greek symbol inscribed on it." desc = "A shiny metal flask. It appears to have a Greek symbol inscribed on it."
icon_state = "shinyflask" icon_state = "shinyflask"
/obj/item/weapon/reagent_containers/food/drinks/flask/lithium /obj/item/weapon/reagent_containers/food/drinks/flask/lithium
name = "lithium flask" name = "lithium flask"
desc = "A flask with a Lithium Atom symbol on it." desc = "A flask with a Lithium Atom symbol on it."
icon_state = "lithiumflask" icon_state = "lithiumflask"
/obj/item/weapon/reagent_containers/food/drinks/flask/detflask /obj/item/weapon/reagent_containers/food/drinks/flask/detflask
name = "\improper Detective's flask" name = "\improper Detective's flask"
desc = "A metal flask with a leather band and golden badge belonging to the detective." desc = "A metal flask with a leather band and golden badge belonging to the detective."
icon_state = "detflask" icon_state = "detflask"
volume = 60 volume = 60
center_of_mass = list("x"=17, "y"=8) center_of_mass = list("x"=17, "y"=8)
/obj/item/weapon/reagent_containers/food/drinks/flask/barflask /obj/item/weapon/reagent_containers/food/drinks/flask/barflask
name = "flask" name = "flask"
desc = "For those who can't be bothered to hang out at the bar to drink." desc = "For those who can't be bothered to hang out at the bar to drink."
icon_state = "barflask" icon_state = "barflask"
volume = 60 volume = 60
center_of_mass = list("x"=17, "y"=7) center_of_mass = list("x"=17, "y"=7)
/obj/item/weapon/reagent_containers/food/drinks/flask/vacuumflask /obj/item/weapon/reagent_containers/food/drinks/flask/vacuumflask
name = "vacuum flask" name = "vacuum flask"
desc = "Keeping your drinks at the perfect temperature since 1892." desc = "Keeping your drinks at the perfect temperature since 1892."
icon_state = "vacuumflask" icon_state = "vacuumflask"
volume = 60 volume = 60
center_of_mass = list("x"=15, "y"=4) center_of_mass = list("x"=15, "y"=4)
/obj/item/weapon/reagent_containers/food/drinks/britcup /obj/item/weapon/reagent_containers/food/drinks/britcup
name = "cup" name = "cup"
desc = "A cup with the British flag emblazoned on it." desc = "A cup with the British flag emblazoned on it."
icon_state = "britcup" icon_state = "britcup"
volume = 30 volume = 30
center_of_mass = list("x"=15, "y"=13) center_of_mass = list("x"=15, "y"=13)
/obj/item/weapon/reagent_containers/food/drinks/britcup/on_reagent_change() /obj/item/weapon/reagent_containers/food/drinks/britcup/on_reagent_change()
..() ..()

View File

@@ -1,178 +1,178 @@
/obj/item/weapon/reagent_containers/food/drinks/drinkingglass /obj/item/weapon/reagent_containers/food/drinks/drinkingglass
name = "glass" name = "glass"
desc = "Your standard drinking glass." desc = "Your standard drinking glass."
icon_state = "glass_empty" icon_state = "glass_empty"
amount_per_transfer_from_this = 5 amount_per_transfer_from_this = 5
volume = 30 volume = 30
unacidable = 1 //glass unacidable = 1 //glass
center_of_mass = list("x"=16, "y"=10) center_of_mass = list("x"=16, "y"=10)
matter = list("glass" = 500) matter = list("glass" = 500)
on_reagent_change() on_reagent_change()
/*if(reagents.reagent_list.len > 1 ) /*if(reagents.reagent_list.len > 1 )
icon_state = "glass_brown" icon_state = "glass_brown"
name = "Glass of Hooch" name = "Glass of Hooch"
desc = "Two or more drinks, mixed together."*/ desc = "Two or more drinks, mixed together."*/
/*else if(reagents.reagent_list.len == 1) /*else if(reagents.reagent_list.len == 1)
for(var/datum/reagent/R in reagents.reagent_list) for(var/datum/reagent/R in reagents.reagent_list)
switch(R.id)*/ switch(R.id)*/
if (reagents.reagent_list.len > 0) if (reagents.reagent_list.len > 0)
var/datum/reagent/R = reagents.get_master_reagent() var/datum/reagent/R = reagents.get_master_reagent()
if(R.glass_icon_state) if(R.glass_icon_state)
icon_state = R.glass_icon_state icon_state = R.glass_icon_state
else else
icon_state = "glass_brown" icon_state = "glass_brown"
if(R.glass_name) if(R.glass_name)
name = R.glass_name name = R.glass_name
else else
name = "Glass of.. what?" name = "Glass of.. what?"
if(R.glass_desc) if(R.glass_desc)
desc = R.glass_desc desc = R.glass_desc
else else
desc = "You can't really tell what this is." desc = "You can't really tell what this is."
if(R.glass_center_of_mass) if(R.glass_center_of_mass)
center_of_mass = R.glass_center_of_mass center_of_mass = R.glass_center_of_mass
else else
center_of_mass = list("x"=16, "y"=10) center_of_mass = list("x"=16, "y"=10)
if(R.price_tag) if(R.price_tag)
price_tag = R.price_tag price_tag = R.price_tag
else else
price_tag = null price_tag = null
else else
icon_state = "glass_empty" icon_state = "glass_empty"
name = "glass" name = "glass"
desc = "Your standard drinking glass." desc = "Your standard drinking glass."
center_of_mass = list("x"=16, "y"=10) center_of_mass = list("x"=16, "y"=10)
return return
/obj/item/weapon/reagent_containers/food/drinks/cup /obj/item/weapon/reagent_containers/food/drinks/cup
name = "coffee cup" name = "coffee cup"
desc = "The container of oriental luxuries." desc = "The container of oriental luxuries."
icon_state = "cup_empty" icon_state = "cup_empty"
amount_per_transfer_from_this = 5 amount_per_transfer_from_this = 5
volume = 30 volume = 30
center_of_mass = list("x"=16, "y"=16) center_of_mass = list("x"=16, "y"=16)
on_reagent_change() on_reagent_change()
if (reagents.reagent_list.len > 0) if (reagents.reagent_list.len > 0)
var/datum/reagent/R = reagents.get_master_reagent() var/datum/reagent/R = reagents.get_master_reagent()
if(R.cup_icon_state) if(R.cup_icon_state)
icon_state = R.cup_icon_state icon_state = R.cup_icon_state
else else
icon_state = "cup_brown" icon_state = "cup_brown"
if(R.cup_name) if(R.cup_name)
name = R.cup_name name = R.cup_name
else else
name = "Cup of.. what?" name = "Cup of.. what?"
if(R.cup_desc) if(R.cup_desc)
desc = R.cup_desc desc = R.cup_desc
else else
desc = "You can't really tell what this is." desc = "You can't really tell what this is."
if(R.cup_center_of_mass) if(R.cup_center_of_mass)
center_of_mass = R.cup_center_of_mass center_of_mass = R.cup_center_of_mass
else else
center_of_mass = list("x"=16, "y"=16) center_of_mass = list("x"=16, "y"=16)
if(R.price_tag) if(R.price_tag)
price_tag = R.price_tag price_tag = R.price_tag
else else
price_tag = null price_tag = null
else else
icon_state = "cup_empty" icon_state = "cup_empty"
name = "coffee cup" name = "coffee cup"
desc = "The container of oriental luxuries." desc = "The container of oriental luxuries."
center_of_mass = list("x"=16, "y"=16) center_of_mass = list("x"=16, "y"=16)
return return
// for /obj/machinery/vending/sovietsoda // for /obj/machinery/vending/sovietsoda
/obj/item/weapon/reagent_containers/food/drinks/drinkingglass/soda /obj/item/weapon/reagent_containers/food/drinks/drinkingglass/soda
New() New()
..() ..()
reagents.add_reagent("sodawater", 50) reagents.add_reagent("sodawater", 50)
on_reagent_change() on_reagent_change()
/obj/item/weapon/reagent_containers/food/drinks/drinkingglass/cola /obj/item/weapon/reagent_containers/food/drinks/drinkingglass/cola
New() New()
..() ..()
reagents.add_reagent("cola", 50) reagents.add_reagent("cola", 50)
on_reagent_change() on_reagent_change()
/obj/item/weapon/reagent_containers/food/drinks/drinkingglass/shotglass /obj/item/weapon/reagent_containers/food/drinks/drinkingglass/shotglass
name = "shot glass" name = "shot glass"
desc = "No glasses were shot in the making of this glass." desc = "No glasses were shot in the making of this glass."
icon_state = "shotglass" icon_state = "shotglass"
amount_per_transfer_from_this = 10 amount_per_transfer_from_this = 10
volume = 10 volume = 10
matter = list("glass" = 175) matter = list("glass" = 175)
/obj/item/weapon/reagent_containers/food/drinks/drinkingglass/shotglass/on_reagent_change() /obj/item/weapon/reagent_containers/food/drinks/drinkingglass/shotglass/on_reagent_change()
overlays.Cut() overlays.Cut()
if(reagents.total_volume) if(reagents.total_volume)
var/image/filling = image('icons/obj/reagentfillings.dmi', src, "[icon_state]1") var/image/filling = image('icons/obj/reagentfillings.dmi', src, "[icon_state]1")
switch(reagents.total_volume) switch(reagents.total_volume)
if(0 to 3) filling.icon_state = "[icon_state]1" if(0 to 3) filling.icon_state = "[icon_state]1"
if(4 to 7) filling.icon_state = "[icon_state]5" if(4 to 7) filling.icon_state = "[icon_state]5"
if(8 to INFINITY) filling.icon_state = "[icon_state]12" if(8 to INFINITY) filling.icon_state = "[icon_state]12"
filling.color += reagents.get_color() filling.color += reagents.get_color()
overlays += filling 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. 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 else
name = "shot glass" name = "shot glass"
/obj/item/weapon/reagent_containers/food/drinks/drinkingglass/fitnessflask /obj/item/weapon/reagent_containers/food/drinks/drinkingglass/fitnessflask
name = "fitness shaker" name = "fitness shaker"
desc = "Big enough to contain enough protein to get perfectly swole. Don't mind the bits." desc = "Big enough to contain enough protein to get perfectly swole. Don't mind the bits."
icon_state = "fitness-cup_black" icon_state = "fitness-cup_black"
volume = 100 volume = 100
matter = list("plastic" = 2000) matter = list("plastic" = 2000)
/obj/item/weapon/reagent_containers/food/drinks/drinkingglass/fitnessflask/New() /obj/item/weapon/reagent_containers/food/drinks/drinkingglass/fitnessflask/New()
..() ..()
icon_state = pick("fitness-cup_black", "fitness-cup_red", "fitness-cup_black") icon_state = pick("fitness-cup_black", "fitness-cup_red", "fitness-cup_black")
/obj/item/weapon/reagent_containers/food/drinks/drinkingglass/fitnessflask/on_reagent_change() /obj/item/weapon/reagent_containers/food/drinks/drinkingglass/fitnessflask/on_reagent_change()
overlays.Cut() overlays.Cut()
if(reagents.total_volume) if(reagents.total_volume)
var/image/filling = image('icons/obj/reagentfillings.dmi', src, "fitness-cup10") var/image/filling = image('icons/obj/reagentfillings.dmi', src, "fitness-cup10")
switch(reagents.total_volume) switch(reagents.total_volume)
if(0 to 10) filling.icon_state = "fitness-cup10" if(0 to 10) filling.icon_state = "fitness-cup10"
if(11 to 20) filling.icon_state = "fitness-cup20" if(11 to 20) filling.icon_state = "fitness-cup20"
if(21 to 29) filling.icon_state = "fitness-cup30" if(21 to 29) filling.icon_state = "fitness-cup30"
if(30 to 39) filling.icon_state = "fitness-cup40" if(30 to 39) filling.icon_state = "fitness-cup40"
if(40 to 49) filling.icon_state = "fitness-cup50" if(40 to 49) filling.icon_state = "fitness-cup50"
if(50 to 59) filling.icon_state = "fitness-cup60" if(50 to 59) filling.icon_state = "fitness-cup60"
if(60 to 69) filling.icon_state = "fitness-cup70" if(60 to 69) filling.icon_state = "fitness-cup70"
if(70 to 79) filling.icon_state = "fitness-cup80" if(70 to 79) filling.icon_state = "fitness-cup80"
if(80 to 89) filling.icon_state = "fitness-cup90" if(80 to 89) filling.icon_state = "fitness-cup90"
if(90 to INFINITY) filling.icon_state = "fitness-cup100" if(90 to INFINITY) filling.icon_state = "fitness-cup100"
filling.color += reagents.get_color() filling.color += reagents.get_color()
overlays += filling overlays += filling
/obj/item/weapon/reagent_containers/food/drinks/drinkingglass/fitnessflask/proteinshake /obj/item/weapon/reagent_containers/food/drinks/drinkingglass/fitnessflask/proteinshake
name = "protein shake" name = "protein shake"
/obj/item/weapon/reagent_containers/food/drinks/drinkingglass/fitnessflask/proteinshake/New() /obj/item/weapon/reagent_containers/food/drinks/drinkingglass/fitnessflask/proteinshake/New()
..() ..()
reagents.add_reagent("nutriment", 30) reagents.add_reagent("nutriment", 30)
reagents.add_reagent("iron", 10) reagents.add_reagent("iron", 10)
reagents.add_reagent("protein", 15) reagents.add_reagent("protein", 15)
reagents.add_reagent("water", 45) reagents.add_reagent("water", 45)
on_reagent_change() on_reagent_change()

View File

@@ -1,25 +1,25 @@
///jar ///jar
/obj/item/weapon/reagent_containers/food/drinks/jar /obj/item/weapon/reagent_containers/food/drinks/jar
name = "empty jar" name = "empty jar"
desc = "A jar. You're not sure what it's supposed to hold." desc = "A jar. You're not sure what it's supposed to hold."
icon_state = "jar" icon_state = "jar"
item_state = "beaker" item_state = "beaker"
center_of_mass = list("x"=15, "y"=8) center_of_mass = list("x"=15, "y"=8)
unacidable = 1 unacidable = 1
/obj/item/weapon/reagent_containers/food/drinks/jar/on_reagent_change() /obj/item/weapon/reagent_containers/food/drinks/jar/on_reagent_change()
if (reagents.reagent_list.len > 0) if (reagents.reagent_list.len > 0)
switch(reagents.get_master_reagent_id()) switch(reagents.get_master_reagent_id())
if("slime") if("slime")
icon_state = "jar_slime" icon_state = "jar_slime"
name = "slime jam" name = "slime jam"
desc = "A jar of slime jam. Delicious!" desc = "A jar of slime jam. Delicious!"
else else
icon_state ="jar_what" icon_state ="jar_what"
name = "jar of something" name = "jar of something"
desc = "You can't really tell what this is." desc = "You can't really tell what this is."
else else
icon_state = "jar" icon_state = "jar"
name = "empty jar" name = "empty jar"
desc = "A jar. You're not sure what it's supposed to hold." desc = "A jar. You're not sure what it's supposed to hold."
return return

View File

@@ -1,37 +1,37 @@
/obj/item/weapon/reagent_containers/food/snacks/meat /obj/item/weapon/reagent_containers/food/snacks/meat
name = "meat" name = "meat"
desc = "A slab of meat." desc = "A slab of meat."
icon_state = "meat" icon_state = "meat"
health = 180 health = 180
filling_color = "#FF1C1C" filling_color = "#FF1C1C"
center_of_mass = list("x"=16, "y"=14) center_of_mass = list("x"=16, "y"=14)
/obj/item/weapon/reagent_containers/food/snacks/meat/New() /obj/item/weapon/reagent_containers/food/snacks/meat/New()
..() ..()
reagents.add_reagent("protein", 9) reagents.add_reagent("protein", 9)
src.bitesize = 3 src.bitesize = 3
/obj/item/weapon/reagent_containers/food/snacks/meat/attackby(obj/item/weapon/W as obj, mob/user as mob) /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)) 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) 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." user << "You cut the meat into thin strips."
qdel(src) qdel(src)
else else
..() ..()
/obj/item/weapon/reagent_containers/food/snacks/meat/syntiflesh /obj/item/weapon/reagent_containers/food/snacks/meat/syntiflesh
name = "synthetic meat" name = "synthetic meat"
desc = "A synthetic slab of flesh." desc = "A synthetic slab of flesh."
// Seperate definitions because some food likes to know if it's human. // 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 // TODO: rewrite kitchen code to check a var on the meat item so we can remove
// all these sybtypes. // all these sybtypes.
/obj/item/weapon/reagent_containers/food/snacks/meat/human /obj/item/weapon/reagent_containers/food/snacks/meat/human
/obj/item/weapon/reagent_containers/food/snacks/meat/monkey /obj/item/weapon/reagent_containers/food/snacks/meat/monkey
//same as plain meat //same as plain meat
/obj/item/weapon/reagent_containers/food/snacks/meat/corgi /obj/item/weapon/reagent_containers/food/snacks/meat/corgi
name = "Corgi meat" name = "Corgi meat"
desc = "Tastes like... well, you know." desc = "Tastes like... well, you know."

View File

@@ -1,175 +1,175 @@
//Not to be confused with /obj/item/weapon/reagent_containers/food/drinks/bottle //Not to be confused with /obj/item/weapon/reagent_containers/food/drinks/bottle
/obj/item/weapon/reagent_containers/glass/bottle /obj/item/weapon/reagent_containers/glass/bottle
name = "bottle" name = "bottle"
desc = "A small bottle." desc = "A small bottle."
icon = 'icons/obj/chemical.dmi' icon = 'icons/obj/chemical.dmi'
icon_state = null icon_state = null
item_state = "atoxinbottle" item_state = "atoxinbottle"
amount_per_transfer_from_this = 10 amount_per_transfer_from_this = 10
possible_transfer_amounts = list(5,10,15,25,30,60) possible_transfer_amounts = list(5,10,15,25,30,60)
flags = 0 flags = 0
volume = 60 volume = 60
/obj/item/weapon/reagent_containers/glass/bottle/on_reagent_change() /obj/item/weapon/reagent_containers/glass/bottle/on_reagent_change()
update_icon() update_icon()
/obj/item/weapon/reagent_containers/glass/bottle/pickup(mob/user) /obj/item/weapon/reagent_containers/glass/bottle/pickup(mob/user)
..() ..()
update_icon() update_icon()
/obj/item/weapon/reagent_containers/glass/bottle/dropped(mob/user) /obj/item/weapon/reagent_containers/glass/bottle/dropped(mob/user)
..() ..()
update_icon() update_icon()
/obj/item/weapon/reagent_containers/glass/bottle/attack_hand() /obj/item/weapon/reagent_containers/glass/bottle/attack_hand()
..() ..()
update_icon() update_icon()
/obj/item/weapon/reagent_containers/glass/bottle/New() /obj/item/weapon/reagent_containers/glass/bottle/New()
..() ..()
if(!icon_state) if(!icon_state)
icon_state = "bottle-[rand(1,4)]" icon_state = "bottle-[rand(1,4)]"
/obj/item/weapon/reagent_containers/glass/bottle/update_icon() /obj/item/weapon/reagent_containers/glass/bottle/update_icon()
overlays.Cut() overlays.Cut()
if(reagents.total_volume && (icon_state == "bottle-1" || icon_state == "bottle-2" || icon_state == "bottle-3" || icon_state == "bottle-4")) 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/image/filling = image('icons/obj/reagentfillings.dmi', src, "[icon_state]10")
var/percent = round((reagents.total_volume / volume) * 100) var/percent = round((reagents.total_volume / volume) * 100)
switch(percent) switch(percent)
if(0 to 9) filling.icon_state = "[icon_state]--10" if(0 to 9) filling.icon_state = "[icon_state]--10"
if(10 to 24) 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(25 to 49) filling.icon_state = "[icon_state]-25"
if(50 to 74) filling.icon_state = "[icon_state]-50" if(50 to 74) filling.icon_state = "[icon_state]-50"
if(75 to 79) filling.icon_state = "[icon_state]-75" if(75 to 79) filling.icon_state = "[icon_state]-75"
if(80 to 90) filling.icon_state = "[icon_state]-80" if(80 to 90) filling.icon_state = "[icon_state]-80"
if(91 to INFINITY) filling.icon_state = "[icon_state]-100" if(91 to INFINITY) filling.icon_state = "[icon_state]-100"
filling.color = reagents.get_color() filling.color = reagents.get_color()
overlays += filling overlays += filling
if (!is_open_container()) if (!is_open_container())
var/image/lid = image(icon, src, "lid_bottle") var/image/lid = image(icon, src, "lid_bottle")
overlays += lid overlays += lid
/obj/item/weapon/reagent_containers/glass/bottle/inaprovaline /obj/item/weapon/reagent_containers/glass/bottle/inaprovaline
name = "inaprovaline bottle" name = "inaprovaline bottle"
desc = "A small bottle. Contains inaprovaline - used to stabilize patients." desc = "A small bottle. Contains inaprovaline - used to stabilize patients."
icon = 'icons/obj/chemical.dmi' icon = 'icons/obj/chemical.dmi'
icon_state = "bottle-4" icon_state = "bottle-4"
prefill = list("inaprovaline" = 60) prefill = list("inaprovaline" = 60)
/obj/item/weapon/reagent_containers/glass/bottle/toxin /obj/item/weapon/reagent_containers/glass/bottle/toxin
name = "toxin bottle" name = "toxin bottle"
desc = "A small bottle of toxins. Do not drink, it is poisonous." desc = "A small bottle of toxins. Do not drink, it is poisonous."
icon = 'icons/obj/chemical.dmi' icon = 'icons/obj/chemical.dmi'
icon_state = "bottle-3" icon_state = "bottle-3"
prefill = list("toxin" = 60) prefill = list("toxin" = 60)
/obj/item/weapon/reagent_containers/glass/bottle/cyanide /obj/item/weapon/reagent_containers/glass/bottle/cyanide
name = "cyanide bottle" name = "cyanide bottle"
desc = "A small bottle of cyanide. Bitter almonds?" desc = "A small bottle of cyanide. Bitter almonds?"
icon = 'icons/obj/chemical.dmi' icon = 'icons/obj/chemical.dmi'
icon_state = "bottle-3" icon_state = "bottle-3"
prefill = list("cyanide" = 30) //volume changed to match chloral prefill = list("cyanide" = 30) //volume changed to match chloral
/obj/item/weapon/reagent_containers/glass/bottle/stoxin /obj/item/weapon/reagent_containers/glass/bottle/stoxin
name = "soporific bottle" name = "soporific bottle"
desc = "A small bottle of soporific. Just the fumes make you sleepy." desc = "A small bottle of soporific. Just the fumes make you sleepy."
icon = 'icons/obj/chemical.dmi' icon = 'icons/obj/chemical.dmi'
icon_state = "bottle-3" icon_state = "bottle-3"
prefill = list("stoxin" = 60) prefill = list("stoxin" = 60)
/obj/item/weapon/reagent_containers/glass/bottle/chloralhydrate /obj/item/weapon/reagent_containers/glass/bottle/chloralhydrate
name = "chloral hydrate bottle" name = "chloral hydrate bottle"
desc = "A small bottle of Choral Hydrate. Mickey's Favorite!" desc = "A small bottle of Choral Hydrate. Mickey's Favorite!"
icon = 'icons/obj/chemical.dmi' icon = 'icons/obj/chemical.dmi'
icon_state = "bottle-3" icon_state = "bottle-3"
prefill = list("chloralhydrate" = 30) //Intentionally low since it is so strong. Still enough to knock someone out. 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 /obj/item/weapon/reagent_containers/glass/bottle/antitoxin
name = "dylovene bottle" name = "dylovene bottle"
desc = "A small bottle of dylovene. Counters poisons, and repairs damage. A wonder drug." desc = "A small bottle of dylovene. Counters poisons, and repairs damage. A wonder drug."
icon = 'icons/obj/chemical.dmi' icon = 'icons/obj/chemical.dmi'
icon_state = "bottle-4" icon_state = "bottle-4"
prefill = list("anti_toxin" = 60) prefill = list("anti_toxin" = 60)
/obj/item/weapon/reagent_containers/glass/bottle/mutagen /obj/item/weapon/reagent_containers/glass/bottle/mutagen
name = "unstable mutagen bottle" name = "unstable mutagen bottle"
desc = "A small bottle of unstable mutagen. Randomly changes the DNA structure of whoever comes in contact." desc = "A small bottle of unstable mutagen. Randomly changes the DNA structure of whoever comes in contact."
icon = 'icons/obj/chemical.dmi' icon = 'icons/obj/chemical.dmi'
icon_state = "bottle-1" icon_state = "bottle-1"
prefill = list("mutagen" = 60) prefill = list("mutagen" = 60)
/obj/item/weapon/reagent_containers/glass/bottle/ammonia /obj/item/weapon/reagent_containers/glass/bottle/ammonia
name = "ammonia bottle" name = "ammonia bottle"
desc = "A small bottle." desc = "A small bottle."
icon = 'icons/obj/chemical.dmi' icon = 'icons/obj/chemical.dmi'
icon_state = "bottle-1" icon_state = "bottle-1"
prefill = list("ammonia" = 60) prefill = list("ammonia" = 60)
/obj/item/weapon/reagent_containers/glass/bottle/eznutrient /obj/item/weapon/reagent_containers/glass/bottle/eznutrient
name = "\improper EZ NUtrient bottle" name = "\improper EZ NUtrient bottle"
desc = "A small bottle." desc = "A small bottle."
icon = 'icons/obj/chemical.dmi' icon = 'icons/obj/chemical.dmi'
icon_state = "bottle-4" icon_state = "bottle-4"
prefill = list("eznutrient" = 60) prefill = list("eznutrient" = 60)
/obj/item/weapon/reagent_containers/glass/bottle/left4zed /obj/item/weapon/reagent_containers/glass/bottle/left4zed
name = "\improper Left-4-Zed bottle" name = "\improper Left-4-Zed bottle"
desc = "A small bottle." desc = "A small bottle."
icon = 'icons/obj/chemical.dmi' icon = 'icons/obj/chemical.dmi'
icon_state = "bottle-4" icon_state = "bottle-4"
prefill = list("left4zed" = 60) prefill = list("left4zed" = 60)
/obj/item/weapon/reagent_containers/glass/bottle/robustharvest /obj/item/weapon/reagent_containers/glass/bottle/robustharvest
name = "\improper Robust Harvest" name = "\improper Robust Harvest"
desc = "A small bottle." desc = "A small bottle."
icon = 'icons/obj/chemical.dmi' icon = 'icons/obj/chemical.dmi'
icon_state = "bottle-4" icon_state = "bottle-4"
prefill = list("robustharvest" = 60) prefill = list("robustharvest" = 60)
/obj/item/weapon/reagent_containers/glass/bottle/diethylamine /obj/item/weapon/reagent_containers/glass/bottle/diethylamine
name = "diethylamine bottle" name = "diethylamine bottle"
desc = "A small bottle." desc = "A small bottle."
icon = 'icons/obj/chemical.dmi' icon = 'icons/obj/chemical.dmi'
icon_state = "bottle-4" icon_state = "bottle-4"
prefill = list("diethylamine" = 60) prefill = list("diethylamine" = 60)
/obj/item/weapon/reagent_containers/glass/bottle/pacid /obj/item/weapon/reagent_containers/glass/bottle/pacid
name = "polytrinic acid bottle" name = "polytrinic acid bottle"
desc = "A small bottle. Contains a small amount of Polytrinic Acid" desc = "A small bottle. Contains a small amount of Polytrinic Acid"
icon = 'icons/obj/chemical.dmi' icon = 'icons/obj/chemical.dmi'
icon_state = "bottle-4" icon_state = "bottle-4"
prefill = list("pacid" = 60) prefill = list("pacid" = 60)
/obj/item/weapon/reagent_containers/glass/bottle/adminordrazine /obj/item/weapon/reagent_containers/glass/bottle/adminordrazine
name = "adminordrazine bottle" name = "adminordrazine bottle"
desc = "A small bottle. Contains the liquid essence of the gods." desc = "A small bottle. Contains the liquid essence of the gods."
icon = 'icons/obj/drinks.dmi' icon = 'icons/obj/drinks.dmi'
icon_state = "holyflask" icon_state = "holyflask"
prefill = list("adminordrazine" = 60) prefill = list("adminordrazine" = 60)
/obj/item/weapon/reagent_containers/glass/bottle/capsaicin /obj/item/weapon/reagent_containers/glass/bottle/capsaicin
name = "capsaicin bottle" name = "capsaicin bottle"
desc = "A small bottle. Contains hot sauce." desc = "A small bottle. Contains hot sauce."
icon = 'icons/obj/chemical.dmi' icon = 'icons/obj/chemical.dmi'
icon_state = "bottle-4" icon_state = "bottle-4"
prefill = list("capsaicin" = 60) prefill = list("capsaicin" = 60)
/obj/item/weapon/reagent_containers/glass/bottle/frostoil /obj/item/weapon/reagent_containers/glass/bottle/frostoil
name = "frost oil bottle" name = "frost oil bottle"
desc = "A small bottle. Contains cold sauce." desc = "A small bottle. Contains cold sauce."
icon = 'icons/obj/chemical.dmi' icon = 'icons/obj/chemical.dmi'
icon_state = "bottle-4" icon_state = "bottle-4"
prefill = list("frostoil" = 60) prefill = list("frostoil" = 60)
/obj/item/weapon/reagent_containers/glass/bottle/biomass /obj/item/weapon/reagent_containers/glass/bottle/biomass
name = "biomass bottle" name = "biomass bottle"
desc = "A bottle of raw biomass! Gross!" desc = "A bottle of raw biomass! Gross!"
icon = 'icons/obj/chemical.dmi' icon = 'icons/obj/chemical.dmi'
icon_state = "bottle-3" icon_state = "bottle-3"
prefill = list("biomass" = 60) prefill = list("biomass" = 60)

View File

@@ -1,25 +1,25 @@
/obj/item/weapon/reagent_containers/glass/bottle/robot /obj/item/weapon/reagent_containers/glass/bottle/robot
amount_per_transfer_from_this = 10 amount_per_transfer_from_this = 10
possible_transfer_amounts = list(5,10,15,25,30,50,100) possible_transfer_amounts = list(5,10,15,25,30,50,100)
flags = OPENCONTAINER flags = OPENCONTAINER
volume = 60 volume = 60
var/reagent = "" var/reagent = ""
/obj/item/weapon/reagent_containers/glass/bottle/robot/inaprovaline /obj/item/weapon/reagent_containers/glass/bottle/robot/inaprovaline
name = "internal inaprovaline bottle" name = "internal inaprovaline bottle"
desc = "A small bottle. Contains inaprovaline - used to stabilize patients." desc = "A small bottle. Contains inaprovaline - used to stabilize patients."
icon = 'icons/obj/chemical.dmi' icon = 'icons/obj/chemical.dmi'
icon_state = "bottle-4" icon_state = "bottle-4"
reagent = "inaprovaline" reagent = "inaprovaline"
prefill = list("inaprovaline" = 60) prefill = list("inaprovaline" = 60)
/obj/item/weapon/reagent_containers/glass/bottle/robot/antitoxin /obj/item/weapon/reagent_containers/glass/bottle/robot/antitoxin
name = "internal anti-toxin bottle" name = "internal anti-toxin bottle"
desc = "A small bottle of Anti-toxins. Counters poisons, and repairs damage, a wonder drug." desc = "A small bottle of Anti-toxins. Counters poisons, and repairs damage, a wonder drug."
icon = 'icons/obj/chemical.dmi' icon = 'icons/obj/chemical.dmi'
icon_state = "bottle-4" icon_state = "bottle-4"
reagent = "anti_toxin" reagent = "anti_toxin"
prefill = list("anti_toxin" = 60) prefill = list("anti_toxin" = 60)

View File

@@ -1,236 +1,236 @@
/obj/machinery/gibber /obj/machinery/gibber
name = "gibber" name = "gibber"
desc = "The name isn't descriptive enough?" desc = "The name isn't descriptive enough?"
icon = 'icons/obj/kitchen.dmi' icon = 'icons/obj/kitchen.dmi'
icon_state = "grinder" icon_state = "grinder"
density = 1 density = 1
anchored = 1 anchored = 1
req_access = list(access_kitchen,access_morgue) req_access = list(access_kitchen,access_morgue)
var/operating = 0 //Is it on? var/operating = 0 //Is it on?
var/dirty = 0 // Does it need cleaning? var/dirty = 0 // Does it need cleaning?
var/mob/living/occupant // Mob who has been put inside var/mob/living/occupant // Mob who has been put inside
var/gib_time = 40 // Time from starting until meat appears var/gib_time = 40 // Time from starting until meat appears
var/gib_throw_dir = WEST // Direction to spit meat and gibs in. var/gib_throw_dir = WEST // Direction to spit meat and gibs in.
use_power = 1 use_power = 1
idle_power_usage = 2 idle_power_usage = 2
active_power_usage = 500 active_power_usage = 500
//auto-gibs anything that bumps into it //auto-gibs anything that bumps into it
/obj/machinery/gibber/autogibber /obj/machinery/gibber/autogibber
var/turf/input_plate var/turf/input_plate
/obj/machinery/gibber/autogibber/New() /obj/machinery/gibber/autogibber/New()
..() ..()
spawn(5) spawn(5)
for(var/i in cardinal) for(var/i in cardinal)
var/obj/machinery/mineral/input/input_obj = locate( /obj/machinery/mineral/input, get_step(src.loc, i) ) var/obj/machinery/mineral/input/input_obj = locate( /obj/machinery/mineral/input, get_step(src.loc, i) )
if(input_obj) if(input_obj)
if(isturf(input_obj.loc)) if(isturf(input_obj.loc))
input_plate = input_obj.loc input_plate = input_obj.loc
gib_throw_dir = i gib_throw_dir = i
qdel(input_obj) qdel(input_obj)
break break
if(!input_plate) if(!input_plate)
log_misc("a [src] didn't find an input plate.") log_misc("a [src] didn't find an input plate.")
return return
/obj/machinery/gibber/autogibber/Bumped(var/atom/A) /obj/machinery/gibber/autogibber/Bumped(var/atom/A)
if(!input_plate) return if(!input_plate) return
if(ismob(A)) if(ismob(A))
var/mob/M = A var/mob/M = A
if(M.loc == input_plate if(M.loc == input_plate
) )
M.loc = src M.loc = src
M.gib() M.gib()
/obj/machinery/gibber/New() /obj/machinery/gibber/New()
..() ..()
src.overlays += image('icons/obj/kitchen.dmi', "grjam") src.overlays += image('icons/obj/kitchen.dmi', "grjam")
/obj/machinery/gibber/update_icon() /obj/machinery/gibber/update_icon()
overlays.Cut() overlays.Cut()
if (dirty) if (dirty)
src.overlays += image('icons/obj/kitchen.dmi', "grbloody") src.overlays += image('icons/obj/kitchen.dmi', "grbloody")
if(stat & (NOPOWER|BROKEN)) if(stat & (NOPOWER|BROKEN))
return return
if (!occupant) if (!occupant)
src.overlays += image('icons/obj/kitchen.dmi', "grjam") src.overlays += image('icons/obj/kitchen.dmi', "grjam")
else if (operating) else if (operating)
src.overlays += image('icons/obj/kitchen.dmi', "gruse") src.overlays += image('icons/obj/kitchen.dmi', "gruse")
else else
src.overlays += image('icons/obj/kitchen.dmi', "gridle") src.overlays += image('icons/obj/kitchen.dmi', "gridle")
/obj/machinery/gibber/relaymove(mob/user as mob) /obj/machinery/gibber/relaymove(mob/user as mob)
src.go_out() src.go_out()
return return
/obj/machinery/gibber/attack_hand(mob/user as mob) /obj/machinery/gibber/attack_hand(mob/user as mob)
if(stat & (NOPOWER|BROKEN)) if(stat & (NOPOWER|BROKEN))
return return
if(operating) if(operating)
user << "<span class='danger'>The gibber is locked and running, wait for it to finish.</span>" user << "<span class='danger'>The gibber is locked and running, wait for it to finish.</span>"
return return
else else
src.startgibbing(user) src.startgibbing(user)
/obj/machinery/gibber/examine() /obj/machinery/gibber/examine()
..() ..()
usr << "The safety guard is [emagged ? "<span class='danger'>disabled</span>" : "enabled"]." usr << "The safety guard is [emagged ? "<span class='danger'>disabled</span>" : "enabled"]."
/obj/machinery/gibber/emag_act(var/remaining_charges, var/mob/user) /obj/machinery/gibber/emag_act(var/remaining_charges, var/mob/user)
emagged = !emagged emagged = !emagged
user << "<span class='danger'>You [emagged ? "disable" : "enable"] the gibber safety guard.</span>" user << "<span class='danger'>You [emagged ? "disable" : "enable"] the gibber safety guard.</span>"
return 1 return 1
/obj/machinery/gibber/attackby(var/obj/item/W, var/mob/user) /obj/machinery/gibber/attackby(var/obj/item/W, var/mob/user)
var/obj/item/weapon/grab/G = W var/obj/item/weapon/grab/G = W
if(default_unfasten_wrench(user, W, 40)) if(default_unfasten_wrench(user, W, 40))
return return
if(!istype(G)) if(!istype(G))
return ..() return ..()
if(G.state < 2) if(G.state < 2)
user << "<span class='danger'>You need a better grip to do that!</span>" user << "<span class='danger'>You need a better grip to do that!</span>"
return return
move_into_gibber(user,G.affecting) move_into_gibber(user,G.affecting)
// Grab() process should clean up the grab item, no need to del it. // Grab() process should clean up the grab item, no need to del it.
/obj/machinery/gibber/MouseDrop_T(mob/target, mob/user) /obj/machinery/gibber/MouseDrop_T(mob/target, mob/user)
if(user.stat || user.restrained()) if(user.stat || user.restrained())
return return
move_into_gibber(user,target) move_into_gibber(user,target)
/obj/machinery/gibber/proc/move_into_gibber(var/mob/user,var/mob/living/victim) /obj/machinery/gibber/proc/move_into_gibber(var/mob/user,var/mob/living/victim)
if(src.occupant) if(src.occupant)
user << "<span class='danger'>The gibber is full, empty it first!</span>" user << "<span class='danger'>The gibber is full, empty it first!</span>"
return return
if(operating) if(operating)
user << "<span class='danger'>The gibber is locked and running, wait for it to finish.</span>" user << "<span class='danger'>The gibber is locked and running, wait for it to finish.</span>"
return return
if(!(istype(victim, /mob/living/carbon)) && !(istype(victim, /mob/living/simple_animal)) ) if(!(istype(victim, /mob/living/carbon)) && !(istype(victim, /mob/living/simple_animal)) )
user << "<span class='danger'>This is not suitable for the gibber!</span>" user << "<span class='danger'>This is not suitable for the gibber!</span>"
return return
if(istype(victim,/mob/living/carbon/human) && !emagged) if(istype(victim,/mob/living/carbon/human) && !emagged)
user << "<span class='danger'>The gibber safety guard is engaged!</span>" user << "<span class='danger'>The gibber safety guard is engaged!</span>"
return return
if(victim.abiotic(1)) if(victim.abiotic(1))
user << "<span class='danger'>Subject may not have abiotic items on.</span>" user << "<span class='danger'>Subject may not have abiotic items on.</span>"
return return
user.visible_message("<span class='danger'>[user] starts to put [victim] into the gibber!</span>") user.visible_message("<span class='danger'>[user] starts to put [victim] into the gibber!</span>")
src.add_fingerprint(user) src.add_fingerprint(user)
if(do_after(user, 30) && victim.Adjacent(src) && user.Adjacent(src) && victim.Adjacent(user) && !occupant) 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>") user.visible_message("<span class='danger'>[user] stuffs [victim] into the gibber!</span>")
if(victim.client) if(victim.client)
victim.client.perspective = EYE_PERSPECTIVE victim.client.perspective = EYE_PERSPECTIVE
victim.client.eye = src victim.client.eye = src
victim.loc = src victim.loc = src
src.occupant = victim src.occupant = victim
update_icon() update_icon()
/obj/machinery/gibber/verb/eject() /obj/machinery/gibber/verb/eject()
set category = "Object" set category = "Object"
set name = "Empty Gibber" set name = "Empty Gibber"
set src in oview(1) set src in oview(1)
if (usr.stat != 0) if (usr.stat != 0)
return return
src.go_out() src.go_out()
add_fingerprint(usr) add_fingerprint(usr)
return return
/obj/machinery/gibber/proc/go_out() /obj/machinery/gibber/proc/go_out()
if(operating || !src.occupant) if(operating || !src.occupant)
return return
for(var/obj/O in src) for(var/obj/O in src)
O.loc = src.loc O.loc = src.loc
if (src.occupant.client) if (src.occupant.client)
src.occupant.client.eye = src.occupant.client.mob src.occupant.client.eye = src.occupant.client.mob
src.occupant.client.perspective = MOB_PERSPECTIVE src.occupant.client.perspective = MOB_PERSPECTIVE
src.occupant.loc = src.loc src.occupant.loc = src.loc
src.occupant = null src.occupant = null
update_icon() update_icon()
return return
/obj/machinery/gibber/proc/startgibbing(mob/user as mob) /obj/machinery/gibber/proc/startgibbing(mob/user as mob)
if(src.operating) if(src.operating)
return return
if(!src.occupant) if(!src.occupant)
visible_message("<span class='danger'>You hear a loud metallic grinding sound.</span>") visible_message("<span class='danger'>You hear a loud metallic grinding sound.</span>")
return return
use_power(1000) use_power(1000)
visible_message("<span class='danger'>You hear a loud [occupant.isSynthetic() ? "metallic" : "squelchy"] grinding sound.</span>") visible_message("<span class='danger'>You hear a loud [occupant.isSynthetic() ? "metallic" : "squelchy"] grinding sound.</span>")
src.operating = 1 src.operating = 1
update_icon() update_icon()
var/slab_name = occupant.name var/slab_name = occupant.name
var/slab_count = 3 var/slab_count = 3
var/slab_type = /obj/item/weapon/reagent_containers/food/snacks/meat var/slab_type = /obj/item/weapon/reagent_containers/food/snacks/meat
var/slab_nutrition = src.occupant.nutrition / 15 var/slab_nutrition = src.occupant.nutrition / 15
// Some mobs have specific meat item types. // Some mobs have specific meat item types.
if(istype(src.occupant,/mob/living/simple_animal)) if(istype(src.occupant,/mob/living/simple_animal))
var/mob/living/simple_animal/critter = src.occupant var/mob/living/simple_animal/critter = src.occupant
if(critter.meat_amount) if(critter.meat_amount)
slab_count = critter.meat_amount slab_count = critter.meat_amount
if(critter.meat_type) if(critter.meat_type)
slab_type = critter.meat_type slab_type = critter.meat_type
else if(istype(src.occupant,/mob/living/carbon/human)) else if(istype(src.occupant,/mob/living/carbon/human))
var/mob/living/carbon/human/H = occupant var/mob/living/carbon/human/H = occupant
slab_name = src.occupant.real_name slab_name = src.occupant.real_name
slab_type = H.isSynthetic() ? /obj/item/stack/material/steel : H.species.meat_type slab_type = H.isSynthetic() ? /obj/item/stack/material/steel : H.species.meat_type
// Small mobs don't give as much nutrition. // Small mobs don't give as much nutrition.
if(issmall(src.occupant)) if(issmall(src.occupant))
slab_nutrition *= 0.5 slab_nutrition *= 0.5
slab_nutrition /= slab_count slab_nutrition /= slab_count
for(var/i=1 to 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)) var/obj/item/weapon/reagent_containers/food/snacks/meat/new_meat = new slab_type(src, rand(3,8))
if(istype(new_meat)) if(istype(new_meat))
new_meat.name = "[slab_name] [new_meat.name]" new_meat.name = "[slab_name] [new_meat.name]"
new_meat.reagents.add_reagent("nutriment",slab_nutrition) new_meat.reagents.add_reagent("nutriment",slab_nutrition)
if(src.occupant.reagents) if(src.occupant.reagents)
src.occupant.reagents.trans_to_obj(new_meat, round(occupant.reagents.total_volume/slab_count,1)) 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") add_attack_logs(user,occupant,"Used [src] to gib")
src.occupant.ghostize() src.occupant.ghostize()
spawn(gib_time) spawn(gib_time)
src.operating = 0 src.operating = 0
src.occupant.gib() src.occupant.gib()
qdel(src.occupant) qdel(src.occupant)
playsound(src.loc, 'sound/effects/splat.ogg', 50, 1) playsound(src.loc, 'sound/effects/splat.ogg', 50, 1)
operating = 0 operating = 0
for (var/obj/item/thing in contents) for (var/obj/item/thing in contents)
// There's a chance that the gibber will fail to destroy some evidence. // There's a chance that the gibber will fail to destroy some evidence.
if(istype(thing,/obj/item/organ) && prob(80)) if(istype(thing,/obj/item/organ) && prob(80))
qdel(thing) qdel(thing)
continue continue
thing.forceMove(get_turf(thing)) // Drop it onto the turf for throwing. 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. 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() update_icon()

View File

@@ -1,392 +1,392 @@
/obj/machinery/microwave /obj/machinery/microwave
name = "microwave" name = "microwave"
icon = 'icons/obj/kitchen.dmi' icon = 'icons/obj/kitchen.dmi'
icon_state = "mw" icon_state = "mw"
density = 1 density = 1
anchored = 1 anchored = 1
use_power = 1 use_power = 1
idle_power_usage = 5 idle_power_usage = 5
active_power_usage = 100 active_power_usage = 100
flags = OPENCONTAINER | NOREACT flags = OPENCONTAINER | NOREACT
circuit = /obj/item/weapon/circuitboard/microwave circuit = /obj/item/weapon/circuitboard/microwave
var/operating = 0 // Is it on? var/operating = 0 // Is it on?
var/dirty = 0 // = {0..100} Does it need cleaning? var/dirty = 0 // = {0..100} Does it need cleaning?
var/broken = 0 // ={0,1,2} How broken is it??? 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/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_items // List of the items you can put in
var/global/list/acceptable_reagents // List of the reagents you can put in var/global/list/acceptable_reagents // List of the reagents you can put in
var/global/max_n_of_items = 0 var/global/max_n_of_items = 0
// see code/modules/food/recipes_microwave.dm for recipes // see code/modules/food/recipes_microwave.dm for recipes
/******************* /*******************
* Initialising * Initialising
********************/ ********************/
/obj/machinery/microwave/New() /obj/machinery/microwave/New()
..() ..()
reagents = new/datum/reagents(100) reagents = new/datum/reagents(100)
reagents.my_atom = src reagents.my_atom = src
component_parts = list() component_parts = list()
component_parts += new /obj/item/weapon/stock_parts/console_screen(src) 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/motor(src)
component_parts += new /obj/item/weapon/stock_parts/capacitor(src) component_parts += new /obj/item/weapon/stock_parts/capacitor(src)
if (!available_recipes) if (!available_recipes)
available_recipes = new available_recipes = new
for (var/type in (typesof(/datum/recipe)-/datum/recipe)) for (var/type in (typesof(/datum/recipe)-/datum/recipe))
available_recipes+= new type available_recipes+= new type
acceptable_items = new acceptable_items = new
acceptable_reagents = new acceptable_reagents = new
for (var/datum/recipe/recipe in available_recipes) for (var/datum/recipe/recipe in available_recipes)
for (var/item in recipe.items) for (var/item in recipe.items)
acceptable_items |= item acceptable_items |= item
for (var/reagent in recipe.reagents) for (var/reagent in recipe.reagents)
acceptable_reagents |= reagent acceptable_reagents |= reagent
if (recipe.items) if (recipe.items)
max_n_of_items = max(max_n_of_items,recipe.items.len) 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 - // 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 // will also allow anything using the holder item to be microwaved into
// impure carbon. ~Z // impure carbon. ~Z
acceptable_items |= /obj/item/weapon/holder acceptable_items |= /obj/item/weapon/holder
acceptable_items |= /obj/item/weapon/reagent_containers/food/snacks/grown acceptable_items |= /obj/item/weapon/reagent_containers/food/snacks/grown
RefreshParts() RefreshParts()
/******************* /*******************
* Item Adding * Item Adding
********************/ ********************/
/obj/machinery/microwave/attackby(var/obj/item/O as obj, var/mob/user as mob) /obj/machinery/microwave/attackby(var/obj/item/O as obj, var/mob/user as mob)
if(src.broken > 0) if(src.broken > 0)
if(src.broken == 2 && O.is_screwdriver()) // If it's broken and they're using a screwdriver if(src.broken == 2 && O.is_screwdriver()) // If it's broken and they're using a screwdriver
user.visible_message( \ user.visible_message( \
"<span class='notice'>\The [user] starts to fix part of the microwave.</span>", \ "<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>" \ "<span class='notice'>You start to fix part of the microwave.</span>" \
) )
playsound(src, O.usesound, 50, 1) playsound(src, O.usesound, 50, 1)
if (do_after(user,20 * O.toolspeed)) if (do_after(user,20 * O.toolspeed))
user.visible_message( \ user.visible_message( \
"<span class='notice'>\The [user] fixes part of the microwave.</span>", \ "<span class='notice'>\The [user] fixes part of the microwave.</span>", \
"<span class='notice'>You have fixed part of the microwave.</span>" \ "<span class='notice'>You have fixed part of the microwave.</span>" \
) )
src.broken = 1 // Fix it a bit 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 else if(src.broken == 1 && O.is_wrench()) // If it's broken and they're doing the wrench
user.visible_message( \ user.visible_message( \
"<span class='notice'>\The [user] starts to fix part of the microwave.</span>", \ "<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>" \ "<span class='notice'>You start to fix part of the microwave.</span>" \
) )
if (do_after(user,20 * O.toolspeed)) if (do_after(user,20 * O.toolspeed))
user.visible_message( \ user.visible_message( \
"<span class='notice'>\The [user] fixes the microwave.</span>", \ "<span class='notice'>\The [user] fixes the microwave.</span>", \
"<span class='notice'>You have fixed the microwave.</span>" \ "<span class='notice'>You have fixed the microwave.</span>" \
) )
src.icon_state = "mw" src.icon_state = "mw"
src.broken = 0 // Fix it! src.broken = 0 // Fix it!
src.dirty = 0 // just to be sure src.dirty = 0 // just to be sure
src.flags = OPENCONTAINER | NOREACT src.flags = OPENCONTAINER | NOREACT
else else
to_chat(user, "<span class='warning'>It's broken!</span>") to_chat(user, "<span class='warning'>It's broken!</span>")
return 1 return 1
else if(default_deconstruction_screwdriver(user, O)) else if(default_deconstruction_screwdriver(user, O))
return return
else if(default_deconstruction_crowbar(user, O)) else if(default_deconstruction_crowbar(user, O))
return return
else if(default_unfasten_wrench(user, O, 10)) else if(default_unfasten_wrench(user, O, 10))
return return
else if(src.dirty==100) // The microwave is all dirty so can't be used! 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 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( \ user.visible_message( \
"<span class='notice'>\The [user] starts to clean the microwave.</span>", \ "<span class='notice'>\The [user] starts to clean the microwave.</span>", \
"<span class='notice'>You start to clean the microwave.</span>" \ "<span class='notice'>You start to clean the microwave.</span>" \
) )
if (do_after(user,20)) if (do_after(user,20))
user.visible_message( \ user.visible_message( \
"<span class='notice'>\The [user] has cleaned the microwave.</span>", \ "<span class='notice'>\The [user] has cleaned the microwave.</span>", \
"<span class='notice'>You have cleaned the microwave.</span>" \ "<span class='notice'>You have cleaned the microwave.</span>" \
) )
src.dirty = 0 // It's clean! src.dirty = 0 // It's clean!
src.broken = 0 // just to be sure src.broken = 0 // just to be sure
src.icon_state = "mw" src.icon_state = "mw"
src.flags = OPENCONTAINER | NOREACT src.flags = OPENCONTAINER | NOREACT
else //Otherwise bad luck!! else //Otherwise bad luck!!
to_chat(user, "<span class='warning'>It's dirty!</span>") to_chat(user, "<span class='warning'>It's dirty!</span>")
return 1 return 1
else if(is_type_in_list(O,acceptable_items)) 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 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>") to_chat(user, "<span class='warning'>This [src] is full of ingredients, you cannot put more.</span>")
return 1 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 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 var/obj/item/stack/S = O
new O.type (src) new O.type (src)
S.use(1) S.use(1)
user.visible_message( \ user.visible_message( \
"<span class='notice'>\The [user] has added one of [O] to \the [src].</span>", \ "<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>") "<span class='notice'>You add one of [O] to \the [src].</span>")
return return
else else
// user.remove_from_mob(O) //This just causes problems so far as I can tell. -Pete // user.remove_from_mob(O) //This just causes problems so far as I can tell. -Pete
user.drop_item() user.drop_item()
O.loc = src O.loc = src
user.visible_message( \ user.visible_message( \
"<span class='notice'>\The [user] has added \the [O] to \the [src].</span>", \ "<span class='notice'>\The [user] has added \the [O] to \the [src].</span>", \
"<span class='notice'>You add \the [O] to \the [src].</span>") "<span class='notice'>You add \the [O] to \the [src].</span>")
return return
else if(istype(O,/obj/item/weapon/reagent_containers/glass) || \ 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/drinks) || \
istype(O,/obj/item/weapon/reagent_containers/food/condiment) \ istype(O,/obj/item/weapon/reagent_containers/food/condiment) \
) )
if (!O.reagents) if (!O.reagents)
return 1 return 1
for (var/datum/reagent/R in O.reagents.reagent_list) for (var/datum/reagent/R in O.reagents.reagent_list)
if (!(R.id in acceptable_reagents)) if (!(R.id in acceptable_reagents))
to_chat(user, "<span class='warning'>Your [O] contains components unsuitable for cookery.</span>") to_chat(user, "<span class='warning'>Your [O] contains components unsuitable for cookery.</span>")
return 1 return 1
return return
else if(istype(O,/obj/item/weapon/grab)) else if(istype(O,/obj/item/weapon/grab))
var/obj/item/weapon/grab/G = O 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>") to_chat(user, "<span class='warning'>This is ridiculous. You can not fit \the [G.affecting] in this [src].</span>")
return 1 return 1
else else
to_chat(user, "<span class='warning'>You have no idea what you can cook with this [O].</span>") to_chat(user, "<span class='warning'>You have no idea what you can cook with this [O].</span>")
..() ..()
src.updateUsrDialog() src.updateUsrDialog()
/obj/machinery/microwave/attack_ai(mob/user as mob) /obj/machinery/microwave/attack_ai(mob/user as mob)
if(istype(user, /mob/living/silicon/robot) && Adjacent(user)) if(istype(user, /mob/living/silicon/robot) && Adjacent(user))
attack_hand(user) attack_hand(user)
/obj/machinery/microwave/attack_hand(mob/user as mob) /obj/machinery/microwave/attack_hand(mob/user as mob)
user.set_machine(src) user.set_machine(src)
interact(user) interact(user)
/******************* /*******************
* Microwave Menu * Microwave Menu
********************/ ********************/
/obj/machinery/microwave/interact(mob/user as mob) // The microwave Menu /obj/machinery/microwave/interact(mob/user as mob) // The microwave Menu
var/dat = "" var/dat = ""
if(src.broken > 0) if(src.broken > 0)
dat = {"<TT>Bzzzzttttt</TT>"} dat = {"<TT>Bzzzzttttt</TT>"}
else if(src.operating) else if(src.operating)
dat = {"<TT>Microwaving in progress!<BR>Please wait...!</TT>"} dat = {"<TT>Microwaving in progress!<BR>Please wait...!</TT>"}
else if(src.dirty==100) else if(src.dirty==100)
dat = {"<TT>This microwave is dirty!<BR>Please clean it before use!</TT>"} dat = {"<TT>This microwave is dirty!<BR>Please clean it before use!</TT>"}
else else
var/list/items_counts = new var/list/items_counts = new
var/list/items_measures = new var/list/items_measures = new
var/list/items_measures_p = new var/list/items_measures_p = new
for (var/obj/O in ((contents - component_parts) - circuit)) for (var/obj/O in ((contents - component_parts) - circuit))
var/display_name = O.name var/display_name = O.name
if (istype(O,/obj/item/weapon/reagent_containers/food/snacks/egg)) if (istype(O,/obj/item/weapon/reagent_containers/food/snacks/egg))
items_measures[display_name] = "egg" items_measures[display_name] = "egg"
items_measures_p[display_name] = "eggs" items_measures_p[display_name] = "eggs"
if (istype(O,/obj/item/weapon/reagent_containers/food/snacks/tofu)) if (istype(O,/obj/item/weapon/reagent_containers/food/snacks/tofu))
items_measures[display_name] = "tofu chunk" items_measures[display_name] = "tofu chunk"
items_measures_p[display_name] = "tofu chunks" items_measures_p[display_name] = "tofu chunks"
if (istype(O,/obj/item/weapon/reagent_containers/food/snacks/meat)) //any meat if (istype(O,/obj/item/weapon/reagent_containers/food/snacks/meat)) //any meat
items_measures[display_name] = "slab of meat" items_measures[display_name] = "slab of meat"
items_measures_p[display_name] = "slabs of meat" items_measures_p[display_name] = "slabs of meat"
if (istype(O,/obj/item/weapon/reagent_containers/food/snacks/donkpocket)) if (istype(O,/obj/item/weapon/reagent_containers/food/snacks/donkpocket))
display_name = "Turnovers" display_name = "Turnovers"
items_measures[display_name] = "turnover" items_measures[display_name] = "turnover"
items_measures_p[display_name] = "turnovers" items_measures_p[display_name] = "turnovers"
if (istype(O,/obj/item/weapon/reagent_containers/food/snacks/carpmeat)) if (istype(O,/obj/item/weapon/reagent_containers/food/snacks/carpmeat))
items_measures[display_name] = "fillet of meat" items_measures[display_name] = "fillet of meat"
items_measures_p[display_name] = "fillets of meat" items_measures_p[display_name] = "fillets of meat"
items_counts[display_name]++ items_counts[display_name]++
for (var/O in items_counts) for (var/O in items_counts)
var/N = items_counts[O] var/N = items_counts[O]
if (!(O in items_measures)) if (!(O in items_measures))
dat += {"<B>[capitalize(O)]:</B> [N] [lowertext(O)]\s<BR>"} dat += {"<B>[capitalize(O)]:</B> [N] [lowertext(O)]\s<BR>"}
else else
if (N==1) if (N==1)
dat += {"<B>[capitalize(O)]:</B> [N] [items_measures[O]]<BR>"} dat += {"<B>[capitalize(O)]:</B> [N] [items_measures[O]]<BR>"}
else else
dat += {"<B>[capitalize(O)]:</B> [N] [items_measures_p[O]]<BR>"} dat += {"<B>[capitalize(O)]:</B> [N] [items_measures_p[O]]<BR>"}
for (var/datum/reagent/R in reagents.reagent_list) for (var/datum/reagent/R in reagents.reagent_list)
var/display_name = R.name var/display_name = R.name
if (R.id == "capsaicin") if (R.id == "capsaicin")
display_name = "Hotsauce" display_name = "Hotsauce"
if (R.id == "frostoil") if (R.id == "frostoil")
display_name = "Coldsauce" display_name = "Coldsauce"
dat += {"<B>[display_name]:</B> [R.volume] unit\s<BR>"} dat += {"<B>[display_name]:</B> [R.volume] unit\s<BR>"}
if (items_counts.len==0 && reagents.reagent_list.len==0) if (items_counts.len==0 && reagents.reagent_list.len==0)
dat = {"<B>The microwave is empty</B><BR>"} dat = {"<B>The microwave is empty</B><BR>"}
else else
dat = {"<b>Ingredients:</b><br>[dat]"} dat = {"<b>Ingredients:</b><br>[dat]"}
dat += {"<HR><BR>\ dat += {"<HR><BR>\
<A href='?src=\ref[src];action=cook'>Turn on!<BR>\ <A href='?src=\ref[src];action=cook'>Turn on!<BR>\
<A href='?src=\ref[src];action=dispose'>Eject ingredients!<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")) to_chat(user, browse("<HEAD><TITLE>Microwave Controls</TITLE></HEAD><TT>[dat]</TT>", "window=microwave"))
onclose(user, "microwave") onclose(user, "microwave")
return return
/*********************************** /***********************************
* Microwave Menu Handling/Cooking * Microwave Menu Handling/Cooking
************************************/ ************************************/
/obj/machinery/microwave/proc/cook() /obj/machinery/microwave/proc/cook()
if(stat & (NOPOWER|BROKEN)) if(stat & (NOPOWER|BROKEN))
return return
start() start()
if (reagents.total_volume==0 && !(locate(/obj) in ((contents - component_parts) - circuit))) //dry run if (reagents.total_volume==0 && !(locate(/obj) in ((contents - component_parts) - circuit))) //dry run
if (!wzhzhzh(10)) if (!wzhzhzh(10))
abort() abort()
return return
stop() stop()
return return
var/datum/recipe/recipe = select_recipe(available_recipes,src) var/datum/recipe/recipe = select_recipe(available_recipes,src)
var/obj/cooked var/obj/cooked
if (!recipe) if (!recipe)
dirty += 1 dirty += 1
if (prob(max(10,dirty*5))) if (prob(max(10,dirty*5)))
if (!wzhzhzh(4)) if (!wzhzhzh(4))
abort() abort()
return return
muck_start() muck_start()
wzhzhzh(4) wzhzhzh(4)
muck_finish() muck_finish()
cooked = fail() cooked = fail()
cooked.loc = src.loc cooked.loc = src.loc
return return
else if (has_extra_item()) else if (has_extra_item())
if (!wzhzhzh(4)) if (!wzhzhzh(4))
abort() abort()
return return
broke() broke()
cooked = fail() cooked = fail()
cooked.loc = src.loc cooked.loc = src.loc
return return
else else
if (!wzhzhzh(10)) if (!wzhzhzh(10))
abort() abort()
return return
stop() stop()
cooked = fail() cooked = fail()
cooked.loc = src.loc cooked.loc = src.loc
return return
else else
var/halftime = round(recipe.time/10/2) var/halftime = round(recipe.time/10/2)
if (!wzhzhzh(halftime)) if (!wzhzhzh(halftime))
abort() abort()
return return
if (!wzhzhzh(halftime)) if (!wzhzhzh(halftime))
abort() abort()
cooked = fail() cooked = fail()
cooked.loc = src.loc cooked.loc = src.loc
return return
cooked = recipe.make_food(src) cooked = recipe.make_food(src)
stop() stop()
if(cooked) if(cooked)
cooked.loc = src.loc cooked.loc = src.loc
return return
/obj/machinery/microwave/proc/wzhzhzh(var/seconds as num) // Whoever named this proc is fucking literally Satan. ~ Z /obj/machinery/microwave/proc/wzhzhzh(var/seconds as num) // Whoever named this proc is fucking literally Satan. ~ Z
for (var/i=1 to seconds) for (var/i=1 to seconds)
if (stat & (NOPOWER|BROKEN)) if (stat & (NOPOWER|BROKEN))
return 0 return 0
use_power(500) use_power(500)
sleep(10) sleep(10)
return 1 return 1
/obj/machinery/microwave/proc/has_extra_item() /obj/machinery/microwave/proc/has_extra_item()
for (var/obj/O in ((contents - component_parts) - circuit)) for (var/obj/O in ((contents - component_parts) - circuit))
if ( \ if ( \
!istype(O,/obj/item/weapon/reagent_containers/food) && \ !istype(O,/obj/item/weapon/reagent_containers/food) && \
!istype(O, /obj/item/weapon/grown) \ !istype(O, /obj/item/weapon/grown) \
) )
return 1 return 1
return 0 return 0
/obj/machinery/microwave/proc/start() /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.visible_message("<span class='notice'>The microwave turns on.</span>", "<span class='notice'>You hear a microwave.</span>")
src.operating = 1 src.operating = 1
src.icon_state = "mw1" src.icon_state = "mw1"
src.updateUsrDialog() src.updateUsrDialog()
/obj/machinery/microwave/proc/abort() /obj/machinery/microwave/proc/abort()
src.operating = 0 // Turn it off again aferwards src.operating = 0 // Turn it off again aferwards
src.icon_state = "mw" src.icon_state = "mw"
src.updateUsrDialog() src.updateUsrDialog()
/obj/machinery/microwave/proc/stop() /obj/machinery/microwave/proc/stop()
playsound(src.loc, 'sound/machines/ding.ogg', 50, 1) playsound(src.loc, 'sound/machines/ding.ogg', 50, 1)
src.operating = 0 // Turn it off again aferwards src.operating = 0 // Turn it off again aferwards
src.icon_state = "mw" src.icon_state = "mw"
src.updateUsrDialog() src.updateUsrDialog()
/obj/machinery/microwave/proc/dispose() /obj/machinery/microwave/proc/dispose()
for (var/obj/O in ((contents-component_parts)-circuit)) for (var/obj/O in ((contents-component_parts)-circuit))
O.loc = src.loc O.loc = src.loc
if (src.reagents.total_volume) if (src.reagents.total_volume)
src.dirty++ src.dirty++
src.reagents.clear_reagents() src.reagents.clear_reagents()
usr << "<span class='notice'>You dispose of the microwave contents.</span>" usr << "<span class='notice'>You dispose of the microwave contents.</span>"
src.updateUsrDialog() src.updateUsrDialog()
/obj/machinery/microwave/proc/muck_start() /obj/machinery/microwave/proc/muck_start()
playsound(src.loc, 'sound/effects/splat.ogg', 50, 1) // Play a splat sound playsound(src.loc, 'sound/effects/splat.ogg', 50, 1) // Play a splat sound
src.icon_state = "mwbloody1" // Make it look dirty!! src.icon_state = "mwbloody1" // Make it look dirty!!
/obj/machinery/microwave/proc/muck_finish() /obj/machinery/microwave/proc/muck_finish()
playsound(src.loc, 'sound/machines/ding.ogg', 50, 1) playsound(src.loc, 'sound/machines/ding.ogg', 50, 1)
src.visible_message("<span class='warning'>The microwave gets covered in muck!</span>") 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.dirty = 100 // Make it dirty so it can't be used util cleaned
src.flags = null //So you can't add condiments src.flags = null //So you can't add condiments
src.icon_state = "mwbloody" // Make it look dirty too src.icon_state = "mwbloody" // Make it look dirty too
src.operating = 0 // Turn it off again aferwards src.operating = 0 // Turn it off again aferwards
src.updateUsrDialog() src.updateUsrDialog()
/obj/machinery/microwave/proc/broke() /obj/machinery/microwave/proc/broke()
var/datum/effect/effect/system/spark_spread/s = new var/datum/effect/effect/system/spark_spread/s = new
s.set_up(2, 1, src) s.set_up(2, 1, src)
s.start() s.start()
src.icon_state = "mwb" // Make it look all busted up and shit 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.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.broken = 2 // Make it broken so it can't be used util fixed
src.flags = null //So you can't add condiments src.flags = null //So you can't add condiments
src.operating = 0 // Turn it off again aferwards src.operating = 0 // Turn it off again aferwards
src.updateUsrDialog() src.updateUsrDialog()
/obj/machinery/microwave/proc/fail() /obj/machinery/microwave/proc/fail()
var/obj/item/weapon/reagent_containers/food/snacks/badrecipe/ffuu = new(src) var/obj/item/weapon/reagent_containers/food/snacks/badrecipe/ffuu = new(src)
var/amount = 0 var/amount = 0
for (var/obj/O in (((contents - ffuu) - component_parts) - circuit)) for (var/obj/O in (((contents - ffuu) - component_parts) - circuit))
amount++ amount++
if (O.reagents) if (O.reagents)
var/id = O.reagents.get_master_reagent_id() var/id = O.reagents.get_master_reagent_id()
if (id) if (id)
amount+=O.reagents.get_reagent_amount(id) amount+=O.reagents.get_reagent_amount(id)
qdel(O) qdel(O)
src.reagents.clear_reagents() src.reagents.clear_reagents()
ffuu.reagents.add_reagent("carbon", amount) ffuu.reagents.add_reagent("carbon", amount)
ffuu.reagents.add_reagent("toxin", amount/10) ffuu.reagents.add_reagent("toxin", amount/10)
return ffuu return ffuu
/obj/machinery/microwave/Topic(href, href_list) /obj/machinery/microwave/Topic(href, href_list)
if(..()) if(..())
return return
usr.set_machine(src) usr.set_machine(src)
if(src.operating) if(src.operating)
src.updateUsrDialog() src.updateUsrDialog()
return return
switch(href_list["action"]) switch(href_list["action"])
if ("cook") if ("cook")
cook() cook()
if ("dispose") if ("dispose")
dispose() dispose()
return return

View File

@@ -1,388 +1,388 @@
/* SmartFridge. Much todo /* SmartFridge. Much todo
*/ */
/obj/machinery/smartfridge /obj/machinery/smartfridge
name = "\improper SmartFridge" name = "\improper SmartFridge"
icon = 'icons/obj/vending.dmi' icon = 'icons/obj/vending.dmi'
icon_state = "smartfridge" icon_state = "smartfridge"
density = 1 density = 1
anchored = 1 anchored = 1
use_power = 1 use_power = 1
idle_power_usage = 5 idle_power_usage = 5
active_power_usage = 100 active_power_usage = 100
flags = NOREACT flags = NOREACT
var/global/max_n_of_items = 999 // Sorry but the BYOND infinite loop detector doesn't look things over 1000. 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_on = "smartfridge"
var/icon_off = "smartfridge-off" var/icon_off = "smartfridge-off"
var/icon_panel = "smartfridge-panel" var/icon_panel = "smartfridge-panel"
var/list/item_records = list() var/list/item_records = list()
var/datum/stored_item/currently_vending = null //What we're putting out of the machine. var/datum/stored_item/currently_vending = null //What we're putting out of the machine.
var/seconds_electrified = 0; var/seconds_electrified = 0;
var/shoot_inventory = 0 var/shoot_inventory = 0
var/locked = 0 var/locked = 0
var/scan_id = 1 var/scan_id = 1
var/is_secure = 0 var/is_secure = 0
var/wrenchable = 0 var/wrenchable = 0
var/datum/wires/smartfridge/wires = null var/datum/wires/smartfridge/wires = null
/obj/machinery/smartfridge/secure /obj/machinery/smartfridge/secure
is_secure = 1 is_secure = 1
/obj/machinery/smartfridge/New() /obj/machinery/smartfridge/New()
..() ..()
if(is_secure) if(is_secure)
wires = new/datum/wires/smartfridge/secure(src) wires = new/datum/wires/smartfridge/secure(src)
else else
wires = new/datum/wires/smartfridge(src) wires = new/datum/wires/smartfridge(src)
/obj/machinery/smartfridge/Destroy() /obj/machinery/smartfridge/Destroy()
qdel(wires) qdel(wires)
for(var/A in item_records) //Get rid of item records. for(var/A in item_records) //Get rid of item records.
qdel(A) qdel(A)
wires = null wires = null
return ..() return ..()
/obj/machinery/smartfridge/proc/accept_check(var/obj/item/O as obj) /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/)) if(istype(O,/obj/item/weapon/reagent_containers/food/snacks/grown/) || istype(O,/obj/item/seeds/))
return 1 return 1
return 0 return 0
/obj/machinery/smartfridge/seeds /obj/machinery/smartfridge/seeds
name = "\improper MegaSeed Servitor" name = "\improper MegaSeed Servitor"
desc = "When you need seeds fast!" desc = "When you need seeds fast!"
icon = 'icons/obj/vending.dmi' icon = 'icons/obj/vending.dmi'
icon_state = "seeds" icon_state = "seeds"
icon_on = "seeds" icon_on = "seeds"
icon_off = "seeds-off" icon_off = "seeds-off"
/obj/machinery/smartfridge/seeds/accept_check(var/obj/item/O as obj) /obj/machinery/smartfridge/seeds/accept_check(var/obj/item/O as obj)
if(istype(O,/obj/item/seeds/)) if(istype(O,/obj/item/seeds/))
return 1 return 1
return 0 return 0
/obj/machinery/smartfridge/secure/extract /obj/machinery/smartfridge/secure/extract
name = "\improper Biological Sample Storage" name = "\improper Biological Sample Storage"
desc = "A refrigerated storage unit for xenobiological samples." desc = "A refrigerated storage unit for xenobiological samples."
req_access = list(access_research) req_access = list(access_research)
/obj/machinery/smartfridge/secure/extract/accept_check(var/obj/item/O as obj) /obj/machinery/smartfridge/secure/extract/accept_check(var/obj/item/O as obj)
if(istype(O, /obj/item/slime_extract)) if(istype(O, /obj/item/slime_extract))
return TRUE return TRUE
if(istype(O, /obj/item/slimepotion)) if(istype(O, /obj/item/slimepotion))
return TRUE return TRUE
return FALSE return FALSE
/obj/machinery/smartfridge/secure/medbay /obj/machinery/smartfridge/secure/medbay
name = "\improper Refrigerated Medicine Storage" name = "\improper Refrigerated Medicine Storage"
desc = "A refrigerated storage unit for storing medicine and chemicals." desc = "A refrigerated storage unit for storing medicine and chemicals."
icon_state = "smartfridge" //To fix the icon in the map editor. icon_state = "smartfridge" //To fix the icon in the map editor.
icon_on = "smartfridge_chem" icon_on = "smartfridge_chem"
req_one_access = list(access_medical,access_chemistry) req_one_access = list(access_medical,access_chemistry)
/obj/machinery/smartfridge/secure/medbay/accept_check(var/obj/item/O as obj) /obj/machinery/smartfridge/secure/medbay/accept_check(var/obj/item/O as obj)
if(istype(O,/obj/item/weapon/reagent_containers/glass/)) if(istype(O,/obj/item/weapon/reagent_containers/glass/))
return 1 return 1
if(istype(O,/obj/item/weapon/storage/pill_bottle/)) if(istype(O,/obj/item/weapon/storage/pill_bottle/))
return 1 return 1
if(istype(O,/obj/item/weapon/reagent_containers/pill/)) if(istype(O,/obj/item/weapon/reagent_containers/pill/))
return 1 return 1
return 0 return 0
/obj/machinery/smartfridge/secure/virology /obj/machinery/smartfridge/secure/virology
name = "\improper Refrigerated Virus Storage" name = "\improper Refrigerated Virus Storage"
desc = "A refrigerated storage unit for storing viral material." desc = "A refrigerated storage unit for storing viral material."
req_access = list(access_virology) req_access = list(access_virology)
icon_state = "smartfridge_virology" icon_state = "smartfridge_virology"
icon_on = "smartfridge_virology" icon_on = "smartfridge_virology"
icon_off = "smartfridge_virology-off" icon_off = "smartfridge_virology-off"
/obj/machinery/smartfridge/secure/virology/accept_check(var/obj/item/O as obj) /obj/machinery/smartfridge/secure/virology/accept_check(var/obj/item/O as obj)
if(istype(O,/obj/item/weapon/reagent_containers/glass/beaker/vial/)) if(istype(O,/obj/item/weapon/reagent_containers/glass/beaker/vial/))
return 1 return 1
if(istype(O,/obj/item/weapon/virusdish/)) if(istype(O,/obj/item/weapon/virusdish/))
return 1 return 1
return 0 return 0
/obj/machinery/smartfridge/chemistry /obj/machinery/smartfridge/chemistry
name = "\improper Smart Chemical Storage" name = "\improper Smart Chemical Storage"
desc = "A refrigerated storage unit for medicine and chemical storage." desc = "A refrigerated storage unit for medicine and chemical storage."
/obj/machinery/smartfridge/chemistry/accept_check(var/obj/item/O as obj) /obj/machinery/smartfridge/chemistry/accept_check(var/obj/item/O as obj)
if(istype(O,/obj/item/weapon/storage/pill_bottle) || istype(O,/obj/item/weapon/reagent_containers)) if(istype(O,/obj/item/weapon/storage/pill_bottle) || istype(O,/obj/item/weapon/reagent_containers))
return 1 return 1
return 0 return 0
/obj/machinery/smartfridge/chemistry/virology /obj/machinery/smartfridge/chemistry/virology
name = "\improper Smart Virus Storage" name = "\improper Smart Virus Storage"
desc = "A refrigerated storage unit for volatile sample storage." desc = "A refrigerated storage unit for volatile sample storage."
/obj/machinery/smartfridge/drinks /obj/machinery/smartfridge/drinks
name = "\improper Drink Showcase" name = "\improper Drink Showcase"
desc = "A refrigerated storage unit for tasty tasty alcohol." desc = "A refrigerated storage unit for tasty tasty alcohol."
/obj/machinery/smartfridge/drinks/accept_check(var/obj/item/O as obj) /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)) if(istype(O,/obj/item/weapon/reagent_containers/glass) || istype(O,/obj/item/weapon/reagent_containers/food/drinks) || istype(O,/obj/item/weapon/reagent_containers/food/condiment))
return 1 return 1
/obj/machinery/smartfridge/drying_rack /obj/machinery/smartfridge/drying_rack
name = "\improper Drying Rack" name = "\improper Drying Rack"
desc = "A machine for drying plants." desc = "A machine for drying plants."
wrenchable = 1 wrenchable = 1
icon_state = "drying_rack" icon_state = "drying_rack"
icon_on = "drying_rack_on" icon_on = "drying_rack_on"
icon_off = "drying_rack" icon_off = "drying_rack"
icon_panel = "drying_rack-panel" icon_panel = "drying_rack-panel"
/obj/machinery/smartfridge/drying_rack/accept_check(var/obj/item/O as obj) /obj/machinery/smartfridge/drying_rack/accept_check(var/obj/item/O as obj)
if(istype(O, /obj/item/weapon/reagent_containers/food/snacks/)) if(istype(O, /obj/item/weapon/reagent_containers/food/snacks/))
var/obj/item/weapon/reagent_containers/food/snacks/S = O var/obj/item/weapon/reagent_containers/food/snacks/S = O
if (S.dried_type) if (S.dried_type)
return 1 return 1
return 0 return 0
/obj/machinery/smartfridge/drying_rack/process() /obj/machinery/smartfridge/drying_rack/process()
..() ..()
if(stat & (BROKEN|NOPOWER)) if(stat & (BROKEN|NOPOWER))
return return
if(contents.len) if(contents.len)
dry() dry()
update_icon() update_icon()
/obj/machinery/smartfridge/drying_rack/update_icon() /obj/machinery/smartfridge/drying_rack/update_icon()
overlays.Cut() overlays.Cut()
var/not_working = stat & (BROKEN|NOPOWER) var/not_working = stat & (BROKEN|NOPOWER)
if(not_working) if(not_working)
icon_state = icon_off icon_state = icon_off
else else
icon_state = icon_on icon_state = icon_on
var/hasItems var/hasItems
for(var/datum/stored_item/I in item_records) for(var/datum/stored_item/I in item_records)
if(I.get_amount()) if(I.get_amount())
hasItems = 1 hasItems = 1
break break
if(hasItems) if(hasItems)
overlays += "drying_rack_filled" overlays += "drying_rack_filled"
if(!not_working) if(!not_working)
overlays += "drying_rack_drying" overlays += "drying_rack_drying"
/obj/machinery/smartfridge/drying_rack/proc/dry() /obj/machinery/smartfridge/drying_rack/proc/dry()
for(var/datum/stored_item/I in item_records) for(var/datum/stored_item/I in item_records)
for(var/obj/item/weapon/reagent_containers/food/snacks/S in I.instances) for(var/obj/item/weapon/reagent_containers/food/snacks/S in I.instances)
if(S.dry) continue if(S.dry) continue
if(S.dried_type == S.type) if(S.dried_type == S.type)
S.dry = 1 S.dry = 1
S.name = "dried [S.name]" S.name = "dried [S.name]"
S.color = "#AAAAAA" S.color = "#AAAAAA"
I.instances -= S I.instances -= S
S.forceMove(get_turf(src)) S.forceMove(get_turf(src))
else else
var/D = S.dried_type var/D = S.dried_type
new D(get_turf(src)) new D(get_turf(src))
qdel(S) qdel(S)
return return
return return
/obj/machinery/smartfridge/process() /obj/machinery/smartfridge/process()
if(stat & (BROKEN|NOPOWER)) if(stat & (BROKEN|NOPOWER))
return return
if(src.seconds_electrified > 0) if(src.seconds_electrified > 0)
src.seconds_electrified-- src.seconds_electrified--
if(src.shoot_inventory && prob(2)) if(src.shoot_inventory && prob(2))
src.throw_item() src.throw_item()
/obj/machinery/smartfridge/power_change() /obj/machinery/smartfridge/power_change()
var/old_stat = stat var/old_stat = stat
..() ..()
if(old_stat != stat) if(old_stat != stat)
update_icon() update_icon()
/obj/machinery/smartfridge/update_icon() /obj/machinery/smartfridge/update_icon()
if(stat & (BROKEN|NOPOWER)) if(stat & (BROKEN|NOPOWER))
icon_state = icon_off icon_state = icon_off
else else
icon_state = icon_on icon_state = icon_on
/******************* /*******************
* Item Adding * Item Adding
********************/ ********************/
/obj/machinery/smartfridge/attackby(var/obj/item/O as obj, var/mob/user as mob) /obj/machinery/smartfridge/attackby(var/obj/item/O as obj, var/mob/user as mob)
if(O.is_screwdriver()) if(O.is_screwdriver())
panel_open = !panel_open 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].") 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) playsound(src, O.usesound, 50, 1)
overlays.Cut() overlays.Cut()
if(panel_open) if(panel_open)
overlays += image(icon, icon_panel) overlays += image(icon, icon_panel)
GLOB.nanomanager.update_uis(src) GLOB.nanomanager.update_uis(src)
return return
if(wrenchable && default_unfasten_wrench(user, O, 20)) if(wrenchable && default_unfasten_wrench(user, O, 20))
return return
if(istype(O, /obj/item/device/multitool) || O.is_wirecutter()) if(istype(O, /obj/item/device/multitool) || O.is_wirecutter())
if(panel_open) if(panel_open)
attack_hand(user) attack_hand(user)
return return
if(stat & NOPOWER) if(stat & NOPOWER)
to_chat(user, "<span class='notice'>\The [src] is unpowered and useless.</span>") to_chat(user, "<span class='notice'>\The [src] is unpowered and useless.</span>")
return return
if(accept_check(O)) if(accept_check(O))
user.remove_from_mob(O) user.remove_from_mob(O)
stock(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>") 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)) else if(istype(O, /obj/item/weapon/storage/bag))
var/obj/item/weapon/storage/bag/P = O var/obj/item/weapon/storage/bag/P = O
var/plants_loaded = 0 var/plants_loaded = 0
for(var/obj/G in P.contents) for(var/obj/G in P.contents)
if(accept_check(G)) if(accept_check(G))
P.remove_from_storage(G) //fixes ui bug - Pull Request 5515 P.remove_from_storage(G) //fixes ui bug - Pull Request 5515
stock(G) stock(G)
plants_loaded = 1 plants_loaded = 1
if(plants_loaded) 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>") 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) if(P.contents.len > 0)
to_chat(user, "<span class='notice'>Some items are refused.</span>") to_chat(user, "<span class='notice'>Some items are refused.</span>")
else if(istype(O, /obj/item/weapon/gripper)) // Grippers. ~Mechoid. else if(istype(O, /obj/item/weapon/gripper)) // Grippers. ~Mechoid.
var/obj/item/weapon/gripper/B = O //B, for Borg. var/obj/item/weapon/gripper/B = O //B, for Borg.
if(!B.wrapped) if(!B.wrapped)
to_chat(user, "\The [B] is not holding anything.") to_chat(user, "\The [B] is not holding anything.")
return return
else else
var/B_held = B.wrapped var/B_held = B.wrapped
to_chat(user, "You use \the [B] to put \the [B_held] into \the [src].") to_chat(user, "You use \the [B] to put \the [B_held] into \the [src].")
return return
else else
to_chat(user, "<span class='notice'>\The [src] smartly refuses [O].</span>") to_chat(user, "<span class='notice'>\The [src] smartly refuses [O].</span>")
return 1 return 1
/obj/machinery/smartfridge/secure/emag_act(var/remaining_charges, var/mob/user) /obj/machinery/smartfridge/secure/emag_act(var/remaining_charges, var/mob/user)
if(!emagged) if(!emagged)
emagged = 1 emagged = 1
locked = -1 locked = -1
to_chat(user, "You short out the product lock on [src].") to_chat(user, "You short out the product lock on [src].")
return 1 return 1
/obj/machinery/smartfridge/proc/stock(obj/item/O) /obj/machinery/smartfridge/proc/stock(obj/item/O)
var/hasRecord = FALSE //Check to see if this passes or not. var/hasRecord = FALSE //Check to see if this passes or not.
for(var/datum/stored_item/I in item_records) for(var/datum/stored_item/I in item_records)
if((O.type == I.item_path) && (O.name == I.item_name)) if((O.type == I.item_path) && (O.name == I.item_name))
I.add_product(O) I.add_product(O)
hasRecord = TRUE hasRecord = TRUE
break break
if(!hasRecord) if(!hasRecord)
var/datum/stored_item/item = new/datum/stored_item(src, O.type, O.name) var/datum/stored_item/item = new/datum/stored_item(src, O.type, O.name)
item.add_product(O) item.add_product(O)
item_records.Add(item) item_records.Add(item)
GLOB.nanomanager.update_uis(src) GLOB.nanomanager.update_uis(src)
/obj/machinery/smartfridge/proc/vend(datum/stored_item/I) /obj/machinery/smartfridge/proc/vend(datum/stored_item/I)
I.get_product(get_turf(src)) I.get_product(get_turf(src))
GLOB.nanomanager.update_uis(src) GLOB.nanomanager.update_uis(src)
/obj/machinery/smartfridge/attack_ai(mob/user as mob) /obj/machinery/smartfridge/attack_ai(mob/user as mob)
attack_hand(user) attack_hand(user)
/obj/machinery/smartfridge/attack_hand(mob/user as mob) /obj/machinery/smartfridge/attack_hand(mob/user as mob)
if(stat & (NOPOWER|BROKEN)) if(stat & (NOPOWER|BROKEN))
return return
wires.Interact(user) wires.Interact(user)
ui_interact(user) ui_interact(user)
/******************* /*******************
* SmartFridge Menu * SmartFridge Menu
********************/ ********************/
/obj/machinery/smartfridge/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1) /obj/machinery/smartfridge/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1)
user.set_machine(src) user.set_machine(src)
var/data[0] var/data[0]
data["contents"] = null data["contents"] = null
data["electrified"] = seconds_electrified > 0 data["electrified"] = seconds_electrified > 0
data["shoot_inventory"] = shoot_inventory data["shoot_inventory"] = shoot_inventory
data["locked"] = locked data["locked"] = locked
data["secure"] = is_secure data["secure"] = is_secure
var/list/items[0] var/list/items[0]
for (var/i=1 to length(item_records)) for (var/i=1 to length(item_records))
var/datum/stored_item/I = item_records[i] var/datum/stored_item/I = item_records[i]
var/count = I.get_amount() var/count = I.get_amount()
if(count > 0) if(count > 0)
items.Add(list(list("display_name" = html_encode(capitalize(I.item_name)), "vend" = i, "quantity" = count))) items.Add(list(list("display_name" = html_encode(capitalize(I.item_name)), "vend" = i, "quantity" = count)))
if(items.len > 0) if(items.len > 0)
data["contents"] = items data["contents"] = items
ui = GLOB.nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) ui = GLOB.nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
if(!ui) if(!ui)
ui = new(user, src, ui_key, "smartfridge.tmpl", src.name, 400, 500) ui = new(user, src, ui_key, "smartfridge.tmpl", src.name, 400, 500)
ui.set_initial_data(data) ui.set_initial_data(data)
ui.open() ui.open()
/obj/machinery/smartfridge/Topic(href, href_list) /obj/machinery/smartfridge/Topic(href, href_list)
if(..()) return 0 if(..()) return 0
var/mob/user = usr var/mob/user = usr
var/datum/nanoui/ui = GLOB.nanomanager.get_open_ui(user, src, "main") var/datum/nanoui/ui = GLOB.nanomanager.get_open_ui(user, src, "main")
src.add_fingerprint(user) src.add_fingerprint(user)
if(href_list["close"]) if(href_list["close"])
user.unset_machine() user.unset_machine()
ui.close() ui.close()
return 0 return 0
if(href_list["vend"]) if(href_list["vend"])
var/index = text2num(href_list["vend"]) var/index = text2num(href_list["vend"])
var/amount = text2num(href_list["amount"]) var/amount = text2num(href_list["amount"])
var/datum/stored_item/I = item_records[index] var/datum/stored_item/I = item_records[index]
var/count = I.get_amount() var/count = I.get_amount()
// Sanity check, there are probably ways to press the button when it shouldn't be possible. // Sanity check, there are probably ways to press the button when it shouldn't be possible.
if(count > 0) if(count > 0)
if((count - amount) < 0) if((count - amount) < 0)
amount = count amount = count
for(var/i = 1 to amount) for(var/i = 1 to amount)
vend(I) vend(I)
return 1 return 1
return 0 return 0
/obj/machinery/smartfridge/proc/throw_item() /obj/machinery/smartfridge/proc/throw_item()
var/obj/throw_item = null var/obj/throw_item = null
var/mob/living/target = locate() in view(7,src) var/mob/living/target = locate() in view(7,src)
if(!target) if(!target)
return 0 return 0
for(var/datum/stored_item/I in item_records) for(var/datum/stored_item/I in item_records)
throw_item = I.get_product(get_turf(src)) throw_item = I.get_product(get_turf(src))
if (!throw_item) if (!throw_item)
continue continue
break break
if(!throw_item) if(!throw_item)
return 0 return 0
spawn(0) spawn(0)
throw_item.throw_at(target,16,3,src) throw_item.throw_at(target,16,3,src)
src.visible_message("<span class='warning'>[src] launches [throw_item.name] at [target.name]!</span>") src.visible_message("<span class='warning'>[src] launches [throw_item.name] at [target.name]!</span>")
return 1 return 1
/************************ /************************
* Secure SmartFridges * Secure SmartFridges
*************************/ *************************/
/obj/machinery/smartfridge/secure/Topic(href, href_list) /obj/machinery/smartfridge/secure/Topic(href, href_list)
if(stat & (NOPOWER|BROKEN)) if(stat & (NOPOWER|BROKEN))
return 0 return 0
if(usr.contents.Find(src) || (in_range(src, usr) && istype(loc, /turf))) if(usr.contents.Find(src) || (in_range(src, usr) && istype(loc, /turf)))
if(!allowed(usr) && !emagged && locked != -1 && href_list["vend"]) if(!allowed(usr) && !emagged && locked != -1 && href_list["vend"])
to_chat(usr, "<span class='warning'>Access denied.</span>") to_chat(usr, "<span class='warning'>Access denied.</span>")
return 0 return 0
return ..() return ..()

View File

@@ -753,17 +753,6 @@
#include "code\game\machinery\embedded_controller\embedded_controller_base.dm" #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\embedded_program_base.dm"
#include "code\game\machinery\embedded_controller\simple_docking_controller.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\construction.dm"
#include "code\game\machinery\pipe\pipe_dispenser.dm" #include "code\game\machinery\pipe\pipe_dispenser.dm"
#include "code\game\machinery\pipe\pipe_recipes.dm" #include "code\game\machinery\pipe\pipe_recipes.dm"
@@ -1562,8 +1551,40 @@
#include "code\modules\flufftext\Hallucination.dm" #include "code\modules\flufftext\Hallucination.dm"
#include "code\modules\flufftext\look_up.dm" #include "code\modules\flufftext\look_up.dm"
#include "code\modules\flufftext\TextFilters.dm" #include "code\modules\flufftext\TextFilters.dm"
#include "code\modules\food\food.dm"
#include "code\modules\food\recipe_dump.dm" #include "code\modules\food\recipe_dump.dm"
#include "code\modules\food\recipes_microwave.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\controller.dm"
#include "code\modules\gamemaster\defines.dm" #include "code\modules\gamemaster\defines.dm"
#include "code\modules\gamemaster\game_master.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\blood_pack.dm"
#include "code\modules\reagents\reagent_containers\borghydro.dm" #include "code\modules\reagents\reagent_containers\borghydro.dm"
#include "code\modules\reagents\reagent_containers\dropper.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\glass.dm"
#include "code\modules\reagents\reagent_containers\hypospray.dm" #include "code\modules\reagents\reagent_containers\hypospray.dm"
#include "code\modules\reagents\reagent_containers\pill.dm" #include "code\modules\reagents\reagent_containers\pill.dm"
#include "code\modules\reagents\reagent_containers\spray.dm" #include "code\modules\reagents\reagent_containers\spray.dm"
#include "code\modules\reagents\reagent_containers\syringes.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\conveyor2.dm"
#include "code\modules\recycling\disposal-construction.dm" #include "code\modules\recycling\disposal-construction.dm"
#include "code\modules\recycling\disposal.dm" #include "code\modules\recycling\disposal.dm"

View File

@@ -0,0 +1 @@
4a21477a8bedf5b1a1eed6cf751e9a74cd10778d