mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 18:22:39 +00:00
Ported and rewrote several cooking machines from Apollo by request.
# Conflicts: # maps/exodus/exodus-1.dmm
This commit is contained in:
@@ -50,7 +50,7 @@
|
||||
src.invisibility = INVISIBILITY_MAXIMUM
|
||||
density = 0
|
||||
|
||||
/obj/machinery/cooking/cultify()
|
||||
/obj/machinery/cooker/cultify()
|
||||
new /obj/structure/cult/talisman(loc)
|
||||
qdel(src)
|
||||
|
||||
|
||||
233
code/game/machinery/kitchen/cooking_machines/_cooker.dm
Normal file
233
code/game/machinery/kitchen/cooking_machines/_cooker.dm
Normal file
@@ -0,0 +1,233 @@
|
||||
// This folder contains code that was originally ported from Apollo Station and then refactored/optimized/changed.
|
||||
|
||||
// Tracks precooked food to stop deep fried baked grilled grilled grilled diona nymph cereal.
|
||||
/obj/item/weapon/reagent_containers/food/snacks/var/list/cooked
|
||||
|
||||
// Root type for cooking machines. See following files for specific implementations.
|
||||
/obj/machinery/cooker
|
||||
name = "cooker"
|
||||
desc = "You shouldn't be seeing this!"
|
||||
icon = 'icons/obj/cooking_machines.dmi'
|
||||
density = 1
|
||||
anchored = 1
|
||||
use_power = 1
|
||||
idle_power_usage = 5
|
||||
|
||||
var/on_icon // Icon state used when cooking.
|
||||
var/off_icon // Icon state used when not cooking.
|
||||
var/cooking // Whether or not the machine is currently operating.
|
||||
var/cook_type // A string value used to track what kind of food this machine makes.
|
||||
var/cook_time = 200 // How many ticks the cooking will take.
|
||||
var/can_cook_mobs // Whether or not this machine accepts grabbed mobs.
|
||||
var/food_color // Colour of resulting food item.
|
||||
var/cooked_sound // Sound played when cooking completes.
|
||||
var/can_burn_food // Can the object burn food that is left inside?
|
||||
var/burn_chance = 10 // How likely is the food to burn?
|
||||
var/obj/item/cooking_obj // Holder for the currently cooking object.
|
||||
|
||||
// If the machine has multiple output modes, define them here.
|
||||
var/selected_option
|
||||
var/list/output_options = list()
|
||||
|
||||
/obj/machinery/cooker/Destroy()
|
||||
if(cooking_obj)
|
||||
qdel(cooking_obj)
|
||||
cooking_obj = null
|
||||
return ..()
|
||||
|
||||
/obj/machinery/cooker/examine()
|
||||
..()
|
||||
if(cooking_obj && Adjacent(usr))
|
||||
usr << "You can see \a [cooking_obj] inside."
|
||||
|
||||
/obj/machinery/cooker/attackby(var/obj/item/I, var/mob/user)
|
||||
|
||||
if(!cook_type || (stat & (NOPOWER|BROKEN)))
|
||||
user << "<span class='warning'>\The [src] is not working.</span>"
|
||||
return
|
||||
|
||||
if(cooking)
|
||||
user << "<span class='warning'>\The [src] is running!</span>"
|
||||
return
|
||||
|
||||
// We are trying to cook a grabbed mob.
|
||||
var/obj/item/weapon/grab/G = I
|
||||
if(istype(G))
|
||||
|
||||
if(!can_cook_mobs)
|
||||
user << "<span class='warning'>That's not going to fit.</span>"
|
||||
return
|
||||
|
||||
if(!isliving(G.affecting))
|
||||
user << "<span class='warning'>You can't cook that.</span>"
|
||||
return
|
||||
|
||||
cook_mob(G.affecting, user)
|
||||
return
|
||||
|
||||
// We're trying to cook something else. Check if it's valid.
|
||||
var/obj/item/weapon/reagent_containers/food/snacks/check = I
|
||||
if(istype(check) && islist(check.cooked) && (cook_type in check.cooked))
|
||||
user << "<span class='warning'>\The [check] has already been [cook_type].</span>"
|
||||
return 0
|
||||
else if(istype(check, /obj/item/weapon/reagent_containers/glass))
|
||||
user << "<span class='warning'>That would probably break [src].</span>"
|
||||
return 0
|
||||
else if(istype(check, /obj/item/weapon/disk/nuclear))
|
||||
user << "Central Command would kill you if you [cook_type] that."
|
||||
return 0
|
||||
else if(!istype(check) && !istype(check, /obj/item/weapon/holder))
|
||||
user << "<span class='warning'>That's not edible.</span>"
|
||||
return 0
|
||||
|
||||
// Gotta hurt.
|
||||
if(istype(cooking_obj, /obj/item/weapon/holder))
|
||||
for(var/mob/living/M in cooking_obj.contents)
|
||||
M.apply_damage(rand(30,40), BURN, "chest")
|
||||
|
||||
// Not sure why a food item that passed the previous checks would fail to drop, but safety first.
|
||||
if(!user.unEquip(I))
|
||||
return
|
||||
|
||||
// We can actually start cooking now.
|
||||
user.visible_message("<span class='notice'>\The [user] puts \the [I] into \the [src].</span>")
|
||||
cooking_obj = I
|
||||
cooking_obj.forceMove(src)
|
||||
cooking = 1
|
||||
icon_state = on_icon
|
||||
|
||||
// Doop de doo. Jeopardy theme goes here.
|
||||
sleep(cook_time)
|
||||
|
||||
// Sanity checks.
|
||||
if(!cooking_obj || cooking_obj.loc != src)
|
||||
cooking_obj = null
|
||||
icon_state = off_icon
|
||||
cooking = 0
|
||||
return
|
||||
|
||||
// RIP slow-moving held mobs.
|
||||
if(istype(cooking_obj, /obj/item/weapon/holder))
|
||||
for(var/mob/living/M in cooking_obj.contents)
|
||||
M.death()
|
||||
|
||||
// Cook the food.
|
||||
var/cook_path
|
||||
if(selected_option && output_options.len)
|
||||
cook_path = output_options[selected_option]
|
||||
if(!cook_path)
|
||||
cook_path = /obj/item/weapon/reagent_containers/food/snacks/variable
|
||||
var/obj/item/weapon/reagent_containers/food/snacks/result = new cook_path(src) //Holy typepaths, Batman.
|
||||
|
||||
if(cooking_obj.reagents && cooking_obj.reagents.total_volume)
|
||||
cooking_obj.reagents.trans_to(result, cooking_obj.reagents.total_volume)
|
||||
|
||||
// Set icon and appearance.
|
||||
change_product_appearance(result)
|
||||
|
||||
// Update strings.
|
||||
change_product_strings(result)
|
||||
|
||||
// Set cooked data.
|
||||
var/obj/item/weapon/reagent_containers/food/snacks/food_item = cooking_obj
|
||||
if(istype(food_item) && islist(food_item.cooked))
|
||||
result.cooked = food_item.cooked.Copy()
|
||||
else
|
||||
result.cooked = list()
|
||||
result.cooked |= cook_type
|
||||
|
||||
// Reset relevant variables.
|
||||
qdel(cooking_obj)
|
||||
src.visible_message("<span class='notice'>\The [src] pings!</span>")
|
||||
if(cooked_sound)
|
||||
playsound(get_turf(src), cooked_sound, 50, 1)
|
||||
|
||||
if(!can_burn_food)
|
||||
icon_state = off_icon
|
||||
cooking = 0
|
||||
result.forceMove(get_turf(src))
|
||||
cooking_obj = null
|
||||
else
|
||||
var/failed
|
||||
var/overcook_period = max(Floor(cook_time/5),1)
|
||||
cooking_obj = result
|
||||
while(1)
|
||||
sleep(overcook_period)
|
||||
if(!cooking || !result || result.loc != src)
|
||||
failed = 1
|
||||
else if(prob(burn_chance))
|
||||
// You dun goofed.
|
||||
qdel(cooking_obj)
|
||||
cooking_obj = new /obj/item/weapon/reagent_containers/food/snacks/badrecipe(src)
|
||||
// Produce nasty smoke.
|
||||
visible_message("<span class='danger'>\The [src] vomits a gout of rancid smoke!</span>")
|
||||
var/datum/effect/effect/system/smoke_spread/bad/smoke = PoolOrNew(/datum/effect/effect/system/smoke_spread/bad)
|
||||
smoke.attach(src)
|
||||
smoke.set_up(10, 0, usr.loc)
|
||||
smoke.start()
|
||||
failed = 1
|
||||
|
||||
if(failed)
|
||||
cooking = 0
|
||||
icon_state = off_icon
|
||||
break
|
||||
|
||||
/obj/machinery/cooker/attack_hand(var/mob/user)
|
||||
|
||||
if(cooking_obj)
|
||||
user << "<span class='notice'>You grab \the [cooking_obj] from \the [src].</span>"
|
||||
user.put_in_hands(cooking_obj)
|
||||
cooking = 0
|
||||
cooking_obj = null
|
||||
icon_state = off_icon
|
||||
return
|
||||
|
||||
if(output_options.len)
|
||||
|
||||
if(cooking)
|
||||
user << "<span class='warning'>\The [src] is in use!</span>"
|
||||
return
|
||||
|
||||
var/choice = input("What specific food do you wish to make with \the [src]?") as null|anything in output_options+"Default"
|
||||
if(!choice)
|
||||
return
|
||||
if(choice == "Default")
|
||||
selected_option = null
|
||||
user << "<span class='notice'>You decide not to make anything specific with \the [src].</span>"
|
||||
else
|
||||
selected_option = choice
|
||||
user << "<span class='notice'>You prepare \the [src] to make \a [selected_option].</span>"
|
||||
|
||||
..()
|
||||
|
||||
/obj/machinery/cooker/proc/cook_mob(var/mob/living/victim, var/mob/user)
|
||||
return
|
||||
|
||||
/obj/machinery/cooker/proc/change_product_strings(var/obj/item/weapon/reagent_containers/food/snacks/product)
|
||||
if(product.type == /obj/item/weapon/reagent_containers/food/snacks/variable) // Base type, generic.
|
||||
product.name = "[cook_type] [cooking_obj.name]"
|
||||
product.desc = "[cooking_obj.desc] It has been [cook_type]."
|
||||
else
|
||||
product.name = "[cooking_obj.name] [product.name]"
|
||||
|
||||
/obj/machinery/cooker/proc/change_product_appearance(var/obj/item/weapon/reagent_containers/food/snacks/product)
|
||||
if(product.type == /obj/item/weapon/reagent_containers/food/snacks/variable) // Base type, generic.
|
||||
product.appearance = cooking_obj
|
||||
product.color = food_color
|
||||
product.filling_color = food_color
|
||||
|
||||
// Make 'em into a corpse.
|
||||
if(istype(cooking_obj, /obj/item/weapon/holder))
|
||||
var/matrix/M = matrix()
|
||||
M.Turn(90)
|
||||
M.Translate(1,-6)
|
||||
product.transform = M
|
||||
else
|
||||
var/image/I = image(product.icon, "[product.icon_state]_filling")
|
||||
if(istype(cooking_obj, /obj/item/weapon/reagent_containers/food/snacks))
|
||||
var/obj/item/weapon/reagent_containers/food/snacks/S = cooking_obj
|
||||
I.color = S.filling_color
|
||||
if(!I.color)
|
||||
I.color = food_color
|
||||
product.overlays += I
|
||||
|
||||
@@ -0,0 +1,72 @@
|
||||
// Wrapper obj for cooked food. Appearance is set in the cooking code, not on spawn.
|
||||
/obj/item/weapon/reagent_containers/food/snacks/variable
|
||||
name = "cooked food"
|
||||
icon = 'icons/obj/food_custom.dmi'
|
||||
desc = "If you can see this description then something is wrong. Please report the bug on the tracker."
|
||||
nutriment_amt = 5
|
||||
bitesize = 2
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/variable/pizza
|
||||
name = "personal pizza"
|
||||
desc = "A personalized pan pizza meant for only one person."
|
||||
icon_state = "personal_pizza"
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/variable/bread
|
||||
name = "bread"
|
||||
desc = "Tasty bread."
|
||||
icon_state = "breadcustom"
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/variable/pie
|
||||
name = "pie"
|
||||
desc = "Tasty pie."
|
||||
icon_state = "piecustom"
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/variable/cake
|
||||
name = "cake"
|
||||
desc = "A popular band."
|
||||
icon_state = "cakecustom"
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/variable/pocket
|
||||
name = "hot pocket"
|
||||
desc = "You wanna put a bangin- oh, nevermind."
|
||||
icon_state = "donk"
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/variable/kebab
|
||||
name = "kebab"
|
||||
desc = "Remove this!"
|
||||
icon_state = "kabob"
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/variable/waffles
|
||||
name = "waffles"
|
||||
desc = "Made with love."
|
||||
icon_state = "waffles"
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/variable/cookie
|
||||
name = "cookie"
|
||||
desc = "Sugar snap!"
|
||||
icon_state = "cookie"
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/variable/donut
|
||||
name = "filled donut"
|
||||
desc = "Donut eat this!" // kill me
|
||||
icon_state = "donut"
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/variable/jawbreaker
|
||||
name = "flavored jawbreaker"
|
||||
desc = "It's like cracking a molar on a rainbow."
|
||||
icon_state = "jawbreaker"
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/variable/candybar
|
||||
name = "flavored chocolate bar"
|
||||
desc = "Made in a factory downtown."
|
||||
icon_state = "bar"
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/variable/sucker
|
||||
name = "flavored sucker"
|
||||
desc = "Suck, suck, suck."
|
||||
icon_state = "sucker"
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/variable/jelly
|
||||
name = "jelly"
|
||||
desc = "All your friends will be jelly."
|
||||
icon_state = "jellycustom"
|
||||
18
code/game/machinery/kitchen/cooking_machines/candy.dm
Normal file
18
code/game/machinery/kitchen/cooking_machines/candy.dm
Normal file
@@ -0,0 +1,18 @@
|
||||
/obj/machinery/cooker/candy
|
||||
name = "candy machine"
|
||||
desc = "Get yer candied cheese wheels here!"
|
||||
icon_state = "mixer_off"
|
||||
off_icon = "mixer_off"
|
||||
on_icon = "mixer_on"
|
||||
cook_type = "candied"
|
||||
|
||||
output_options = list(
|
||||
"Jawbreaker" = /obj/item/weapon/reagent_containers/food/snacks/variable/jawbreaker,
|
||||
"Candy Bar" = /obj/item/weapon/reagent_containers/food/snacks/variable/candybar,
|
||||
"Sucker" = /obj/item/weapon/reagent_containers/food/snacks/variable/sucker,
|
||||
"Jelly" = /obj/item/weapon/reagent_containers/food/snacks/variable/jelly
|
||||
)
|
||||
|
||||
/obj/machinery/cooker/candy/change_product_appearance(var/obj/item/weapon/reagent_containers/food/snacks/cooked/product)
|
||||
food_color = get_random_colour(1)
|
||||
. = ..()
|
||||
25
code/game/machinery/kitchen/cooking_machines/cereal.dm
Normal file
25
code/game/machinery/kitchen/cooking_machines/cereal.dm
Normal file
@@ -0,0 +1,25 @@
|
||||
/obj/machinery/cooker/cereal
|
||||
name = "cereal maker"
|
||||
desc = "Now with Dann O's available!"
|
||||
icon = 'icons/obj/cooking_machines.dmi'
|
||||
icon_state = "cereal_off"
|
||||
cook_type = "cerealized"
|
||||
on_icon = "cereal_on"
|
||||
off_icon = "cereal_off"
|
||||
|
||||
/obj/machinery/cooker/cereal/change_product_strings(var/obj/item/weapon/reagent_containers/food/snacks/product)
|
||||
. = ..()
|
||||
product.name = "box of [cooking_obj.name] cereal"
|
||||
|
||||
/obj/machinery/cooker/cereal/change_product_appearance(var/obj/item/weapon/reagent_containers/food/snacks/product)
|
||||
product.icon = 'icons/obj/food.dmi'
|
||||
product.icon_state = "cereal_box"
|
||||
product.filling_color = cooking_obj.color
|
||||
|
||||
var/image/food_image = image(cooking_obj.icon, cooking_obj.icon_state)
|
||||
food_image.color = cooking_obj.color
|
||||
food_image.overlays += cooking_obj.overlays
|
||||
food_image.transform *= 0.7
|
||||
|
||||
product.overlays += food_image
|
||||
|
||||
67
code/game/machinery/kitchen/cooking_machines/fryer.dm
Normal file
67
code/game/machinery/kitchen/cooking_machines/fryer.dm
Normal file
@@ -0,0 +1,67 @@
|
||||
/obj/machinery/cooker/fryer
|
||||
name = "deep fryer"
|
||||
desc = "Deep fried <i>everything</i>."
|
||||
icon_state = "fryer_off"
|
||||
can_cook_mobs = 1
|
||||
cook_type = "deep fried"
|
||||
on_icon = "fryer_on"
|
||||
off_icon = "fryer_off"
|
||||
food_color = "#FFAD33"
|
||||
cooked_sound = 'sound/machines/ding.ogg'
|
||||
|
||||
/obj/machinery/cooker/fryer/cook_mob(var/mob/living/victim, var/mob/user)
|
||||
|
||||
if(!istype(victim))
|
||||
return
|
||||
|
||||
user.visible_message("<span class='danger'>\The [user] starts pushing \the [victim] into \the [src]!</span>")
|
||||
icon_state = on_icon
|
||||
cooking = 1
|
||||
|
||||
if(!do_mob(user, victim, 20))
|
||||
cooking = 0
|
||||
icon_state = off_icon
|
||||
return
|
||||
|
||||
if(!victim || !victim.Adjacent(user))
|
||||
user << "<span class='danger'>Your victim slipped free!</span>"
|
||||
cooking = 0
|
||||
icon_state = off_icon
|
||||
return
|
||||
|
||||
var/obj/item/organ/external/E
|
||||
var/nopain
|
||||
if(ishuman(victim) && user.zone_sel.selecting != "groin" && user.zone_sel.selecting != "chest")
|
||||
var/mob/living/carbon/human/H = victim
|
||||
if(H.species.flags & NO_PAIN)
|
||||
nopain = 2
|
||||
E = H.get_organ(user.zone_sel.selecting)
|
||||
if(E.status & ORGAN_ROBOT)
|
||||
nopain = 1
|
||||
|
||||
user.visible_message("<span class='danger'>\The [user] shoves \the [victim][E ? "'s [E.name]" : ""] into \the [src]!</span>")
|
||||
|
||||
if(E)
|
||||
E.take_damage(0, rand(20,30))
|
||||
if(E.children && E.children.len)
|
||||
for(var/obj/item/organ/external/child in E.children)
|
||||
if(nopain && nopain < 2 && !(child.status & ORGAN_ROBOT))
|
||||
nopain = 0
|
||||
child.take_damage(0, rand(20,30))
|
||||
else
|
||||
victim.apply_damage(rand(30,40), BURN, user.zone_sel.selecting)
|
||||
|
||||
if(!nopain)
|
||||
victim << "<span class='danger'>Agony consumes you as searing hot oil scorches your [E ? E.name : "flesh"] horribly!</span>"
|
||||
victim.emote("scream")
|
||||
else
|
||||
victim << "<span class='danger'>Searing hot oil scorches your [E ? E.name : "flesh"]!</span>"
|
||||
|
||||
if(victim.client)
|
||||
user.attack_log += text("\[[time_stamp()]\] <font color='red'>Has [cook_type] \the [victim] ([victim.ckey]) in \a [src]</font>")
|
||||
victim.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has been [cook_type] in \a [src] by [user.name] ([user.ckey])</font>")
|
||||
msg_admin_attack("[user] ([user.ckey]) [cook_type] \the [victim] ([victim.ckey]) in \a [src]. (<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[user.x];Y=[user.y];Z=[user.z]'>JMP</a>)")
|
||||
|
||||
icon_state = off_icon
|
||||
cooking = 0
|
||||
return
|
||||
10
code/game/machinery/kitchen/cooking_machines/grill.dm
Normal file
10
code/game/machinery/kitchen/cooking_machines/grill.dm
Normal file
@@ -0,0 +1,10 @@
|
||||
/obj/machinery/cooker/grill
|
||||
name = "grill"
|
||||
desc = "Backyard grilling, IN SPACE."
|
||||
icon_state = "grill_off"
|
||||
cook_type = "grilled"
|
||||
cook_time = 100
|
||||
food_color = "#A34719"
|
||||
on_icon = "grill_on"
|
||||
off_icon = "grill_off"
|
||||
can_burn_food = 1
|
||||
23
code/game/machinery/kitchen/cooking_machines/oven.dm
Normal file
23
code/game/machinery/kitchen/cooking_machines/oven.dm
Normal file
@@ -0,0 +1,23 @@
|
||||
/obj/machinery/cooker/oven
|
||||
name = "oven"
|
||||
desc = "Cookies are ready, dear."
|
||||
icon = 'icons/obj/cooking_machines.dmi'
|
||||
icon_state = "oven_off"
|
||||
on_icon = "oven_on"
|
||||
off_icon = "oven_off"
|
||||
cook_type = "baked"
|
||||
cook_time = 300
|
||||
food_color = "#A34719"
|
||||
can_burn_food = 1
|
||||
|
||||
output_options = list(
|
||||
"Personal Pizza" = /obj/item/weapon/reagent_containers/food/snacks/variable/pizza,
|
||||
"Bread" = /obj/item/weapon/reagent_containers/food/snacks/variable/bread,
|
||||
"Pie" = /obj/item/weapon/reagent_containers/food/snacks/variable/pie,
|
||||
"Small Cake" = /obj/item/weapon/reagent_containers/food/snacks/variable/cake,
|
||||
"Hot Pocket" = /obj/item/weapon/reagent_containers/food/snacks/variable/pocket,
|
||||
"Kebab" = /obj/item/weapon/reagent_containers/food/snacks/variable/kebab,
|
||||
"Waffles" = /obj/item/weapon/reagent_containers/food/snacks/variable/waffles,
|
||||
"Cookie" = /obj/item/weapon/reagent_containers/food/snacks/variable/cookie,
|
||||
"Donut" = /obj/item/weapon/reagent_containers/food/snacks/variable/donut,
|
||||
)
|
||||
196
code/game/machinery/kitchen/icecream.dm
Normal file
196
code/game/machinery/kitchen/icecream.dm
Normal file
@@ -0,0 +1,196 @@
|
||||
#define ICECREAM_VANILLA 1
|
||||
#define ICECREAM_CHOCOLATE 2
|
||||
#define ICECREAM_STRAWBERRY 3
|
||||
#define ICECREAM_BLUE 4
|
||||
#define CONE_WAFFLE 5
|
||||
#define CONE_CHOC 6
|
||||
|
||||
// Ported wholesale from Apollo Station.
|
||||
|
||||
/obj/machinery/icecream_vat
|
||||
name = "icecream vat"
|
||||
desc = "Ding-aling ding dong. Get your NanoTrasen-approved ice cream!"
|
||||
icon = 'icons/obj/kitchen.dmi'
|
||||
icon_state = "icecream_vat"
|
||||
density = 1
|
||||
anchored = 0
|
||||
use_power = 0
|
||||
flags = OPENCONTAINER | NOREACT
|
||||
|
||||
var/list/product_types = list()
|
||||
var/dispense_flavour = ICECREAM_VANILLA
|
||||
var/flavour_name = "vanilla"
|
||||
|
||||
/obj/machinery/icecream_vat/proc/get_ingredient_list(var/type)
|
||||
switch(type)
|
||||
if(ICECREAM_CHOCOLATE)
|
||||
return list("milk", "ice", "coco")
|
||||
if(ICECREAM_STRAWBERRY)
|
||||
return list("milk", "ice", "berryjuice")
|
||||
if(ICECREAM_BLUE)
|
||||
return list("milk", "ice", "singulo")
|
||||
if(CONE_WAFFLE)
|
||||
return list("flour", "sugar")
|
||||
if(CONE_CHOC)
|
||||
return list("flour", "sugar", "coco")
|
||||
else
|
||||
return list("milk", "ice")
|
||||
|
||||
/obj/machinery/icecream_vat/proc/get_flavour_name(var/flavour_type)
|
||||
switch(flavour_type)
|
||||
if(ICECREAM_CHOCOLATE)
|
||||
return "chocolate"
|
||||
if(ICECREAM_STRAWBERRY)
|
||||
return "strawberry"
|
||||
if(ICECREAM_BLUE)
|
||||
return "blue"
|
||||
if(CONE_WAFFLE)
|
||||
return "waffle"
|
||||
if(CONE_CHOC)
|
||||
return "chocolate"
|
||||
else
|
||||
return "vanilla"
|
||||
|
||||
/obj/machinery/icecream_vat/initialize()
|
||||
..()
|
||||
create_reagents(100)
|
||||
while(product_types.len < 6)
|
||||
product_types.Add(5)
|
||||
reagents.add_reagent("milk", 5)
|
||||
reagents.add_reagent("flour", 5)
|
||||
reagents.add_reagent("sugar", 5)
|
||||
reagents.add_reagent("ice", 5)
|
||||
|
||||
/obj/machinery/icecream_vat/attack_hand(mob/user as mob)
|
||||
user.set_machine(src)
|
||||
interact(user)
|
||||
|
||||
/obj/machinery/icecream_vat/interact(mob/user as mob)
|
||||
var/dat
|
||||
dat += "<b>ICECREAM</b><br><div class='statusDisplay'>"
|
||||
dat += "<b>Dispensing: [flavour_name] icecream </b> <br><br>"
|
||||
dat += "<b>Vanilla icecream:</b> <a href='?src=\ref[src];select=[ICECREAM_VANILLA]'><b>Select</b></a> <a href='?src=\ref[src];make=[ICECREAM_VANILLA];amount=1'><b>Make</b></a> <a href='?src=\ref[src];make=[ICECREAM_VANILLA];amount=5'><b>x5</b></a> [product_types[ICECREAM_VANILLA]] scoops left. (Ingredients: milk, ice)<br>"
|
||||
dat += "<b>Strawberry icecream:</b> <a href='?src=\ref[src];select=[ICECREAM_STRAWBERRY]'><b>Select</b></a> <a href='?src=\ref[src];make=[ICECREAM_STRAWBERRY];amount=1'><b>Make</b></a> <a href='?src=\ref[src];make=[ICECREAM_STRAWBERRY];amount=5'><b>x5</b></a> [product_types[ICECREAM_STRAWBERRY]] dollops left. (Ingredients: milk, ice, berry juice)<br>"
|
||||
dat += "<b>Chocolate icecream:</b> <a href='?src=\ref[src];select=[ICECREAM_CHOCOLATE]'><b>Select</b></a> <a href='?src=\ref[src];make=[ICECREAM_CHOCOLATE];amount=1'><b>Make</b></a> <a href='?src=\ref[src];make=[ICECREAM_CHOCOLATE];amount=5'><b>x5</b></a> [product_types[ICECREAM_CHOCOLATE]] dollops left. (Ingredients: milk, ice, coco powder)<br>"
|
||||
dat += "<b>Blue icecream:</b> <a href='?src=\ref[src];select=[ICECREAM_BLUE]'><b>Select</b></a> <a href='?src=\ref[src];make=[ICECREAM_BLUE];amount=1'><b>Make</b></a> <a href='?src=\ref[src];make=[ICECREAM_BLUE];amount=5'><b>x5</b></a> [product_types[ICECREAM_BLUE]] dollops left. (Ingredients: milk, ice, singulo)<br></div>"
|
||||
dat += "<br><b>CONES</b><br><div class='statusDisplay'>"
|
||||
dat += "<b>Waffle cones:</b> <a href='?src=\ref[src];cone=[CONE_WAFFLE]'><b>Dispense</b></a> <a href='?src=\ref[src];make=[CONE_WAFFLE];amount=1'><b>Make</b></a> <a href='?src=\ref[src];make=[CONE_WAFFLE];amount=5'><b>x5</b></a> [product_types[CONE_WAFFLE]] cones left. (Ingredients: flour, sugar)<br>"
|
||||
dat += "<b>Chocolate cones:</b> <a href='?src=\ref[src];cone=[CONE_CHOC]'><b>Dispense</b></a> <a href='?src=\ref[src];make=[CONE_CHOC];amount=1'><b>Make</b></a> <a href='?src=\ref[src];make=[CONE_CHOC];amount=5'><b>x5</b></a> [product_types[CONE_CHOC]] cones left. (Ingredients: flour, sugar, coco powder)<br></div>"
|
||||
dat += "<br>"
|
||||
dat += "<b>VAT CONTENT</b><br>"
|
||||
for(var/datum/reagent/R in reagents.reagent_list)
|
||||
dat += "[R.name]: [R.volume]"
|
||||
dat += "<A href='?src=\ref[src];disposeI=[R.id]'>Purge</A><BR>"
|
||||
dat += "<a href='?src=\ref[src];refresh=1'>Refresh</a> <a href='?src=\ref[src];close=1'>Close</a>"
|
||||
|
||||
var/datum/browser/popup = new(user, "icecreamvat","Icecream Vat", 700, 500, src)
|
||||
popup.set_content(dat)
|
||||
popup.open()
|
||||
|
||||
/obj/machinery/icecream_vat/attackby(var/obj/item/O as obj, var/mob/user as mob)
|
||||
if(istype(O, /obj/item/weapon/reagent_containers/food/snacks/icecream))
|
||||
var/obj/item/weapon/reagent_containers/food/snacks/icecream/I = O
|
||||
if(!I.ice_creamed)
|
||||
if(product_types[dispense_flavour] > 0)
|
||||
src.visible_message("\icon[src] <span class='info'>[user] scoops delicious [flavour_name] icecream into [I].</span>")
|
||||
product_types[dispense_flavour] -= 1
|
||||
I.add_ice_cream(flavour_name)
|
||||
// if(beaker)
|
||||
// beaker.reagents.trans_to(I, 10)
|
||||
if(I.reagents.total_volume < 10)
|
||||
I.reagents.add_reagent("sugar", 10 - I.reagents.total_volume)
|
||||
else
|
||||
user << "<span class='warning'>There is not enough icecream left!</span>"
|
||||
else
|
||||
user << "<span class='notice'>[O] already has icecream in it.</span>"
|
||||
return 1
|
||||
else if(O.is_open_container())
|
||||
return
|
||||
else
|
||||
..()
|
||||
|
||||
/obj/machinery/icecream_vat/proc/make(var/mob/user, var/make_type, var/amount)
|
||||
for(var/R in get_ingredient_list(make_type))
|
||||
if(reagents.has_reagent(R, amount))
|
||||
continue
|
||||
amount = 0
|
||||
break
|
||||
if(amount)
|
||||
for(var/R in get_ingredient_list(make_type))
|
||||
reagents.remove_reagent(R, amount)
|
||||
product_types[make_type] += amount
|
||||
var/flavour = get_flavour_name(make_type)
|
||||
if(make_type > 4)
|
||||
src.visible_message("<span class='info'>[user] cooks up some [flavour] cones.</span>")
|
||||
else
|
||||
src.visible_message("<span class='info'>[user] whips up some [flavour] icecream.</span>")
|
||||
else
|
||||
user << "<span class='warning'>You don't have the ingredients to make this.</span>"
|
||||
|
||||
/obj/machinery/icecream_vat/Topic(href, href_list)
|
||||
|
||||
if(..())
|
||||
return
|
||||
|
||||
if(href_list["select"])
|
||||
dispense_flavour = text2num(href_list["select"])
|
||||
flavour_name = get_flavour_name(dispense_flavour)
|
||||
src.visible_message("<span class='notice'>[usr] sets [src] to dispense [flavour_name] flavoured icecream.</span>")
|
||||
|
||||
if(href_list["cone"])
|
||||
var/dispense_cone = text2num(href_list["cone"])
|
||||
var/cone_name = get_flavour_name(dispense_cone)
|
||||
if(product_types[dispense_cone] >= 1)
|
||||
product_types[dispense_cone] -= 1
|
||||
var/obj/item/weapon/reagent_containers/food/snacks/icecream/I = new(src.loc)
|
||||
I.cone_type = cone_name
|
||||
I.icon_state = "icecream_cone_[cone_name]"
|
||||
I.desc = "Delicious [cone_name] cone, but no ice cream."
|
||||
src.visible_message("<span class='info'>[usr] dispenses a crunchy [cone_name] cone from [src].</span>")
|
||||
else
|
||||
usr << "<span class='warning'>There are no [cone_name] cones left!</span>"
|
||||
|
||||
if(href_list["make"])
|
||||
var/amount = (text2num(href_list["amount"]))
|
||||
var/C = text2num(href_list["make"])
|
||||
make(usr, C, amount)
|
||||
|
||||
if(href_list["disposeI"])
|
||||
reagents.del_reagent(href_list["disposeI"])
|
||||
|
||||
updateDialog()
|
||||
|
||||
if(href_list["refresh"])
|
||||
updateDialog()
|
||||
|
||||
if(href_list["close"])
|
||||
usr.unset_machine()
|
||||
usr << browse(null,"window=icecreamvat")
|
||||
return
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/icecream
|
||||
name = "ice cream cone"
|
||||
desc = "Delicious waffle cone, but no ice cream."
|
||||
icon_state = "icecream_cone_waffle" //default for admin-spawned cones, href_list["cone"] should overwrite this all the time
|
||||
layer = 3.1
|
||||
bitesize = 3
|
||||
|
||||
var/ice_creamed = 0
|
||||
var/cone_type
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/icecream/New()
|
||||
create_reagents(20)
|
||||
reagents.add_reagent("nutriment", 5)
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/icecream/proc/add_ice_cream(var/flavour_name)
|
||||
name = "[flavour_name] icecream"
|
||||
src.overlays += "icecream_[flavour_name]"
|
||||
desc = "Delicious [cone_type] cone with a dollop of [flavour_name] ice cream."
|
||||
ice_creamed = 1
|
||||
|
||||
#undef ICECREAM_VANILLA
|
||||
#undef FLAVOUR_CHOCOLATE
|
||||
#undef FLAVOUR_STRAWBERRY
|
||||
#undef FLAVOUR_BLUE
|
||||
#undef CONE_WAFFLE
|
||||
#undef CONE_CHOC
|
||||
@@ -73,7 +73,7 @@
|
||||
set_trait(TRAIT_PRODUCTION,5)
|
||||
set_trait(TRAIT_YIELD,2)
|
||||
set_trait(TRAIT_POTENCY,10)
|
||||
set_trait(TRAIT_PRODUCT_COLOUR,"c9fa16")
|
||||
set_trait(TRAIT_PRODUCT_COLOUR,"#c9fa16")
|
||||
set_trait(TRAIT_WATER_CONSUMPTION, 3)
|
||||
set_trait(TRAIT_NUTRIENT_CONSUMPTION, 0.25)
|
||||
|
||||
|
||||
4
html/changelogs/zuhayr-kitchenmachines.yml
Normal file
4
html/changelogs/zuhayr-kitchenmachines.yml
Normal file
@@ -0,0 +1,4 @@
|
||||
author: Zuhayr
|
||||
delete-after: True
|
||||
changes:
|
||||
- rscadd: "Ports/adapted several kitchen machines from Apollo Station."
|
||||
BIN
icons/obj/cooking_machines.dmi
Normal file
BIN
icons/obj/cooking_machines.dmi
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.4 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 88 KiB After Width: | Height: | Size: 88 KiB |
BIN
icons/obj/food_custom.dmi
Normal file
BIN
icons/obj/food_custom.dmi
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 6.7 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 15 KiB |
@@ -570,8 +570,16 @@
|
||||
#include "code\game\machinery\embedded_controller\embedded_program_base.dm"
|
||||
#include "code\game\machinery\embedded_controller\simple_docking_controller.dm"
|
||||
#include "code\game\machinery\kitchen\gibber.dm"
|
||||
#include "code\game\machinery\kitchen\icecream.dm"
|
||||
#include "code\game\machinery\kitchen\microwave.dm"
|
||||
#include "code\game\machinery\kitchen\smartfridge.dm"
|
||||
#include "code\game\machinery\kitchen\cooking_machines\_cooker.dm"
|
||||
#include "code\game\machinery\kitchen\cooking_machines\_cooker_output.dm"
|
||||
#include "code\game\machinery\kitchen\cooking_machines\candy.dm"
|
||||
#include "code\game\machinery\kitchen\cooking_machines\cereal.dm"
|
||||
#include "code\game\machinery\kitchen\cooking_machines\fryer.dm"
|
||||
#include "code\game\machinery\kitchen\cooking_machines\grill.dm"
|
||||
#include "code\game\machinery\kitchen\cooking_machines\oven.dm"
|
||||
#include "code\game\machinery\pipe\construction.dm"
|
||||
#include "code\game\machinery\pipe\pipe_dispenser.dm"
|
||||
#include "code\game\machinery\pipe\pipelayer.dm"
|
||||
|
||||
Reference in New Issue
Block a user