mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 18:22:39 +00:00
Second Half of Aurora Cooking Initial Port - All files added
Now onto the bugfixing nightmares!
This commit is contained in:
@@ -1,166 +0,0 @@
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* /datum/recipe by rastaf0 13 apr 2011 *
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* This is powerful and flexible recipe system.
|
||||
* It exists not only for food.
|
||||
* supports both reagents and objects as prerequisites.
|
||||
* In order to use this system you have to define a deriative from /datum/recipe
|
||||
* * reagents are reagents. Acid, milc, booze, etc.
|
||||
* * items are objects. Fruits, tools, circuit boards.
|
||||
* * result is type to create as new object
|
||||
* * time is optional parameter, you shall use in in your machine,
|
||||
default /datum/recipe/ procs does not rely on this parameter.
|
||||
*
|
||||
* Functions you need:
|
||||
* /datum/recipe/proc/make(var/obj/container as obj)
|
||||
* Creates result inside container,
|
||||
* deletes prerequisite reagents,
|
||||
* transfers reagents from prerequisite objects,
|
||||
* deletes all prerequisite objects (even not needed for recipe at the moment).
|
||||
*
|
||||
* /proc/select_recipe(list/datum/recipe/avaiable_recipes, obj/obj as obj, exact = 1)
|
||||
* Wonderful function that select suitable recipe for you.
|
||||
* obj is a machine (or magik hat) with prerequisites,
|
||||
* exact = 0 forces algorithm to ignore superfluous stuff.
|
||||
*
|
||||
*
|
||||
* Functions you do not need to call directly but could:
|
||||
* /datum/recipe/proc/check_reagents(var/datum/reagents/avail_reagents)
|
||||
* /datum/recipe/proc/check_items(var/obj/container as obj)
|
||||
*
|
||||
* */
|
||||
|
||||
/datum/recipe
|
||||
var/list/reagents // example: = list("berryjuice" = 5) // do not list same reagent twice
|
||||
var/list/items // example: = list(/obj/item/weapon/tool/crowbar, /obj/item/weapon/welder) // place /foo/bar before /foo
|
||||
var/list/fruit // example: = list("fruit" = 3)
|
||||
var/result // example: = /obj/item/weapon/reagent_containers/food/snacks/donut/normal
|
||||
var/time = 100 // 1/10 part of second
|
||||
|
||||
/datum/recipe/proc/check_reagents(var/datum/reagents/avail_reagents)
|
||||
. = 1
|
||||
for (var/r_r in reagents)
|
||||
var/aval_r_amnt = avail_reagents.get_reagent_amount(r_r)
|
||||
if (!(abs(aval_r_amnt - reagents[r_r])<0.5)) //if NOT equals
|
||||
if (aval_r_amnt>reagents[r_r])
|
||||
. = 0
|
||||
else
|
||||
return -1
|
||||
if ((reagents?(reagents.len):(0)) < avail_reagents.reagent_list.len)
|
||||
return 0
|
||||
return .
|
||||
|
||||
/datum/recipe/proc/check_fruit(var/obj/container)
|
||||
. = 1
|
||||
if(fruit && fruit.len)
|
||||
var/list/checklist = list()
|
||||
// You should trust Copy().
|
||||
checklist = fruit.Copy()
|
||||
for(var/obj/item/weapon/reagent_containers/food/snacks/grown/G in container)
|
||||
if(!G.seed || !G.seed.kitchen_tag || isnull(checklist[G.seed.kitchen_tag]))
|
||||
continue
|
||||
checklist[G.seed.kitchen_tag]--
|
||||
for(var/ktag in checklist)
|
||||
if(!isnull(checklist[ktag]))
|
||||
if(checklist[ktag] < 0)
|
||||
. = 0
|
||||
else if(checklist[ktag] > 0)
|
||||
. = -1
|
||||
break
|
||||
return .
|
||||
|
||||
/datum/recipe/proc/check_items(var/obj/container as obj)
|
||||
. = 1
|
||||
if (items && items.len)
|
||||
var/list/checklist = list()
|
||||
checklist = items.Copy() // You should really trust Copy
|
||||
if(istype(container, /obj/machinery))
|
||||
var/obj/machinery/machine = container
|
||||
for(var/obj/O in ((machine.contents - machine.component_parts) - machine.circuit))
|
||||
if(istype(O,/obj/item/weapon/reagent_containers/food/snacks/grown))
|
||||
continue // Fruit is handled in check_fruit().
|
||||
var/found = 0
|
||||
for(var/i = 1; i < checklist.len+1; i++)
|
||||
var/item_type = checklist[i]
|
||||
if (istype(O,item_type))
|
||||
checklist.Cut(i, i+1)
|
||||
found = 1
|
||||
break
|
||||
if (!found)
|
||||
. = 0
|
||||
else
|
||||
for(var/obj/O in container.contents)
|
||||
if(istype(O,/obj/item/weapon/reagent_containers/food/snacks/grown))
|
||||
continue // Fruit is handled in check_fruit().
|
||||
var/found = 0
|
||||
for(var/i = 1; i < checklist.len+1; i++)
|
||||
var/item_type = checklist[i]
|
||||
if (istype(O,item_type))
|
||||
checklist.Cut(i, i+1)
|
||||
found = 1
|
||||
break
|
||||
if (!found)
|
||||
. = 0
|
||||
if (checklist.len)
|
||||
. = -1
|
||||
return .
|
||||
|
||||
//general version
|
||||
/datum/recipe/proc/make(var/obj/container as obj)
|
||||
var/obj/result_obj = new result(container)
|
||||
if(istype(container, /obj/machinery))
|
||||
var/obj/machinery/machine = container
|
||||
for (var/obj/O in ((machine.contents-result_obj - machine.component_parts) - machine.circuit))
|
||||
O.reagents.trans_to_obj(result_obj, O.reagents.total_volume)
|
||||
qdel(O)
|
||||
else
|
||||
for (var/obj/O in (container.contents-result_obj))
|
||||
O.reagents.trans_to_obj(result_obj, O.reagents.total_volume)
|
||||
qdel(O)
|
||||
container.reagents.clear_reagents()
|
||||
return result_obj
|
||||
|
||||
// food-related
|
||||
/datum/recipe/proc/make_food(var/obj/container as obj)
|
||||
if(!result)
|
||||
to_world("<span class='danger'>Recipe [type] is defined without a result, please bug report this.</span>")
|
||||
return
|
||||
var/obj/result_obj = new result(container)
|
||||
if(istype(container, /obj/machinery))
|
||||
var/obj/machinery/machine = container
|
||||
for (var/obj/O in ((machine.contents-result_obj - machine.component_parts) - machine.circuit))
|
||||
if (O.reagents)
|
||||
O.reagents.del_reagent("nutriment")
|
||||
O.reagents.update_total()
|
||||
O.reagents.trans_to_obj(result_obj, O.reagents.total_volume)
|
||||
qdel(O)
|
||||
else
|
||||
for (var/obj/O in (container.contents-result_obj))
|
||||
if (O.reagents)
|
||||
O.reagents.del_reagent("nutriment")
|
||||
O.reagents.update_total()
|
||||
O.reagents.trans_to_obj(result_obj, O.reagents.total_volume)
|
||||
qdel(O)
|
||||
container.reagents.clear_reagents()
|
||||
return result_obj
|
||||
|
||||
/proc/select_recipe(var/list/datum/recipe/avaiable_recipes, var/obj/obj as obj, var/exact)
|
||||
var/list/datum/recipe/possible_recipes = new
|
||||
var/target = exact ? 0 : 1
|
||||
for (var/datum/recipe/recipe in avaiable_recipes)
|
||||
if((recipe.check_reagents(obj.reagents) < target) || (recipe.check_items(obj) < target) || (recipe.check_fruit(obj) < target))
|
||||
continue
|
||||
possible_recipes |= recipe
|
||||
if (possible_recipes.len==0)
|
||||
return null
|
||||
else if (possible_recipes.len==1)
|
||||
return possible_recipes[1]
|
||||
else //okay, let's select the most complicated recipe
|
||||
var/highest_count = 0
|
||||
. = possible_recipes[1]
|
||||
for (var/datum/recipe/recipe in possible_recipes)
|
||||
var/count = ((recipe.items)?(recipe.items.len):0) + ((recipe.reagents)?(recipe.reagents.len):0) + ((recipe.fruit)?(recipe.fruit.len):0)
|
||||
if (count >= highest_count)
|
||||
highest_count = count
|
||||
. = recipe
|
||||
return .
|
||||
@@ -365,7 +365,7 @@
|
||||
/obj/item/weapon/reagent_containers/food/condiment/cornoil = 5,
|
||||
/obj/item/weapon/tray = 8,
|
||||
/obj/item/weapon/material/kitchen/utensil/fork = 6,
|
||||
/obj/item/weapon/material/knife = 6,
|
||||
/obj/item/weapon/material/knife/plastic = 6,
|
||||
/obj/item/weapon/material/kitchen/utensil/spoon = 6,
|
||||
/obj/item/weapon/material/knife = 3,
|
||||
/obj/item/weapon/material/kitchen/rollingpin = 2,
|
||||
@@ -383,6 +383,8 @@
|
||||
/obj/item/weapon/storage/toolbox/lunchbox/cti = 3,
|
||||
/obj/item/weapon/storage/toolbox/lunchbox/nymph = 3,
|
||||
/obj/item/weapon/storage/toolbox/lunchbox/syndicate = 3,
|
||||
/obj/item/weapon/reagent_containers/cooking_container/oven = 5,
|
||||
/obj/item/weapon/reagent_containers/cooking_container/fryer = 4,
|
||||
/obj/item/trash/bowl = 10) //VOREStation Add
|
||||
contraband = list(/obj/item/weapon/material/knife/butch = 2)
|
||||
|
||||
|
||||
@@ -91,5 +91,22 @@
|
||||
name = "bread tube"
|
||||
icon_state = "tastybread"
|
||||
|
||||
// Aurora Food Port
|
||||
/obj/item/trash/brownies
|
||||
name = "brownie tray"
|
||||
icon_state = "brownies"
|
||||
|
||||
/obj/item/trash/snacktray
|
||||
name = "snacktray"
|
||||
icon_state = "snacktray"
|
||||
|
||||
/obj/item/trash/dipbowl
|
||||
name = "dip bowl"
|
||||
icon_state = "dipbowl"
|
||||
|
||||
/obj/item/trash/chipbasket
|
||||
name = "empty basket"
|
||||
icon_state = "chipbasket_empty"
|
||||
|
||||
/obj/item/trash/attack(mob/M as mob, mob/living/user as mob)
|
||||
return
|
||||
|
||||
@@ -4,7 +4,9 @@
|
||||
|
||||
starts_with = list(
|
||||
/obj/item/weapon/reagent_containers/food/condiment/flour = 7,
|
||||
/obj/item/weapon/reagent_containers/food/condiment/sugar = 2)
|
||||
/obj/item/weapon/reagent_containers/food/condiment/sugar = 2,
|
||||
/obj/item/weapon/reagent_containers/food/condiment/spacespice = 2
|
||||
)
|
||||
|
||||
/obj/structure/closet/secure_closet/freezer/kitchen/mining
|
||||
req_access = list()
|
||||
|
||||
@@ -63,13 +63,6 @@
|
||||
if (OL && istype(OL))
|
||||
OL.data["temperature"] = temperature
|
||||
|
||||
/obj/machinery/appliance/cooker/fryer/set_cooking(new_setting)
|
||||
..()
|
||||
if(new_setting)
|
||||
fry_loop.start()
|
||||
else
|
||||
fry_loop.stop()
|
||||
|
||||
/obj/machinery/appliance/cooker/fryer/update_cooking_power()
|
||||
..()//In addition to parent temperature calculation
|
||||
//Fryer efficiency also drops when oil levels arent optimal
|
||||
@@ -92,8 +85,10 @@
|
||||
/obj/machinery/appliance/cooker/fryer/update_icon()
|
||||
if(cooking)
|
||||
icon_state = on_icon
|
||||
fry_loop.start()
|
||||
else
|
||||
icon_state = off_icon
|
||||
fry_loop.stop(src)
|
||||
..()
|
||||
|
||||
//Fryer gradually infuses any cooked food with oil. Moar calories
|
||||
|
||||
@@ -3,8 +3,78 @@
|
||||
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
|
||||
stat = POWEROFF
|
||||
|
||||
/obj/machinery/appliance/grill/toggle_power()
|
||||
set src in view()
|
||||
set name = "Toggle Power"
|
||||
set category = "Object"
|
||||
|
||||
var/datum/cooking_item/CI = cooking_objs[1]
|
||||
|
||||
if (stat & POWEROFF)//Its turned off
|
||||
stat &= ~POWEROFF
|
||||
if (usr)
|
||||
usr.visible_message("[usr] turns \the [src] on", "You turn on \the [src].")
|
||||
get_cooking_work(CI)
|
||||
use_power = 2
|
||||
else //It's on, turn it off
|
||||
stat |= POWEROFF
|
||||
use_power = 0
|
||||
if (usr)
|
||||
usr.visible_message("[usr] turns \the [src] off", "You turn off \the [src].")
|
||||
playsound(src, 'sound/machines/click.ogg', 40, 1)
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/appliance/grill/initialize()
|
||||
. = ..()
|
||||
cooking_objs += new /datum/cooking_item(new /obj/item/weapon/reagent_containers/cooking_container(src))
|
||||
cooking = 0
|
||||
|
||||
/obj/machinery/appliance/grill/has_space(var/obj/item/I)
|
||||
var/datum/cooking_item/CI = cooking_objs[1]
|
||||
if (!CI || !CI.container)
|
||||
return 0
|
||||
|
||||
if (CI.container.can_fit(I))
|
||||
return CI
|
||||
|
||||
return 0
|
||||
|
||||
//Container is not removable
|
||||
/obj/machinery/appliance/grill/removal_menu(var/mob/user)
|
||||
if (can_remove_items(user))
|
||||
var/list/menuoptions = list()
|
||||
for (var/a in cooking_objs)
|
||||
var/datum/cooking_item/CI = a
|
||||
if (CI.container)
|
||||
if (!CI.container.check_contents())
|
||||
to_chat(user, "There's nothing in the [src] you can remove!")
|
||||
return
|
||||
|
||||
for (var/obj/item/I in CI.container)
|
||||
menuoptions[I.name] = I
|
||||
|
||||
var/selection = input(user, "Which item would you like to remove? If you want to remove chemicals, use an empty beaker.", "Remove ingredients") as null|anything in menuoptions
|
||||
if (selection)
|
||||
var/obj/item/I = menuoptions[selection]
|
||||
if (!user || !user.put_in_hands(I))
|
||||
I.forceMove(get_turf(src))
|
||||
update_icon()
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/obj/machinery/appliance/grill/update_icon()
|
||||
if (!stat)
|
||||
icon_state = on_icon
|
||||
else
|
||||
icon_state = off_icon
|
||||
|
||||
/obj/machinery/appliance/grill/process()
|
||||
if (!stat)
|
||||
for (var/i in cooking_objs)
|
||||
do_cooking_tick(i)
|
||||
@@ -2,22 +2,116 @@
|
||||
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"
|
||||
icon_state = "ovenopen"
|
||||
cook_type = "baked"
|
||||
cook_time = 300
|
||||
appliancetype = OVEN
|
||||
food_color = "#A34719"
|
||||
can_burn_food = 1
|
||||
active_power_usage = 6 KILOWATTS
|
||||
//Based on a double deck electric convection oven
|
||||
|
||||
resistance = 16000
|
||||
idle_power_usage = 2 KILOWATTS
|
||||
//uses ~30% power to stay warm
|
||||
optimal_power = 0.2
|
||||
|
||||
light_x = 2
|
||||
max_contents = 5
|
||||
container_type = /obj/item/weapon/reagent_containers/cooking_container/oven
|
||||
|
||||
stat = POWEROFF //Starts turned off
|
||||
|
||||
var/open = TRUE
|
||||
|
||||
output_options = list(
|
||||
"Personal Pizza" = /obj/item/weapon/reagent_containers/food/snacks/variable/pizza,
|
||||
"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,
|
||||
"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,
|
||||
)
|
||||
|
||||
/obj/machinery/appliance/cooker/oven/update_icon()
|
||||
if(!open)
|
||||
if(!stat)
|
||||
icon_state = "ovenclosed_on"
|
||||
else
|
||||
icon_state = "ovenclosed_off"
|
||||
else
|
||||
icon_state = "ovenopen"
|
||||
..()
|
||||
|
||||
/obj/machinery/appliance/cooker/oven/AltClick(var/mob/user)
|
||||
try_toggle_door(user)
|
||||
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
|
||||
|
||||
/obj/machinery/appliance/cooker/oven/verb/toggle_door()
|
||||
set src in oview(1)
|
||||
set category = "Object"
|
||||
set name = "Open/close oven door"
|
||||
|
||||
try_toggle_door(usr)
|
||||
|
||||
/obj/machinery/appliance/cooker/oven/proc/try_toggle_door(mob/user)
|
||||
if(!isliving(usr) || isAI(user))
|
||||
return
|
||||
|
||||
if(!usr.IsAdvancedToolUser())
|
||||
to_chat(user, "<span class='notice'>You lack the dexterity to do that.</span>")
|
||||
return
|
||||
|
||||
if(!Adjacent(usr))
|
||||
to_chat(user, "<span class='notice'>You can't reach the [src] from there, get closer!</span>")
|
||||
return
|
||||
|
||||
if(open)
|
||||
open = FALSE
|
||||
loss = (active_power_usage / resistance)*0.5
|
||||
else
|
||||
open = TRUE
|
||||
loss = (active_power_usage / resistance)*4
|
||||
//When the oven door is opened, heat is lost MUCH faster
|
||||
|
||||
playsound(src, 'sound/machines/hatch_open.ogg', 20, 1)
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/appliance/cooker/oven/can_insert(var/obj/item/I, var/mob/user)
|
||||
if(!open)
|
||||
to_chat(user, "<span class='warning'>You can't put anything in while the door is closed!</span>")
|
||||
return 0
|
||||
|
||||
else
|
||||
return ..()
|
||||
|
||||
|
||||
//If an oven's door is open it will lose heat every proc, even if it also gained it
|
||||
//But dont call equalize twice in one stack. A return value of -1 from the parent indicates equalize was already called
|
||||
/obj/machinery/appliance/cooker/oven/heat_up()
|
||||
.=..()
|
||||
if(open && . != -1)
|
||||
var/turf/T = get_turf(src)
|
||||
if(temperature > T.temperature)
|
||||
equalize_temperature()
|
||||
|
||||
/obj/machinery/appliance/cooker/oven/can_remove_items(var/mob/user)
|
||||
if(!open)
|
||||
to_chat(user, "<span class='warning'>You can't take anything out while the door is closed!</span>")
|
||||
return 0
|
||||
|
||||
else
|
||||
return ..()
|
||||
|
||||
|
||||
//Oven has lots of recipes and combine options. The chance for interference is high, so
|
||||
//If a combine target is set the oven will do it instead of checking recipes
|
||||
/obj/machinery/appliance/cooker/oven/finish_cooking(var/datum/cooking_item/CI)
|
||||
if(CI.combine_target)
|
||||
CI.result_type = 3//Combination type. We're making something out of our ingredients
|
||||
combination_cook(CI)
|
||||
return
|
||||
else
|
||||
..()
|
||||
@@ -1,13 +1,14 @@
|
||||
/obj/machinery/microwave
|
||||
name = "microwave"
|
||||
name = "Microwave"
|
||||
desc = "Studies are inconclusive on whether pressing your face against the glass is harmful."
|
||||
icon = 'icons/obj/kitchen.dmi'
|
||||
icon_state = "mw"
|
||||
layer = 2.9
|
||||
density = 1
|
||||
anchored = 1
|
||||
use_power = USE_POWER_IDLE
|
||||
idle_power_usage = 5
|
||||
active_power_usage = 100
|
||||
active_power_usage = 2000
|
||||
clicksound = "button"
|
||||
clickvol = "30"
|
||||
flags = OPENCONTAINER | NOREACT
|
||||
@@ -20,7 +21,9 @@
|
||||
var/global/list/acceptable_items // List of the items you can put in
|
||||
var/global/list/datum/recipe/microwave/available_recipes // List of the recipes you can use
|
||||
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 = 20
|
||||
var/appliancetype = MICROWAVE
|
||||
var/datum/looping_sound/microwave/soundloop
|
||||
|
||||
|
||||
@@ -37,10 +40,14 @@
|
||||
|
||||
default_apply_parts()
|
||||
|
||||
if (!available_recipes)
|
||||
if(!available_recipes)
|
||||
available_recipes = new
|
||||
for (var/type in (typesof(/datum/recipe/microwave)-/datum/recipe/microwave))
|
||||
available_recipes+= new type
|
||||
var/datum/recipe/test = new type
|
||||
if((test.appliance & appliancetype))
|
||||
available_recipes += test
|
||||
else
|
||||
qdel(test)
|
||||
acceptable_items = new
|
||||
acceptable_reagents = new
|
||||
for (var/datum/recipe/microwave/recipe in available_recipes)
|
||||
@@ -48,8 +55,6 @@
|
||||
acceptable_items |= item
|
||||
for (var/reagent in recipe.reagents)
|
||||
acceptable_reagents |= reagent
|
||||
if (recipe.items)
|
||||
max_n_of_items = max(max_n_of_items,recipe.items.len)
|
||||
// This will do until I can think of a fun recipe to use dionaea in -
|
||||
// will also allow anything using the holder item to be microwaved into
|
||||
// impure carbon. ~Z
|
||||
@@ -95,16 +100,10 @@
|
||||
src.icon_state = "mw"
|
||||
src.broken = 0 // Fix it!
|
||||
src.dirty = 0 // just to be sure
|
||||
src.flags = OPENCONTAINER | NOREACT
|
||||
src.flags = OPENCONTAINER
|
||||
else
|
||||
to_chat(user, "<span class='warning'>It's broken!</span>")
|
||||
return 1
|
||||
else if(default_deconstruction_screwdriver(user, O))
|
||||
return
|
||||
else if(default_deconstruction_crowbar(user, O))
|
||||
return
|
||||
else if(default_unfasten_wrench(user, O, 10))
|
||||
return
|
||||
|
||||
else if(src.dirty==100) // The microwave is all dirty so can't be used!
|
||||
if(istype(O, /obj/item/weapon/reagent_containers/spray/cleaner) || istype(O, /obj/item/weapon/soap)) // If they're trying to clean it then let them
|
||||
@@ -120,12 +119,12 @@
|
||||
src.dirty = 0 // It's clean!
|
||||
src.broken = 0 // just to be sure
|
||||
src.icon_state = "mw"
|
||||
src.flags = OPENCONTAINER | NOREACT
|
||||
src.flags = OPENCONTAINER
|
||||
else //Otherwise bad luck!!
|
||||
to_chat(user, "<span class='warning'>It's dirty!</span>")
|
||||
return 1
|
||||
else if(is_type_in_list(O,acceptable_items))
|
||||
if (contents.len>=(max_n_of_items + component_parts.len + circuit_item_capacity)) //Adds component_parts to the maximum number of items. changed 1 to actually just be the circuit item capacity var.
|
||||
if(contents.len>=(max_n_of_items + component_parts.len + circuit_item_capacity)) //Adds component_parts to the maximum number of items. changed 1 to actually just be the circuit item capacity var.
|
||||
to_chat(user, "<span class='warning'>This [src] is full of ingredients, you cannot put more.</span>")
|
||||
return 1
|
||||
if(istype(O, /obj/item/stack) && O:get_amount() > 1) // This is bad, but I can't think of how to change it
|
||||
@@ -137,9 +136,8 @@
|
||||
"<span class='notice'>You add one of [O] to \the [src].</span>")
|
||||
return
|
||||
else
|
||||
// user.remove_from_mob(O) //This just causes problems so far as I can tell. -Pete
|
||||
user.drop_item()
|
||||
O.loc = src
|
||||
// user.remove_from_mob(O) //This just causes problems so far as I can tell. -Pete - Man whoever you are, it's been years. o7
|
||||
user.drop_from_inventory(O,src)
|
||||
user.visible_message( \
|
||||
"<span class='notice'>\The [user] has added \the [O] to \the [src].</span>", \
|
||||
"<span class='notice'>You add \the [O] to \the [src].</span>")
|
||||
@@ -159,6 +157,19 @@
|
||||
var/obj/item/weapon/grab/G = O
|
||||
to_chat(user, "<span class='warning'>This is ridiculous. You can not fit \the [G.affecting] in this [src].</span>")
|
||||
return 1
|
||||
else if(O.is_crowbar())
|
||||
user.visible_message( \
|
||||
"<span class='notice'>\The [user] begins [src.anchored ? "unsecuring" : "securing"] the microwave.</span>", \
|
||||
"<span class='notice'>You attempt to [src.anchored ? "unsecure" : "secure"] the microwave.</span>"
|
||||
)
|
||||
if (do_after(user,20))
|
||||
user.visible_message( \
|
||||
"<span class='notice'>\The [user] [src.anchored ? "unsecures" : "secures"] the microwave.</span>", \
|
||||
"<span class='notice'>You [src.anchored ? "unsecure" : "secure"] the microwave.</span>"
|
||||
)
|
||||
src.anchored = !src.anchored
|
||||
else
|
||||
to_chat(user, "<span class='notice'>You decide not to do that.</span>")
|
||||
else
|
||||
to_chat(user, "<span class='warning'>You have no idea what you can cook with this [O].</span>")
|
||||
..()
|
||||
@@ -248,8 +259,8 @@
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
start()
|
||||
if (reagents.total_volume==0 && !(locate(/obj) in ((contents - component_parts) - circuit))) //dry run
|
||||
if (!wzhzhzh(5)) //VOREStation Edit - Quicker Microwaves
|
||||
if(reagents.total_volume==0 && !(locate(/obj) in ((contents - component_parts) - circuit))) //dry run
|
||||
if(!wzhzhzh(5)) //VOREStation Edit - Quicker Microwaves
|
||||
abort()
|
||||
return
|
||||
abort()
|
||||
@@ -257,55 +268,93 @@
|
||||
|
||||
var/datum/recipe/microwave/recipe = select_recipe(available_recipes,src)
|
||||
var/obj/cooked
|
||||
if (!recipe)
|
||||
if(!recipe)
|
||||
dirty += 1
|
||||
if (prob(max(10,dirty*5)))
|
||||
if (!wzhzhzh(2)) //VOREStation Edit - Quicker Microwaves
|
||||
if(prob(max(10,dirty*5)))
|
||||
if(!wzhzhzh(2)) //VOREStation Edit - Quicker Microwaves
|
||||
abort()
|
||||
return
|
||||
muck_start()
|
||||
wzhzhzh(2) //VOREStation Edit - Quicker Microwaves
|
||||
muck_finish()
|
||||
cooked = fail()
|
||||
cooked.loc = src.loc
|
||||
cooked.forceMove(src.loc)
|
||||
return
|
||||
else if (has_extra_item())
|
||||
if (!wzhzhzh(2)) //VOREStation Edit - Quicker Microwaves
|
||||
else if(has_extra_item())
|
||||
if(!wzhzhzh(2)) //VOREStation Edit - Quicker Microwaves
|
||||
abort()
|
||||
return
|
||||
broke()
|
||||
cooked = fail()
|
||||
cooked.loc = src.loc
|
||||
cooked.forceMove(src.loc)
|
||||
return
|
||||
else
|
||||
if (!wzhzhzh(5)) //VOREStation Edit - Quicker Microwaves
|
||||
if(!wzhzhzh(5)) //VOREStation Edit - Quicker Microwaves
|
||||
abort()
|
||||
return
|
||||
abort()
|
||||
cooked = fail()
|
||||
cooked.loc = src.loc
|
||||
cooked.forceMove(src.loc)
|
||||
return
|
||||
else
|
||||
var/halftime = round(recipe.time/20/2) //VOREStation Edit - Quicker Microwaves
|
||||
if (!wzhzhzh(halftime))
|
||||
if(!wzhzhzh(halftime))
|
||||
abort()
|
||||
return
|
||||
if (!wzhzhzh(halftime))
|
||||
if(!wzhzhzh(halftime))
|
||||
abort()
|
||||
cooked = fail()
|
||||
cooked.loc = src.loc
|
||||
cooked.forceMove(src.loc)
|
||||
return
|
||||
cooked = recipe.make_food(src)
|
||||
abort()
|
||||
if(cooked)
|
||||
cooked.loc = src.loc
|
||||
cooked.forceMove(src.loc)
|
||||
return
|
||||
|
||||
//Making multiple copies of a recipe
|
||||
var/result = recipe.result
|
||||
var/valid = 1
|
||||
var/list/cooked_items = list()
|
||||
var/obj/temp = new /obj(src) //To prevent infinite loops, all results will be moved into a temporary location so they're not considered as inputs for other recipes
|
||||
while(valid)
|
||||
var/list/things = list()
|
||||
things.Add(recipe.make_food(src))
|
||||
cooked_items += things
|
||||
//Move cooked things to the buffer so they're not considered as ingredients
|
||||
for(var/atom/movable/AM in things)
|
||||
AM.forceMove(temp)
|
||||
|
||||
valid = 0
|
||||
recipe = select_recipe(available_recipes,src)
|
||||
if(recipe && recipe.result == result)
|
||||
sleep(2)
|
||||
valid = 1
|
||||
|
||||
for(var/r in cooked_items)
|
||||
var/atom/movable/R = r
|
||||
R.forceMove(src) //Move everything from the buffer back to the container
|
||||
|
||||
QDEL_NULL(temp)//Delete buffer object
|
||||
|
||||
//Any leftover reagents are divided amongst the foods
|
||||
var/total = reagents.total_volume
|
||||
for(var/obj/item/weapon/reagent_containers/food/snacks/S in cooked_items)
|
||||
reagents.trans_to_holder(S.reagents, total/cooked_items.len)
|
||||
|
||||
for(var/obj/item/weapon/reagent_containers/food/snacks/S in contents)
|
||||
S.cook()
|
||||
|
||||
dispose(0) //clear out anything left
|
||||
stop()
|
||||
|
||||
return
|
||||
|
||||
/obj/machinery/microwave/proc/wzhzhzh(var/seconds as num) // Whoever named this proc is fucking literally Satan. ~ Z
|
||||
for (var/i=1 to seconds)
|
||||
if (stat & (NOPOWER|BROKEN))
|
||||
return 0
|
||||
use_power(500)
|
||||
use_power(active_power_usage)
|
||||
sleep(5) //VOREStation Edit - Quicker Microwaves
|
||||
return 1
|
||||
|
||||
@@ -343,13 +392,14 @@
|
||||
updateUsrDialog()
|
||||
soundloop.stop()
|
||||
|
||||
/obj/machinery/microwave/proc/dispose()
|
||||
for (var/obj/O in ((contents-component_parts)-circuit))
|
||||
O.loc = src.loc
|
||||
/obj/machinery/microwave/proc/dispose(var/message = 1)
|
||||
for (var/atom/movable/A in ((contents-component_parts)-circuit))
|
||||
A.forceMove(loc)
|
||||
if (src.reagents.total_volume)
|
||||
src.dirty++
|
||||
src.reagents.clear_reagents()
|
||||
to_chat(usr, "<span class='notice'>You dispose of the microwave contents.</span>")
|
||||
if(message)
|
||||
to_chat(usr, "<span class='notice'>You dispose of the microwave contents.</span>")
|
||||
src.updateUsrDialog()
|
||||
|
||||
/obj/machinery/microwave/proc/muck_start()
|
||||
@@ -410,6 +460,32 @@
|
||||
dispose()
|
||||
return
|
||||
|
||||
/obj/machinery/microwave/verb/Eject()
|
||||
set src in oview(1)
|
||||
set category = "Object"
|
||||
set name = "Eject content"
|
||||
usr.visible_message(
|
||||
"<span class='notice'>[usr] tries to open [src] and remove its contents.</span>" ,
|
||||
"<span class='notice'>You try to open [src] and remove its contents.</span>"
|
||||
)
|
||||
|
||||
if(!do_after(usr, 1 SECONDS, target = src))
|
||||
return
|
||||
|
||||
usr.visible_message(
|
||||
"<span class='notice'>[usr] opened [src] and has taken out [english_list(contents)].</span>" ,
|
||||
"<span class='notice'>You have opened [src] and taken out [english_list(contents)].</span>"
|
||||
)
|
||||
dispose()
|
||||
|
||||
/obj/machinery/microwave/CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
|
||||
if(!mover)
|
||||
return 1
|
||||
if(mover.checkpass(PASSTABLE))
|
||||
//Animals can run under them, lots of empty space
|
||||
return 1
|
||||
return ..()
|
||||
|
||||
/obj/machinery/microwave/advanced // specifically for complex recipes
|
||||
name = "deluxe microwave"
|
||||
icon = 'icons/obj/deluxemicrowave.dmi'
|
||||
|
||||
321
code/modules/food/recipe.dm
Normal file
321
code/modules/food/recipe.dm
Normal file
@@ -0,0 +1,321 @@
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* /datum/recipe by rastaf0 13 apr 2011 *
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* This is powerful and flexible recipe system.
|
||||
* It exists not only for food.
|
||||
* supports both reagents and objects as prerequisites.
|
||||
* In order to use this system you have to define a deriative from /datum/recipe
|
||||
* * reagents are reagents. Acid, milc, booze, etc.
|
||||
* * items are objects. Fruits, tools, circuit boards.
|
||||
* * result is type to create as new object
|
||||
* * time is optional parameter, you shall use in in your machine,
|
||||
default /datum/recipe/ procs does not rely on this parameter.
|
||||
*
|
||||
* Functions you need:
|
||||
* /datum/recipe/proc/make(var/obj/container as obj)
|
||||
* Creates result inside container,
|
||||
* deletes prerequisite reagents,
|
||||
* transfers reagents from prerequisite objects,
|
||||
* deletes all prerequisite objects (even not needed for recipe at the moment).
|
||||
*
|
||||
* /proc/select_recipe(list/datum/recipe/available_recipes, obj/obj as obj, exact = 1)
|
||||
* Wonderful function that select suitable recipe for you.
|
||||
* obj is a machine (or magik hat) with prerequisites,
|
||||
* exact = 0 forces algorithm to ignore superfluous stuff.
|
||||
*
|
||||
*
|
||||
* Functions you do not need to call directly but could:
|
||||
* /datum/recipe/proc/check_reagents(var/datum/reagents/avail_reagents)
|
||||
* /datum/recipe/proc/check_items(var/obj/container as obj)
|
||||
*
|
||||
* */
|
||||
|
||||
// Recipe type defines. Used to determine what machine makes them. TODO: Add Grill to the list.
|
||||
#define MICROWAVE 0x1
|
||||
#define FRYER 0x2
|
||||
#define OVEN 0x4
|
||||
#define CANDYMAKER 0x8
|
||||
#define CEREALMAKER 0x10
|
||||
|
||||
/datum/recipe
|
||||
var/list/reagents // Example: = list("berryjuice" = 5) // do not list same reagent twice
|
||||
var/list/items // Example: = list(/obj/item/weapon/tool/crowbar, /obj/item/weapon/welder) // place /foo/bar before /foo
|
||||
var/list/fruit // Example: = list("fruit" = 3)
|
||||
var/coating = null // Required coating on all items in the recipe. The default value of null explitly requires no coating
|
||||
// A value of -1 is permissive and cares not for any coatings
|
||||
// Any typepath indicates a specific coating that should be present
|
||||
// Coatings are used for batter, breadcrumbs, beer-batter, colonel's secret coating, etc
|
||||
|
||||
var/result // Example: = /obj/item/weapon/reagent_containers/food/snacks/donut/normal
|
||||
var/result_quantity = 1 // Number of instances of result that are created.
|
||||
var/time = 100 // 1/10 part of second
|
||||
|
||||
#define RECIPE_REAGENT_REPLACE 0 //Reagents in the ingredients are discarded.
|
||||
//Only the reagents present in the result at compiletime are used
|
||||
#define RECIPE_REAGENT_MAX 1 //The result will contain the maximum of each reagent present between the two pools. Compiletime result, and sum of ingredients
|
||||
#define RECIPE_REAGENT_MIN 2 //As above, but the minimum, ignoring zero values.
|
||||
#define RECIPE_REAGENT_SUM 3 //The entire quantity of the ingredients are added to the result
|
||||
|
||||
var/reagent_mix = RECIPE_REAGENT_MAX //How to handle reagent differences between the ingredients and the results
|
||||
|
||||
var/appliance = MICROWAVE // Which apppliances this recipe can be made in. New Recipes will DEFAULT to using the Microwave, as a catch-all (and just in case)
|
||||
// List of defines is in _defines/misc.dm. But for reference they are:
|
||||
/*
|
||||
MICROWAVE
|
||||
FRYER
|
||||
OVEN
|
||||
CANDYMAKER
|
||||
CEREALMAKER
|
||||
*/
|
||||
// This is a bitfield, more than one type can be used
|
||||
// Grill is presently unused and not listed
|
||||
|
||||
/datum/recipe/proc/check_reagents(var/datum/reagents/avail_reagents)
|
||||
if(!reagents || !reagents.len)
|
||||
return 1
|
||||
|
||||
if(!avail_reagents)
|
||||
return 0
|
||||
|
||||
. = 1
|
||||
for(var/r_r in reagents)
|
||||
var/aval_r_amnt = avail_reagents.get_reagent_amount(r_r)
|
||||
if(aval_r_amnt - reagents[r_r] >= 0)
|
||||
if(aval_r_amnt>reagents[r_r])
|
||||
. = 0
|
||||
else
|
||||
return -1
|
||||
|
||||
if((reagents?(reagents.len):(0)) < avail_reagents.reagent_list.len)
|
||||
return 0
|
||||
return .
|
||||
|
||||
/datum/recipe/proc/check_fruit(var/obj/container)
|
||||
if (!fruit || !fruit.len)
|
||||
return 1
|
||||
|
||||
. = 1
|
||||
if(fruit && fruit.len)
|
||||
var/list/checklist = list()
|
||||
// You should trust Copy().
|
||||
checklist = fruit.Copy()
|
||||
for(var/obj/item/weapon/reagent_containers/food/snacks/grown/G in container)
|
||||
if(!G.seed || !G.seed.kitchen_tag || isnull(checklist[G.seed.kitchen_tag]))
|
||||
continue
|
||||
if(check_coating(G))
|
||||
checklist[G.seed.kitchen_tag]--
|
||||
for(var/ktag in checklist)
|
||||
if(!isnull(checklist[ktag]))
|
||||
if(checklist[ktag] < 0)
|
||||
. = 0
|
||||
else if(checklist[ktag] > 0)
|
||||
. = -1
|
||||
break
|
||||
return .
|
||||
|
||||
/datum/recipe/proc/check_items(var/obj/container as obj)
|
||||
if(!items || !items.len)
|
||||
return 1
|
||||
|
||||
. = 1
|
||||
if(items && items.len)
|
||||
var/list/checklist = list()
|
||||
checklist = items.Copy() // You should really trust Copy
|
||||
if(istype(container, /obj/machinery))
|
||||
var/obj/machinery/machine = container
|
||||
for(var/obj/O in ((machine.contents - machine.component_parts) - machine.circuit))
|
||||
if(istype(O,/obj/item/weapon/reagent_containers/food/snacks/grown))
|
||||
continue // Fruit is handled in check_fruit().
|
||||
var/found = 0
|
||||
for(var/i = 1; i < checklist.len+1; i++)
|
||||
var/item_type = checklist[i]
|
||||
if (istype(O,item_type))
|
||||
checklist.Cut(i, i+1)
|
||||
found = 1
|
||||
break
|
||||
if(!found)
|
||||
. = 0
|
||||
else
|
||||
for(var/obj/O in container.contents)
|
||||
if(istype(O,/obj/item/weapon/reagent_containers/food/snacks/grown))
|
||||
continue // Fruit is handled in check_fruit().
|
||||
var/found = 0
|
||||
for(var/i = 1; i < checklist.len+1; i++)
|
||||
var/item_type = checklist[i]
|
||||
if (istype(O,item_type))
|
||||
if(check_coating(O))
|
||||
checklist.Cut(i, i+1)
|
||||
found = 1
|
||||
break
|
||||
if (!found)
|
||||
. = 0
|
||||
if(checklist.len)
|
||||
. = -1
|
||||
return .
|
||||
|
||||
//This is called on individual items within the container.
|
||||
/datum/recipe/proc/check_coating(var/obj/O)
|
||||
if(!istype(O,/obj/item/weapon/reagent_containers/food/snacks))
|
||||
return 1//Only snacks can be battered
|
||||
|
||||
if (coating == -1)
|
||||
return 1 //-1 value doesnt care
|
||||
|
||||
var/obj/item/weapon/reagent_containers/food/snacks/S = O
|
||||
if (!S.coating)
|
||||
if (!coating)
|
||||
return 1
|
||||
return 0
|
||||
else if (S.coating.type == coating)
|
||||
return 1
|
||||
|
||||
return 0
|
||||
|
||||
//general version
|
||||
/datum/recipe/proc/make(var/obj/container as obj)
|
||||
var/obj/result_obj = new result(container)
|
||||
if(istype(container, /obj/machinery))
|
||||
var/obj/machinery/machine = container
|
||||
for (var/obj/O in ((machine.contents-result_obj - machine.component_parts) - machine.circuit))
|
||||
O.reagents.trans_to_obj(result_obj, O.reagents.total_volume)
|
||||
qdel(O)
|
||||
else
|
||||
for (var/obj/O in (container.contents-result_obj))
|
||||
O.reagents.trans_to_obj(result_obj, O.reagents.total_volume)
|
||||
qdel(O)
|
||||
container.reagents.clear_reagents()
|
||||
return result_obj
|
||||
|
||||
// food-related
|
||||
// This proc is called under the assumption that the container has already been checked and found to contain the necessary ingredients
|
||||
/datum/recipe/proc/make_food(var/obj/container as obj)
|
||||
if(!result)
|
||||
to_world("<span class='danger'>Recipe [type] is defined without a result, please bug report this.</span>")
|
||||
return
|
||||
|
||||
|
||||
// We will subtract all the ingredients from the container, and transfer their reagents into a holder
|
||||
// We will not touch things which are not required for this recipe. They will be left behind for the caller
|
||||
// to decide what to do. They may be used again to make another recipe or discarded, or merged into the results,
|
||||
// thats no longer the concern of this proc
|
||||
var/obj/temp = new /obj(src)
|
||||
temp.create_reagents(9999999999)
|
||||
|
||||
// Find items we need
|
||||
if(items && items.len)
|
||||
for (var/i in items)
|
||||
var/obj/item/I = locate(i) in container
|
||||
if (I && I.reagents)
|
||||
I.reagents.trans_to_holder(temp.reagents,I.reagents.total_volume)
|
||||
qdel(I)
|
||||
|
||||
// Find fruits
|
||||
if(fruit && fruit.len)
|
||||
var/list/checklist = list()
|
||||
checklist = fruit.Copy()
|
||||
|
||||
for(var/obj/item/weapon/reagent_containers/food/snacks/grown/G in container)
|
||||
if(!G.seed || !G.seed.kitchen_tag || isnull(checklist[G.seed.kitchen_tag]))
|
||||
continue
|
||||
|
||||
if(checklist[G.seed.kitchen_tag] > 0)
|
||||
//We found a thing we need
|
||||
checklist[G.seed.kitchen_tag]--
|
||||
if(G && G.reagents)
|
||||
G.reagents.trans_to_holder(temp.reagents,G.reagents.total_volume)
|
||||
qdel(G)
|
||||
|
||||
// And lastly deduct necessary quantities of reagents
|
||||
if(reagents && reagents.len)
|
||||
for (var/r in reagents)
|
||||
// Doesnt matter whether or not there's enough, we assume that check is done before
|
||||
container.reagents.trans_id_to(temp, r, reagents[r])
|
||||
|
||||
/*
|
||||
Now we've removed all the ingredients that were used and we have the buffer containing the total of
|
||||
all their reagents.
|
||||
Next up we create the result, and then handle the merging of reagents depending on the mix setting
|
||||
*/
|
||||
var/tally = 0
|
||||
|
||||
/*
|
||||
If we have multiple results, holder will be used as a buffer to hold reagents for the result objects.
|
||||
If, as in the most common case, there is only a single result, then it will just be a reference to
|
||||
the single-result's reagents
|
||||
*/
|
||||
var/obj/tempholder = new(src)
|
||||
tempholder.create_reagents(9999999999)
|
||||
var/list/results = list()
|
||||
while (tally < result_quantity)
|
||||
var/obj/result_obj = new result(container)
|
||||
results.Add(result_obj)
|
||||
|
||||
if(!result_obj.reagents)//This shouldn't happen
|
||||
//If the result somehow has no reagents defined, then create a new holder
|
||||
world << "[result_obj] had no reagents!"
|
||||
result_obj.create_reagents(temp.reagents.total_volume*1.5)
|
||||
|
||||
if(result_quantity == 1)
|
||||
qdel(tempholder.reagents)
|
||||
tempholder.reagents = result_obj.reagents
|
||||
else
|
||||
world << result_obj
|
||||
result_obj.reagents.trans_to(tempholder.reagents, result_obj.reagents.total_volume)
|
||||
tally++
|
||||
|
||||
|
||||
switch(reagent_mix)
|
||||
if(RECIPE_REAGENT_REPLACE)
|
||||
//We do no transferring
|
||||
if(RECIPE_REAGENT_SUM)
|
||||
//Sum is easy, just shove the entire buffer into the result
|
||||
temp.reagents.trans_to_holder(tempholder.reagents, temp.reagents.total_volume)
|
||||
if(RECIPE_REAGENT_MAX)
|
||||
//We want the highest of each.
|
||||
//Iterate through everything in buffer. If the target has less than the buffer, then top it up
|
||||
for (var/datum/reagent/R in temp.reagents.reagent_list)
|
||||
var/rvol = tempholder.reagents.get_reagent_amount(R.id)
|
||||
if (rvol < R.volume)
|
||||
//Transfer the difference
|
||||
temp.reagents.trans_id_to(tempholder, R.id, R.volume-rvol)
|
||||
|
||||
if(RECIPE_REAGENT_MIN)
|
||||
//Min is slightly more complex. We want the result to have the lowest from each side
|
||||
//But zero will not count. Where a side has zero its ignored and the side with a nonzero value is used
|
||||
for (var/datum/reagent/R in temp.reagents.reagent_list)
|
||||
var/rvol = tempholder.reagents.get_reagent_amount(R.id)
|
||||
if(rvol == 0) //If the target has zero of this reagent
|
||||
temp.reagents.trans_id_to(tempholder, R.id, R.volume)
|
||||
//Then transfer all of ours
|
||||
|
||||
else if(rvol > R.volume)
|
||||
//if the target has more than ours
|
||||
//Remove the difference
|
||||
tempholder.reagents.remove_reagent(R.id, rvol-R.volume)
|
||||
|
||||
|
||||
if(results.len > 1)
|
||||
//If we're here, then holder is a buffer containing the total reagents for all the results.
|
||||
//So now we redistribute it among them
|
||||
var/total = tempholder.reagents.total_volume
|
||||
for (var/i in results)
|
||||
var/atom/a = i //optimisation
|
||||
tempholder.reagents.trans_to(a, total / results.len)
|
||||
return results
|
||||
|
||||
// When exact is false, extraneous ingredients are ignored
|
||||
// When exact is true, extraneous ingredients will fail the recipe
|
||||
// In both cases, the full complement of required inredients is still needed
|
||||
/proc/select_recipe(var/list/datum/recipe/available_recipes, var/obj/obj as obj, var/exact)
|
||||
var/list/datum/recipe/possible_recipes = list()
|
||||
for (var/datum/recipe/recipe in available_recipes)
|
||||
if((recipe.check_reagents(obj.reagents) < exact) || (recipe.check_items(obj) < exact) || (recipe.check_fruit(obj) < exact))
|
||||
continue
|
||||
possible_recipes |= recipe
|
||||
if (!possible_recipes.len)
|
||||
return null
|
||||
else if (possible_recipes.len == 1)
|
||||
return possible_recipes[1]
|
||||
else //okay, let's select the most complicated recipe
|
||||
sortTim(possible_recipes, /proc/cmp_recipe_complexity_dsc)
|
||||
return possible_recipes[1]
|
||||
@@ -32,6 +32,7 @@
|
||||
"Reagents" = R.reagents,
|
||||
"Fruit" = R.fruit,
|
||||
"Ingredients" = R.items,
|
||||
"Appliance" = R.appliance,
|
||||
"Image" = result_icon
|
||||
)
|
||||
|
||||
@@ -81,6 +82,20 @@
|
||||
drink_recipes[Rp]["Reagents"] -= rid
|
||||
drink_recipes[Rp]["Reagents"][R_name] = amt
|
||||
|
||||
//We can also change the appliance to its proper name.
|
||||
for(var/Rp in food_recipes)
|
||||
switch(food_recipes[Rp]["Appliance"])
|
||||
if(1)
|
||||
food_recipes[Rp]["Appliance"] = "Microwave"
|
||||
if(2)
|
||||
food_recipes[Rp]["Appliance"] = "Fryer"
|
||||
if(4)
|
||||
food_recipes[Rp]["Appliance"] = "Oven"
|
||||
if(8)
|
||||
food_recipes[Rp]["Appliance"] = "Candy Maker"
|
||||
if(16)
|
||||
food_recipes[Rp]["Appliance"] = "Cereal Maker"
|
||||
|
||||
//////////////////////// SORTING
|
||||
var/list/foods_to_paths = list()
|
||||
var/list/drinks_to_paths = list()
|
||||
@@ -119,7 +134,7 @@
|
||||
|
||||
html += "<html><body><h3>Food Recipes (as of [time2text(world.realtime,"MMM DD, YYYY")])</h3><br>"
|
||||
html += "<table class='recipes'>"
|
||||
html += "<tr><th>Icon</th><th>Name</th><th>Ingredients</th></tr>"
|
||||
html += "<tr><th>Icon</th><th>Name</th><th>Appliance</th><th>Ingredients</th></tr>"
|
||||
for(var/Rp in food_recipes)
|
||||
//Open this row
|
||||
html += "<tr>"
|
||||
@@ -136,6 +151,9 @@
|
||||
//Name
|
||||
html += "<td><b>[food_recipes[Rp]["Result"]]</b></td>"
|
||||
|
||||
//Appliance
|
||||
html += "<td><b>[food_recipes[Rp]["Appliance"]]</b></td>"
|
||||
|
||||
//Ingredients
|
||||
html += "<td><ul>"
|
||||
var/count //For those commas. Not sure of a great other way to do it.
|
||||
|
||||
166
code/modules/food/recipes_fryer.dm
Normal file
166
code/modules/food/recipes_fryer.dm
Normal file
@@ -0,0 +1,166 @@
|
||||
/datum/recipe/fries
|
||||
appliance = FRYER
|
||||
items = list(
|
||||
/obj/item/weapon/reagent_containers/food/snacks/rawsticks
|
||||
)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/fries
|
||||
|
||||
|
||||
/datum/recipe/jpoppers
|
||||
appliance = FRYER
|
||||
fruit = list("chili" = 1)
|
||||
coating = /datum/reagent/nutriment/coating/batter
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/jalapeno_poppers
|
||||
|
||||
/datum/recipe/risottoballs
|
||||
appliance = FRYER
|
||||
reagents = list("sodiumchloride" = 1, "blackpepper" = 1)
|
||||
items = list(/obj/item/weapon/reagent_containers/food/snacks/risotto)
|
||||
coating = /datum/reagent/nutriment/coating/batter
|
||||
reagent_mix = RECIPE_REAGENT_REPLACE //Simplify end product
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/risottoballs
|
||||
|
||||
|
||||
//Meaty Recipes
|
||||
//====================
|
||||
/datum/recipe/cubancarp
|
||||
appliance = FRYER
|
||||
fruit = list("chili" = 1)
|
||||
items = list(
|
||||
/obj/item/weapon/reagent_containers/food/snacks/dough,
|
||||
/obj/item/weapon/reagent_containers/food/snacks/carpmeat
|
||||
)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/cubancarp
|
||||
|
||||
/datum/recipe/batteredsausage
|
||||
appliance = FRYER
|
||||
items = list(
|
||||
/obj/item/weapon/reagent_containers/food/snacks/sausage
|
||||
)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/sausage/battered
|
||||
coating = /datum/reagent/nutriment/coating/batter
|
||||
|
||||
|
||||
/datum/recipe/katsu
|
||||
appliance = FRYER
|
||||
items = list(
|
||||
/obj/item/weapon/reagent_containers/food/snacks/meat/chicken
|
||||
)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/chickenkatsu
|
||||
coating = /datum/reagent/nutriment/coating/beerbatter
|
||||
|
||||
|
||||
/datum/recipe/pizzacrunch_1
|
||||
appliance = FRYER
|
||||
items = list(
|
||||
/obj/item/weapon/reagent_containers/food/snacks/sliceable/pizza
|
||||
)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/sliceable/pizza/crunch
|
||||
coating = /datum/reagent/nutriment/coating/batter
|
||||
|
||||
//Alternate pizza crunch recipe for combination pizzas made in oven
|
||||
/datum/recipe/pizzacrunch_2
|
||||
appliance = FRYER
|
||||
items = list(
|
||||
/obj/item/weapon/reagent_containers/food/snacks/variable/pizza
|
||||
)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/sliceable/pizza/crunch
|
||||
coating = /datum/reagent/nutriment/coating/batter
|
||||
|
||||
/datum/recipe/friedmushroom
|
||||
appliance = FRYER
|
||||
fruit = list("plumphelmet" = 1)
|
||||
coating = /datum/reagent/nutriment/coating/beerbatter
|
||||
reagent_mix = RECIPE_REAGENT_REPLACE //Simplify end product
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/friedmushroom
|
||||
|
||||
|
||||
//Sweet Recipes.
|
||||
//==================
|
||||
/datum/recipe/jellydonut
|
||||
appliance = FRYER
|
||||
reagents = list("berryjuice" = 10, "sugar" = 10)
|
||||
items = list(
|
||||
/obj/item/weapon/reagent_containers/food/snacks/doughslice
|
||||
)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/donut/jelly
|
||||
result_quantity = 2
|
||||
|
||||
/datum/recipe/jellydonut/slime
|
||||
appliance = FRYER
|
||||
reagents = list("slimejelly" = 10, "sugar" = 10)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/donut/slimejelly
|
||||
|
||||
/datum/recipe/jellydonut/cherry
|
||||
appliance = FRYER
|
||||
reagents = list("cherryjelly" = 10, "sugar" = 10)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/donut/cherryjelly
|
||||
|
||||
/datum/recipe/donut
|
||||
appliance = FRYER
|
||||
reagents = list("sugar" = 10)
|
||||
items = list(
|
||||
/obj/item/weapon/reagent_containers/food/snacks/doughslice
|
||||
)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/donut/normal
|
||||
result_quantity = 2
|
||||
|
||||
/datum/recipe/chaosdonut
|
||||
appliance = FRYER
|
||||
reagents = list("frostoil" = 10, "capsaicin" = 10, "sugar" = 10)
|
||||
reagent_mix = RECIPE_REAGENT_REPLACE //This creates its own reagents
|
||||
items = list(
|
||||
/obj/item/weapon/reagent_containers/food/snacks/doughslice
|
||||
)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/donut/chaos
|
||||
result_quantity = 2
|
||||
|
||||
/datum/recipe/funnelcake
|
||||
appliance = FRYER
|
||||
reagents = list("sugar" = 5, "batter" = 10)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/funnelcake
|
||||
|
||||
/datum/recipe/pisanggoreng
|
||||
appliance = FRYER
|
||||
fruit = list("banana" = 2)
|
||||
reagent_mix = RECIPE_REAGENT_REPLACE //Simplify end product
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/pisanggoreng
|
||||
coating = /datum/reagent/nutriment/coating/batter
|
||||
|
||||
/datum/recipe/corn_dog
|
||||
appliance = FRYER
|
||||
items = list(
|
||||
/obj/item/weapon/reagent_containers/food/snacks/sausage
|
||||
)
|
||||
fruit = list("corn" = 1)
|
||||
coating = /datum/reagent/nutriment/coating/batter
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/corn_dog
|
||||
|
||||
/datum/recipe/sweet_and_sour
|
||||
appliance = FRYER
|
||||
items = list(
|
||||
/obj/item/weapon/reagent_containers/food/snacks/bacon,
|
||||
/obj/item/weapon/reagent_containers/food/snacks/cutlet
|
||||
)
|
||||
reagents = list("soysauce" = 5, "batter" = 10)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/sweet_and_sour
|
||||
|
||||
/datum/recipe/generalschicken
|
||||
appliance = FRYER
|
||||
reagents = list("capsaicin" = 2, "sugar" = 2, "batter" = 10)
|
||||
items = list(
|
||||
/obj/item/weapon/reagent_containers/food/snacks/meat,
|
||||
/obj/item/weapon/reagent_containers/food/snacks/meat
|
||||
)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/generalschicken
|
||||
|
||||
/datum/recipe/chickenwings
|
||||
appliance = FRYER
|
||||
reagents = list("capsaicin" = 5, "batter" = 10)
|
||||
items = list(
|
||||
/obj/item/weapon/reagent_containers/food/snacks/meat,
|
||||
/obj/item/weapon/reagent_containers/food/snacks/meat,
|
||||
/obj/item/weapon/reagent_containers/food/snacks/meat,
|
||||
/obj/item/weapon/reagent_containers/food/snacks/meat
|
||||
)
|
||||
result = /obj/item/weapon/storage/box/wings //This is kinda like the donut box.
|
||||
File diff suppressed because it is too large
Load Diff
@@ -8,7 +8,7 @@
|
||||
)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/path_to_some_food
|
||||
*/
|
||||
|
||||
// All of this shit needs to be gone through and reorganized into different recipes per machine - Rykka 7/16/2020
|
||||
/datum/recipe/microwave/jellydonut
|
||||
items = list(
|
||||
/obj/item/weapon/reagent_containers/food/snacks/doughslice)
|
||||
|
||||
581
code/modules/food/recipes_oven.dm
Normal file
581
code/modules/food/recipes_oven.dm
Normal file
@@ -0,0 +1,581 @@
|
||||
/datum/recipe/ovenchips
|
||||
appliance = OVEN
|
||||
items = list(
|
||||
/obj/item/weapon/reagent_containers/food/snacks/rawsticks
|
||||
)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/ovenchips
|
||||
|
||||
|
||||
|
||||
/datum/recipe/dionaroast
|
||||
appliance = OVEN
|
||||
fruit = list("apple" = 1)
|
||||
reagents = list("pacid" = 5) //It dissolves the carapace. Still poisonous, though.
|
||||
items = list(/obj/item/weapon/holder/diona)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/dionaroast
|
||||
reagent_mix = RECIPE_REAGENT_REPLACE //No eating polyacid
|
||||
|
||||
|
||||
/datum/recipe/ribplate //Putting this here for not seeing a roast section.
|
||||
appliance = OVEN
|
||||
reagents = list("honey" = 5, "spacespice" = 2, "blackpepper" = 1)
|
||||
items = list(/obj/item/weapon/reagent_containers/food/snacks/meat)
|
||||
reagent_mix = RECIPE_REAGENT_REPLACE
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/ribplate
|
||||
|
||||
|
||||
|
||||
|
||||
//Predesigned breads
|
||||
//================================
|
||||
/datum/recipe/bread
|
||||
appliance = OVEN
|
||||
items = list(
|
||||
/obj/item/weapon/reagent_containers/food/snacks/dough,
|
||||
/obj/item/weapon/reagent_containers/food/snacks/dough,
|
||||
/obj/item/weapon/reagent_containers/food/snacks/dough,
|
||||
/obj/item/weapon/reagent_containers/food/snacks/dough
|
||||
)
|
||||
reagents = list("sodiumchloride" = 1)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/sliceable/bread
|
||||
|
||||
/datum/recipe/baguette
|
||||
appliance = OVEN
|
||||
reagents = list("sodiumchloride" = 1, "blackpepper" = 1)
|
||||
items = list(
|
||||
/obj/item/weapon/reagent_containers/food/snacks/dough,
|
||||
/obj/item/weapon/reagent_containers/food/snacks/dough
|
||||
)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/baguette
|
||||
|
||||
|
||||
/datum/recipe/tofubread
|
||||
appliance = OVEN
|
||||
items = list(
|
||||
/obj/item/weapon/reagent_containers/food/snacks/dough,
|
||||
/obj/item/weapon/reagent_containers/food/snacks/dough,
|
||||
/obj/item/weapon/reagent_containers/food/snacks/dough,
|
||||
/obj/item/weapon/reagent_containers/food/snacks/tofu,
|
||||
/obj/item/weapon/reagent_containers/food/snacks/tofu,
|
||||
/obj/item/weapon/reagent_containers/food/snacks/tofu,
|
||||
/obj/item/weapon/reagent_containers/food/snacks/cheesewedge,
|
||||
/obj/item/weapon/reagent_containers/food/snacks/cheesewedge,
|
||||
/obj/item/weapon/reagent_containers/food/snacks/cheesewedge
|
||||
)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/sliceable/tofubread
|
||||
|
||||
|
||||
/datum/recipe/creamcheesebread
|
||||
appliance = OVEN
|
||||
items = list(
|
||||
/obj/item/weapon/reagent_containers/food/snacks/dough,
|
||||
/obj/item/weapon/reagent_containers/food/snacks/dough,
|
||||
/obj/item/weapon/reagent_containers/food/snacks/cheesewedge,
|
||||
/obj/item/weapon/reagent_containers/food/snacks/cheesewedge
|
||||
)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/sliceable/creamcheesebread
|
||||
|
||||
/datum/recipe/flatbread
|
||||
appliance = OVEN
|
||||
items = list(
|
||||
/obj/item/weapon/reagent_containers/food/snacks/sliceable/flatdough
|
||||
)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/flatbread
|
||||
|
||||
/datum/recipe/meatbread
|
||||
appliance = OVEN
|
||||
items = list(
|
||||
/obj/item/weapon/reagent_containers/food/snacks/dough,
|
||||
/obj/item/weapon/reagent_containers/food/snacks/dough,
|
||||
/obj/item/weapon/reagent_containers/food/snacks/dough,
|
||||
/obj/item/weapon/reagent_containers/food/snacks/meat,
|
||||
/obj/item/weapon/reagent_containers/food/snacks/meat,
|
||||
/obj/item/weapon/reagent_containers/food/snacks/meat,
|
||||
/obj/item/weapon/reagent_containers/food/snacks/cheesewedge,
|
||||
/obj/item/weapon/reagent_containers/food/snacks/cheesewedge,
|
||||
/obj/item/weapon/reagent_containers/food/snacks/cheesewedge
|
||||
)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/sliceable/meatbread
|
||||
|
||||
/datum/recipe/syntibread
|
||||
appliance = OVEN
|
||||
items = list(
|
||||
/obj/item/weapon/reagent_containers/food/snacks/dough,
|
||||
/obj/item/weapon/reagent_containers/food/snacks/dough,
|
||||
/obj/item/weapon/reagent_containers/food/snacks/dough,
|
||||
/obj/item/weapon/reagent_containers/food/snacks/meat/syntiflesh,
|
||||
/obj/item/weapon/reagent_containers/food/snacks/meat/syntiflesh,
|
||||
/obj/item/weapon/reagent_containers/food/snacks/meat/syntiflesh,
|
||||
/obj/item/weapon/reagent_containers/food/snacks/cheesewedge,
|
||||
/obj/item/weapon/reagent_containers/food/snacks/cheesewedge,
|
||||
/obj/item/weapon/reagent_containers/food/snacks/cheesewedge
|
||||
)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/sliceable/meatbread
|
||||
|
||||
/datum/recipe/xenomeatbread
|
||||
appliance = OVEN
|
||||
items = list(
|
||||
/obj/item/weapon/reagent_containers/food/snacks/dough,
|
||||
/obj/item/weapon/reagent_containers/food/snacks/dough,
|
||||
/obj/item/weapon/reagent_containers/food/snacks/dough,
|
||||
/obj/item/weapon/reagent_containers/food/snacks/xenomeat,
|
||||
/obj/item/weapon/reagent_containers/food/snacks/xenomeat,
|
||||
/obj/item/weapon/reagent_containers/food/snacks/xenomeat,
|
||||
/obj/item/weapon/reagent_containers/food/snacks/cheesewedge,
|
||||
/obj/item/weapon/reagent_containers/food/snacks/cheesewedge,
|
||||
/obj/item/weapon/reagent_containers/food/snacks/cheesewedge
|
||||
)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/sliceable/xenomeatbread
|
||||
|
||||
/datum/recipe/bananabread
|
||||
appliance = OVEN
|
||||
fruit = list("banana" = 1)
|
||||
reagents = list("milk" = 5, "sugar" = 15)
|
||||
items = list(
|
||||
/obj/item/weapon/reagent_containers/food/snacks/dough,
|
||||
/obj/item/weapon/reagent_containers/food/snacks/dough,
|
||||
/obj/item/weapon/reagent_containers/food/snacks/dough
|
||||
)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/sliceable/bananabread
|
||||
|
||||
|
||||
/datum/recipe/bun
|
||||
appliance = OVEN
|
||||
items = list(
|
||||
/obj/item/weapon/reagent_containers/food/snacks/dough
|
||||
)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/bun
|
||||
|
||||
//Predesigned pies
|
||||
//=======================
|
||||
|
||||
/datum/recipe/meatpie
|
||||
appliance = OVEN
|
||||
items = list(
|
||||
/obj/item/weapon/reagent_containers/food/snacks/sliceable/flatdough,
|
||||
/obj/item/weapon/reagent_containers/food/snacks/meat
|
||||
)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/meatpie
|
||||
|
||||
/datum/recipe/tofupie
|
||||
appliance = OVEN
|
||||
items = list(
|
||||
/obj/item/weapon/reagent_containers/food/snacks/sliceable/flatdough,
|
||||
/obj/item/weapon/reagent_containers/food/snacks/tofu
|
||||
)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/tofupie
|
||||
|
||||
/datum/recipe/xemeatpie
|
||||
appliance = OVEN
|
||||
items = list(
|
||||
/obj/item/weapon/reagent_containers/food/snacks/sliceable/flatdough,
|
||||
/obj/item/weapon/reagent_containers/food/snacks/xenomeat
|
||||
)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/xemeatpie
|
||||
|
||||
/datum/recipe/pie
|
||||
appliance = OVEN
|
||||
fruit = list("banana" = 1)
|
||||
reagents = list("sugar" = 5)
|
||||
items = list(/obj/item/weapon/reagent_containers/food/snacks/sliceable/flatdough)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/pie
|
||||
|
||||
/datum/recipe/cherrypie
|
||||
appliance = OVEN
|
||||
fruit = list("cherries" = 1)
|
||||
reagents = list("sugar" = 10)
|
||||
items = list(
|
||||
/obj/item/weapon/reagent_containers/food/snacks/sliceable/flatdough
|
||||
)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/cherrypie
|
||||
|
||||
|
||||
/datum/recipe/amanita_pie
|
||||
appliance = OVEN
|
||||
reagents = list("amatoxin" = 5)
|
||||
items = list(/obj/item/weapon/reagent_containers/food/snacks/sliceable/flatdough)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/amanita_pie
|
||||
|
||||
/datum/recipe/plump_pie
|
||||
appliance = OVEN
|
||||
fruit = list("plumphelmet" = 1)
|
||||
items = list(/obj/item/weapon/reagent_containers/food/snacks/sliceable/flatdough)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/plump_pie
|
||||
|
||||
|
||||
/datum/recipe/pumpkinpie
|
||||
appliance = OVEN
|
||||
fruit = list("pumpkin" = 1)
|
||||
reagents = list("milk" = 5, "sugar" = 5, "egg" = 3, "flour" = 10)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/sliceable/pumpkinpie
|
||||
reagent_mix = RECIPE_REAGENT_REPLACE //We dont want raw egg in the result
|
||||
|
||||
/datum/recipe/appletart
|
||||
appliance = OVEN
|
||||
fruit = list("goldapple" = 1)
|
||||
reagents = list("sugar" = 5, "milk" = 5, "flour" = 10, "egg" = 3)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/appletart
|
||||
reagent_mix = RECIPE_REAGENT_REPLACE
|
||||
|
||||
/datum/recipe/keylimepie
|
||||
appliance = OVEN
|
||||
fruit = list("lime" = 2)
|
||||
reagents = list("milk" = 5, "sugar" = 5, "egg" = 3, "flour" = 10)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/sliceable/keylimepie
|
||||
reagent_mix = RECIPE_REAGENT_REPLACE //No raw egg in finished product, protein after cooking causes magic meatballs otherwise
|
||||
|
||||
/datum/recipe/quiche
|
||||
appliance = OVEN
|
||||
reagents = list("milk" = 5, "egg" = 9, "flour" = 10)
|
||||
items = list(/obj/item/weapon/reagent_containers/food/snacks/cheesewedge)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/sliceable/quiche
|
||||
reagent_mix = RECIPE_REAGENT_REPLACE //No raw egg in finished product, protein after cooking causes magic meatballs otherwise
|
||||
|
||||
//Baked sweets:
|
||||
//---------------
|
||||
|
||||
/datum/recipe/cookie
|
||||
appliance = OVEN
|
||||
reagents = list("milk" = 10, "sugar" = 10)
|
||||
items = list(
|
||||
/obj/item/weapon/reagent_containers/food/snacks/dough,
|
||||
/obj/item/weapon/reagent_containers/food/snacks/chocolatebar
|
||||
)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/cookie
|
||||
result_quantity = 4
|
||||
reagent_mix = RECIPE_REAGENT_REPLACE
|
||||
|
||||
/datum/recipe/fortunecookie
|
||||
appliance = OVEN
|
||||
reagents = list("sugar" = 5)
|
||||
items = list(
|
||||
/obj/item/weapon/reagent_containers/food/snacks/doughslice,
|
||||
/obj/item/weapon/paper
|
||||
)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/fortunecookie
|
||||
make_food(var/obj/container as obj)
|
||||
|
||||
var/obj/item/weapon/paper/paper
|
||||
|
||||
//Fuck fortune cookies. This is a quick hack
|
||||
//Duplicate the item searching code with a special case for paper
|
||||
for (var/i in items)
|
||||
var/obj/item/I = locate(i) in container
|
||||
if (!paper && istype(I, /obj/item/weapon/paper))
|
||||
paper = I
|
||||
continue
|
||||
|
||||
if (I)
|
||||
qdel(I)
|
||||
|
||||
//Then store and null out the items list so it wont delete any paper
|
||||
var/list/L = items.Copy()
|
||||
items = null
|
||||
. = ..(container)
|
||||
|
||||
//Restore items list, so that making fortune cookies once doesnt break the oven
|
||||
items = L
|
||||
|
||||
|
||||
for (var/obj/item/weapon/reagent_containers/food/snacks/fortunecookie/being_cooked in .)
|
||||
paper.forceMove(being_cooked)
|
||||
being_cooked.trash = paper //so the paper is left behind as trash without special-snowflake(TM Nodrak) code ~carn
|
||||
return
|
||||
|
||||
|
||||
check_items(var/obj/container as obj)
|
||||
. = ..()
|
||||
if (.)
|
||||
var/obj/item/weapon/paper/paper = locate() in container
|
||||
if (!paper || !istype(paper))
|
||||
return 0
|
||||
if (!paper.info)
|
||||
return 0
|
||||
return .
|
||||
|
||||
/datum/recipe/poppypretzel
|
||||
appliance = OVEN
|
||||
fruit = list("poppy" = 1)
|
||||
items = list(/obj/item/weapon/reagent_containers/food/snacks/dough)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/poppypretzel
|
||||
result_quantity = 2
|
||||
|
||||
|
||||
/datum/recipe/cracker
|
||||
appliance = OVEN
|
||||
reagents = list("sodiumchloride" = 1)
|
||||
items = list(
|
||||
/obj/item/weapon/reagent_containers/food/snacks/doughslice
|
||||
)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/cracker
|
||||
|
||||
/datum/recipe/brownies
|
||||
appliance = OVEN
|
||||
reagents = list("browniemix" = 10, "egg" = 3)
|
||||
reagent_mix = RECIPE_REAGENT_REPLACE //No egg or mix in final recipe
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/sliceable/brownies
|
||||
|
||||
|
||||
/datum/recipe/cosmicbrownies
|
||||
appliance = OVEN
|
||||
reagents = list("browniemix" = 10, "egg" = 3)
|
||||
fruit = list("ambrosia" = 1)
|
||||
reagent_mix = RECIPE_REAGENT_REPLACE //No egg or mix in final recipe
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/sliceable/cosmicbrownies
|
||||
|
||||
|
||||
|
||||
|
||||
//Pizzas
|
||||
//=========================
|
||||
/datum/recipe/pizzamargherita
|
||||
appliance = OVEN
|
||||
fruit = list("tomato" = 1)
|
||||
items = list(
|
||||
/obj/item/weapon/reagent_containers/food/snacks/sliceable/flatdough,
|
||||
/obj/item/weapon/reagent_containers/food/snacks/cheesewedge,
|
||||
/obj/item/weapon/reagent_containers/food/snacks/cheesewedge,
|
||||
/obj/item/weapon/reagent_containers/food/snacks/cheesewedge,
|
||||
/obj/item/weapon/reagent_containers/food/snacks/cheesewedge
|
||||
)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/sliceable/pizza/margherita
|
||||
|
||||
/datum/recipe/meatpizza
|
||||
appliance = OVEN
|
||||
fruit = list("tomato" = 1)
|
||||
items = list(
|
||||
/obj/item/weapon/reagent_containers/food/snacks/sliceable/flatdough,
|
||||
/obj/item/weapon/reagent_containers/food/snacks/meat,
|
||||
/obj/item/weapon/reagent_containers/food/snacks/meat,
|
||||
/obj/item/weapon/reagent_containers/food/snacks/meat,
|
||||
/obj/item/weapon/reagent_containers/food/snacks/cheesewedge
|
||||
)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/sliceable/pizza/meatpizza
|
||||
|
||||
/datum/recipe/syntipizza
|
||||
appliance = OVEN
|
||||
fruit = list("tomato" = 1)
|
||||
items = list(
|
||||
/obj/item/weapon/reagent_containers/food/snacks/sliceable/flatdough,
|
||||
/obj/item/weapon/reagent_containers/food/snacks/meat/syntiflesh,
|
||||
/obj/item/weapon/reagent_containers/food/snacks/meat/syntiflesh,
|
||||
/obj/item/weapon/reagent_containers/food/snacks/meat/syntiflesh,
|
||||
/obj/item/weapon/reagent_containers/food/snacks/cheesewedge
|
||||
)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/sliceable/pizza/meatpizza
|
||||
|
||||
/datum/recipe/mushroompizza
|
||||
appliance = OVEN
|
||||
fruit = list("mushroom" = 5, "tomato" = 1)
|
||||
items = list(
|
||||
/obj/item/weapon/reagent_containers/food/snacks/sliceable/flatdough,
|
||||
/obj/item/weapon/reagent_containers/food/snacks/cheesewedge
|
||||
)
|
||||
|
||||
reagent_mix = RECIPE_REAGENT_REPLACE //No vomit taste in finished product from chanterelles
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/sliceable/pizza/mushroompizza
|
||||
|
||||
/datum/recipe/vegetablepizza
|
||||
appliance = OVEN
|
||||
fruit = list("eggplant" = 1, "carrot" = 1, "corn" = 1, "tomato" = 1)
|
||||
items = list(
|
||||
/obj/item/weapon/reagent_containers/food/snacks/sliceable/flatdough,
|
||||
/obj/item/weapon/reagent_containers/food/snacks/cheesewedge
|
||||
)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/sliceable/pizza/vegetablepizza
|
||||
|
||||
/datum/recipe/pineapplepizza
|
||||
appliance = OVEN
|
||||
fruit = list("tomato" = 1)
|
||||
items = list(
|
||||
/obj/item/weapon/reagent_containers/food/snacks/sliceable/flatdough,
|
||||
/obj/item/weapon/reagent_containers/food/snacks/cheesewedge,
|
||||
/obj/item/weapon/reagent_containers/food/snacks/pineapple_ring,
|
||||
/obj/item/weapon/reagent_containers/food/snacks/pineapple_ring
|
||||
)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/sliceable/pizza/pineapple
|
||||
|
||||
//Spicy
|
||||
//================
|
||||
/datum/recipe/enchiladas
|
||||
appliance = OVEN
|
||||
fruit = list("chili" = 2, "corn" = 1)
|
||||
items = list(/obj/item/weapon/reagent_containers/food/snacks/cutlet)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/enchiladas
|
||||
|
||||
/datum/recipe/monkeysdelight
|
||||
appliance = OVEN
|
||||
fruit = list("banana" = 1)
|
||||
reagents = list("sodiumchloride" = 1, "blackpepper" = 1, "flour" = 10)
|
||||
items = list(
|
||||
/obj/item/weapon/reagent_containers/food/snacks/monkeycube
|
||||
)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/monkeysdelight
|
||||
reagent_mix = RECIPE_REAGENT_REPLACE
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// Cakes.
|
||||
//============
|
||||
/datum/recipe/cake
|
||||
appliance = OVEN
|
||||
reagents = list("milk" = 5, "flour" = 15, "sugar" = 15, "egg" = 9)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/sliceable/plaincake
|
||||
reagent_mix = RECIPE_REAGENT_REPLACE
|
||||
|
||||
/datum/recipe/cake/carrot
|
||||
appliance = OVEN
|
||||
fruit = list("carrot" = 3)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/sliceable/carrotcake
|
||||
|
||||
/datum/recipe/cake/cheese
|
||||
appliance = OVEN
|
||||
items = list(
|
||||
/obj/item/weapon/reagent_containers/food/snacks/cheesewedge,
|
||||
/obj/item/weapon/reagent_containers/food/snacks/cheesewedge
|
||||
)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/sliceable/cheesecake
|
||||
|
||||
/datum/recipe/cake/orange
|
||||
appliance = OVEN
|
||||
fruit = list("orange" = 1)
|
||||
reagents = list("milk" = 5, "flour" = 15, "egg" = 9, "orangejuice" = 3, "sugar" = 5)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/sliceable/orangecake
|
||||
|
||||
/datum/recipe/cake/lime
|
||||
appliance = OVEN
|
||||
fruit = list("lime" = 1)
|
||||
reagents = list("milk" = 5, "flour" = 15, "egg" = 9, "limejuice" = 3, "sugar" = 5)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/sliceable/limecake
|
||||
|
||||
/datum/recipe/cake/lemon
|
||||
appliance = OVEN
|
||||
fruit = list("lemon" = 1)
|
||||
reagents = list("milk" = 5, "flour" = 15, "egg" = 9, "lemonjuice" = 3, "sugar" = 5)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/sliceable/lemoncake
|
||||
|
||||
/datum/recipe/cake/chocolate
|
||||
appliance = OVEN
|
||||
items = list(/obj/item/weapon/reagent_containers/food/snacks/chocolatebar)
|
||||
reagents = list("milk" = 5, "flour" = 15, "egg" = 9, "coco" = 4, "sugar" = 5)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/sliceable/chocolatecake
|
||||
|
||||
/datum/recipe/cake/birthday
|
||||
appliance = OVEN
|
||||
items = list(/obj/item/clothing/head/cakehat)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/sliceable/birthdaycake
|
||||
|
||||
/datum/recipe/cake/apple
|
||||
appliance = OVEN
|
||||
fruit = list("apple" = 2)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/sliceable/applecake
|
||||
|
||||
/datum/recipe/cake/brain
|
||||
appliance = OVEN
|
||||
items = list(/obj/item/organ/internal/brain)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/sliceable/braincake
|
||||
|
||||
/datum/recipe/pancakes
|
||||
appliance = OVEN
|
||||
fruit = list("blueberries" = 2)
|
||||
items = list(
|
||||
/obj/item/weapon/reagent_containers/food/snacks/sliceable/flatdough,
|
||||
/obj/item/weapon/reagent_containers/food/snacks/sliceable/flatdough
|
||||
)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/pancakes
|
||||
|
||||
/datum/recipe/lasagna
|
||||
appliance = OVEN
|
||||
fruit = list("tomato" = 2, "eggplant" = 1)
|
||||
items = list(
|
||||
/obj/item/weapon/reagent_containers/food/snacks/sliceable/flatdough,
|
||||
/obj/item/weapon/reagent_containers/food/snacks/sliceable/flatdough,
|
||||
/obj/item/weapon/reagent_containers/food/snacks/cutlet,
|
||||
/obj/item/weapon/reagent_containers/food/snacks/cutlet
|
||||
)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/lasagna
|
||||
reagent_mix = RECIPE_REAGENT_REPLACE
|
||||
|
||||
/datum/recipe/honeybun
|
||||
appliance = OVEN
|
||||
items = list(
|
||||
/obj/item/weapon/reagent_containers/food/snacks/dough
|
||||
)
|
||||
reagents = list("honey" = 5)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/honeybun
|
||||
|
||||
/datum/recipe/enchiladas_new
|
||||
appliance = OVEN
|
||||
fruit = list("chili" = 2)
|
||||
items = list(
|
||||
/obj/item/weapon/reagent_containers/food/snacks/cutlet,
|
||||
/obj/item/weapon/reagent_containers/food/snacks/tortilla
|
||||
)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/enchiladas
|
||||
|
||||
//Bacon
|
||||
/datum/recipe/bacon_oven
|
||||
appliance = OVEN
|
||||
items = list(
|
||||
/obj/item/weapon/reagent_containers/food/snacks/rawbacon,
|
||||
/obj/item/weapon/reagent_containers/food/snacks/rawbacon,
|
||||
/obj/item/weapon/reagent_containers/food/snacks/rawbacon,
|
||||
/obj/item/weapon/reagent_containers/food/snacks/rawbacon,
|
||||
/obj/item/weapon/reagent_containers/food/snacks/rawbacon,
|
||||
/obj/item/weapon/reagent_containers/food/snacks/rawbacon,
|
||||
/obj/item/weapon/reagent_containers/food/snacks/spreads
|
||||
)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/bacon/oven
|
||||
result_quantity = 6
|
||||
|
||||
/datum/recipe/meat_pocket
|
||||
appliance = OVEN
|
||||
items = list(
|
||||
/obj/item/weapon/reagent_containers/food/snacks/sliceable/flatdough,
|
||||
/obj/item/weapon/reagent_containers/food/snacks/meatball,
|
||||
/obj/item/weapon/reagent_containers/food/snacks/cheesewedge
|
||||
)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/meat_pocket
|
||||
result_quantity = 2
|
||||
|
||||
/datum/recipe/bacon_flatbread
|
||||
appliance = OVEN
|
||||
fruit = list("tomato" = 2)
|
||||
items = list(
|
||||
/obj/item/weapon/reagent_containers/food/snacks/sliceable/flatdough,
|
||||
/obj/item/weapon/reagent_containers/food/snacks/cheesewedge,
|
||||
/obj/item/weapon/reagent_containers/food/snacks/bacon,
|
||||
/obj/item/weapon/reagent_containers/food/snacks/bacon,
|
||||
/obj/item/weapon/reagent_containers/food/snacks/bacon,
|
||||
/obj/item/weapon/reagent_containers/food/snacks/bacon
|
||||
)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/bacon_flatbread
|
||||
|
||||
/datum/recipe/truffle
|
||||
appliance = OVEN
|
||||
reagents = list("sugar" = 5, "cream" = 5)
|
||||
items = list(
|
||||
/obj/item/weapon/reagent_containers/food/snacks/chocolatebar
|
||||
)
|
||||
reagent_mix = RECIPE_REAGENT_REPLACE
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/truffle
|
||||
result_quantity = 4
|
||||
|
||||
/datum/recipe/croissant
|
||||
appliance = OVEN
|
||||
reagents = list("sodiumchloride" = 1, "water" = 5, "milk" = 5)
|
||||
reagent_mix = RECIPE_REAGENT_REPLACE
|
||||
items = list(/obj/item/weapon/reagent_containers/food/snacks/dough)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/croissant
|
||||
|
||||
/datum/recipe/macncheese
|
||||
appliance = OVEN
|
||||
reagents = list("milk" = 5)
|
||||
reagent_mix = RECIPE_REAGENT_REPLACE
|
||||
items = list(
|
||||
/obj/item/weapon/reagent_containers/food/snacks/spagetti,
|
||||
/obj/item/weapon/reagent_containers/food/snacks/cheesewedge
|
||||
)
|
||||
result = /obj/item/weapon/reagent_containers/food/snacks/macncheese
|
||||
@@ -396,3 +396,61 @@
|
||||
|
||||
/atom/proc/create_reagents(var/max_vol)
|
||||
reagents = new/datum/reagents(max_vol, src)
|
||||
|
||||
// Aurora Cooking Port
|
||||
/datum/reagents/proc/get_reagent(var/id) // Returns reference to reagent matching passed ID
|
||||
for(var/datum/reagent/A in reagent_list)
|
||||
if (A.id == id)
|
||||
return A
|
||||
|
||||
return null
|
||||
|
||||
//Spreads the contents of this reagent holder all over the vicinity of the target turf.
|
||||
/datum/reagents/proc/splash_area(var/turf/epicentre, var/range = 3, var/portion = 1.0, var/multiplier = 1, var/copy = 0)
|
||||
var/list/things = dview(range, epicentre, INVISIBILITY_LIGHTING)
|
||||
var/list/turfs = list()
|
||||
for (var/turf/T in things)
|
||||
turfs += T
|
||||
if (!turfs.len)
|
||||
return//Nowhere to splash to, somehow
|
||||
//Create a temporary holder to hold all the amount that will be spread
|
||||
var/datum/reagents/R = new /datum/reagents(total_volume * portion * multiplier)
|
||||
trans_to_holder(R, total_volume * portion, multiplier, copy)
|
||||
//The exact amount that will be given to each turf
|
||||
var/turfportion = R.total_volume / turfs.len
|
||||
for (var/turf/T in turfs)
|
||||
var/datum/reagents/TR = new /datum/reagents(turfportion)
|
||||
R.trans_to_holder(TR, turfportion, 1, 0)
|
||||
TR.splash_turf(T)
|
||||
qdel(R)
|
||||
|
||||
|
||||
//Spreads the contents of this reagent holder all over the target turf, dividing among things in it.
|
||||
//50% is divided between mobs, 20% between objects, and whatever is left on the turf itself
|
||||
/datum/reagents/proc/splash_turf(var/turf/T, var/amount = null, var/multiplier = 1, var/copy = 0)
|
||||
if (isnull(amount))
|
||||
amount = total_volume
|
||||
else
|
||||
amount = min(amount, total_volume)
|
||||
if (amount <= 0)
|
||||
return
|
||||
var/list/mobs = list()
|
||||
for (var/mob/M in T)
|
||||
mobs += M
|
||||
var/list/objs = list()
|
||||
for (var/obj/O in T)
|
||||
objs += O
|
||||
if (objs.len)
|
||||
var/objportion = (amount * 0.2) / objs.len
|
||||
for (var/o in objs)
|
||||
var/obj/O = o
|
||||
trans_to(O, objportion, multiplier, copy)
|
||||
amount = min(amount, total_volume)
|
||||
if (mobs.len)
|
||||
var/mobportion = (amount * 0.5) / mobs.len
|
||||
for (var/m in mobs)
|
||||
var/mob/M = m
|
||||
trans_to(M, mobportion, multiplier, copy)
|
||||
trans_to(T, total_volume, multiplier, copy)
|
||||
if (total_volume <= 0)
|
||||
qdel(src)
|
||||
@@ -50,6 +50,172 @@
|
||||
M.adjust_nutrition(nutriment_factor * removed) // For hunger and fatness
|
||||
M.add_chemical_effect(CE_BLOODRESTORE, 4 * removed)
|
||||
|
||||
// Aurora Cooking Port Insertion Begin
|
||||
|
||||
/*
|
||||
Coatings are used in cooking. Dipping food items in a reagent container with a coating in it
|
||||
allows it to be covered in that, which will add a masked overlay to the sprite.
|
||||
Coatings have both a raw and a cooked image. Raw coating is generally unhealthy
|
||||
Generally coatings are intended for deep frying foods
|
||||
*/
|
||||
/datum/reagent/nutriment/coating
|
||||
nutriment_factor = 6 //Less dense than the food itself, but coatings still add extra calories
|
||||
var/messaged = 0
|
||||
var/icon_raw
|
||||
var/icon_cooked
|
||||
var/coated_adj = "coated"
|
||||
var/cooked_name = "coating"
|
||||
|
||||
/datum/reagent/nutriment/coating/affect_ingest(var/mob/living/carbon/M, var/alien, var/removed)
|
||||
|
||||
//We'll assume that the batter isnt going to be regurgitated and eaten by someone else. Only show this once
|
||||
if (data["cooked"] != 1)
|
||||
if (!messaged)
|
||||
M << "Ugh, this raw [name] tastes disgusting."
|
||||
nutriment_factor *= 0.5
|
||||
messaged = 1
|
||||
|
||||
//Raw coatings will sometimes cause vomiting
|
||||
if (prob(1))
|
||||
M.vomit()
|
||||
..()
|
||||
|
||||
/datum/reagent/nutriment/coating/initialize_data(var/newdata) // Called when the reagent is created.
|
||||
..()
|
||||
if (!data)
|
||||
data = list()
|
||||
else
|
||||
if (isnull(data["cooked"]))
|
||||
data["cooked"] = 0
|
||||
return
|
||||
data["cooked"] = 0
|
||||
if (holder && holder.my_atom && istype(holder.my_atom,/obj/item/weapon/reagent_containers/food/snacks))
|
||||
data["cooked"] = 1
|
||||
name = cooked_name
|
||||
|
||||
//Batter which is part of objects at compiletime spawns in a cooked state
|
||||
|
||||
|
||||
//Handles setting the temperature when oils are mixed
|
||||
/datum/reagent/nutriment/coating/mix_data(var/newdata, var/newamount)
|
||||
if (!data)
|
||||
data = list()
|
||||
|
||||
data["cooked"] = newdata["cooked"]
|
||||
|
||||
/datum/reagent/nutriment/coating/batter
|
||||
name = "batter mix"
|
||||
cooked_name = "batter"
|
||||
id = "batter"
|
||||
color = "#f5f4e9"
|
||||
reagent_state = LIQUID
|
||||
icon_raw = "batter_raw"
|
||||
icon_cooked = "batter_cooked"
|
||||
coated_adj = "battered"
|
||||
|
||||
/datum/reagent/nutriment/coating/beerbatter
|
||||
name = "beer batter mix"
|
||||
cooked_name = "beer batter"
|
||||
id = "beerbatter"
|
||||
color = "#f5f4e9"
|
||||
reagent_state = LIQUID
|
||||
icon_raw = "batter_raw"
|
||||
icon_cooked = "batter_cooked"
|
||||
coated_adj = "beer-battered"
|
||||
|
||||
/datum/reagent/nutriment/coating/beerbatter/affect_ingest(var/mob/living/carbon/M, var/alien, var/removed)
|
||||
..()
|
||||
M.add_chemical_effect(CE_ALCOHOL, 0.02) //Very slightly alcoholic
|
||||
|
||||
//=========================
|
||||
//Fats
|
||||
//=========================
|
||||
/datum/reagent/nutriment/triglyceride
|
||||
name = "triglyceride"
|
||||
id = "triglyceride"
|
||||
description = "More commonly known as fat, the third macronutrient, with over double the energy content of carbs and protein"
|
||||
|
||||
reagent_state = SOLID
|
||||
nutriment_factor = 27//The caloric ratio of carb/protein/fat is 4:4:9
|
||||
color = "#CCCCCC"
|
||||
|
||||
/datum/reagent/nutriment/triglyceride/oil
|
||||
//Having this base class incase we want to add more variants of oil
|
||||
name = "Oil"
|
||||
id = "oil"
|
||||
description = "Oils are liquid fats."
|
||||
reagent_state = LIQUID
|
||||
color = "#c79705"
|
||||
touch_met = 1.5
|
||||
var/lastburnmessage = 0
|
||||
|
||||
/datum/reagent/nutriment/triglyceride/oil/touch_turf(var/turf/simulated/T)
|
||||
if(!istype(T))
|
||||
return
|
||||
|
||||
if(volume >= 3)
|
||||
T.wet_floor(2)
|
||||
|
||||
/datum/reagent/nutriment/triglyceride/oil/initialize_data(var/newdata) // Called when the reagent is created.
|
||||
..()
|
||||
if (!data)
|
||||
data = list("temperature" = T20C)
|
||||
|
||||
//Handles setting the temperature when oils are mixed
|
||||
/datum/reagent/nutriment/triglyceride/oil/mix_data(var/newdata, var/newamount)
|
||||
|
||||
if (!data)
|
||||
data = list()
|
||||
|
||||
var/ouramount = volume - newamount
|
||||
if (ouramount <= 0 || !data["temperature"] || !volume)
|
||||
//If we get here, then this reagent has just been created, just copy the temperature exactly
|
||||
data["temperature"] = newdata["temperature"]
|
||||
|
||||
else
|
||||
//Our temperature is set to the mean of the two mixtures, taking volume into account
|
||||
var/total = (data["temperature"] * ouramount) + (newdata["temperature"] * newamount)
|
||||
data["temperature"] = total / volume
|
||||
|
||||
return ..()
|
||||
|
||||
|
||||
//Calculates a scaling factor for scalding damage, based on the temperature of the oil and creature's heat resistance
|
||||
/datum/reagent/nutriment/triglyceride/oil/proc/heatdamage(var/mob/living/carbon/M)
|
||||
var/threshold = 360//Human heatdamage threshold
|
||||
var/datum/species/S = M.get_species(1)
|
||||
if (S && istype(S))
|
||||
threshold = S.heat_level_1
|
||||
|
||||
//If temperature is too low to burn, return a factor of 0. no damage
|
||||
if (data["temperature"] < threshold)
|
||||
return 0
|
||||
|
||||
//Step = degrees above heat level 1 for 1.0 multiplier
|
||||
var/step = 60
|
||||
if (S && istype(S))
|
||||
step = (S.heat_level_2 - S.heat_level_1)*1.5
|
||||
|
||||
. = data["temperature"] - threshold
|
||||
. /= step
|
||||
. = min(., 2.5)//Cap multiplier at 2.5
|
||||
|
||||
/datum/reagent/nutriment/triglyceride/oil/affect_touch(var/mob/living/carbon/M, var/alien, var/removed)
|
||||
var/dfactor = heatdamage(M)
|
||||
if (dfactor)
|
||||
M.take_organ_damage(0, removed * 1.5 * dfactor)
|
||||
data["temperature"] -= (6 * removed) / (1 + volume*0.1)//Cools off as it burns you
|
||||
if (lastburnmessage+100 < world.time )
|
||||
M << span("danger", "Searing hot oil burns you, wash it off quick!")
|
||||
lastburnmessage = world.time
|
||||
|
||||
/datum/reagent/nutriment/triglyceride/oil/corn
|
||||
name = "Corn Oil"
|
||||
id = "cornoil"
|
||||
description = "An oil derived from various types of corn."
|
||||
|
||||
// Aurora Cooking Port Insertion End
|
||||
|
||||
/datum/reagent/nutriment/glucose
|
||||
name = "Glucose"
|
||||
id = "glucose"
|
||||
@@ -85,6 +251,24 @@
|
||||
return
|
||||
..()
|
||||
|
||||
/datum/reagent/nutriment/protein/tofu
|
||||
name = "tofu protein"
|
||||
id = "tofu"
|
||||
color = "#fdffa8"
|
||||
taste_description = "tofu"
|
||||
|
||||
/datum/reagent/nutriment/protein/seafood
|
||||
name = "seafood protein"
|
||||
id = "seafood"
|
||||
color = "#f5f4e9"
|
||||
taste_description = "fish"
|
||||
|
||||
/datum/reagent/nutriment/protein/cheese // Also bad for skrell.
|
||||
name = "cheese"
|
||||
id = "cheese"
|
||||
color = "#EDB91F"
|
||||
taste_description = "cheese"
|
||||
|
||||
/datum/reagent/nutriment/protein/egg // Also bad for skrell.
|
||||
name = "egg yolk"
|
||||
id = "egg"
|
||||
@@ -256,7 +440,7 @@
|
||||
reagent_state = LIQUID
|
||||
nutriment_factor = 1
|
||||
color = "#801E28"
|
||||
|
||||
/* TEMPORARY REMOVAL DUE TO AURORA COOKING PORT - WILL REVISIT LATER 7/16/2020
|
||||
/datum/reagent/nutriment/cornoil
|
||||
name = "Corn Oil"
|
||||
id = "cornoil"
|
||||
@@ -306,7 +490,7 @@
|
||||
|
||||
if(volume >= 5)
|
||||
T.wet_floor()
|
||||
|
||||
*/
|
||||
/datum/reagent/nutriment/peanutbutter
|
||||
name = "Peanut Butter"
|
||||
id = "peanutbutter"
|
||||
@@ -431,6 +615,22 @@
|
||||
color = "#365E30"
|
||||
overdose = REAGENTS_OVERDOSE
|
||||
|
||||
//SYNNONO MEME FOODS EXPANSION - Credit to Synnono
|
||||
|
||||
/datum/reagent/spacespice
|
||||
name = "Space Spice"
|
||||
id = "spacespice"
|
||||
description = "An exotic blend of spices for cooking. Definitely not worms."
|
||||
reagent_state = SOLID
|
||||
color = "#e08702"
|
||||
|
||||
/datum/reagent/browniemix
|
||||
name = "Brownie Mix"
|
||||
id = "browniemix"
|
||||
description = "A dry mix for making delicious brownies."
|
||||
reagent_state = SOLID
|
||||
color = "#441a03"
|
||||
|
||||
/datum/reagent/frostoil
|
||||
name = "Frost Oil"
|
||||
id = "frostoil"
|
||||
@@ -475,6 +675,12 @@
|
||||
/datum/reagent/capsaicin/affect_ingest(var/mob/living/carbon/M, var/alien, var/removed)
|
||||
if(alien == IS_DIONA)
|
||||
return
|
||||
if(alien == IS_ALRAUNE) // VOREStation Edit: It wouldn't affect plants that much.
|
||||
if(prob(5))
|
||||
M << "<span class='rose'>You feel a pleasant sensation in your mouth.</span>"
|
||||
to_chat(M, span("rose","You feel a pleasant sensation in your mouth."))
|
||||
M.bodytemperature += rand(10, 25)
|
||||
return
|
||||
if(ishuman(M))
|
||||
var/mob/living/carbon/human/H = M
|
||||
if(!H.can_feel_pain())
|
||||
|
||||
@@ -2619,3 +2619,52 @@
|
||||
required_reagents = list("radium" = 1, "spidertoxin" = 1, "sifsap" = 1)
|
||||
catalysts = list("sifsap" = 10)
|
||||
result_amount = 2
|
||||
|
||||
/*
|
||||
====================
|
||||
Aurora Food
|
||||
====================
|
||||
*/
|
||||
/datum/chemical_reaction/dough
|
||||
inhibitors = list("water" = 1, "beer" = 1) //To prevent it messing with batter recipes
|
||||
|
||||
/datum/chemical_reaction/coating/batter
|
||||
name = "Batter"
|
||||
id = "batter"
|
||||
result = "batter"
|
||||
required_reagents = list("egg" = 3, "flour" = 10, "water" = 5, "sodiumchloride" = 2)
|
||||
result_amount = 20
|
||||
|
||||
/datum/chemical_reaction/coating/beerbatter
|
||||
name = "Beer Batter"
|
||||
id = "beerbatter"
|
||||
result = "beerbatter"
|
||||
required_reagents = list("egg" = 3, "flour" = 10, "beer" = 5, "sodiumchloride" = 2)
|
||||
result_amount = 20
|
||||
|
||||
/datum/chemical_reaction/browniemix
|
||||
name = "Brownie Mix"
|
||||
id = "browniemix"
|
||||
result = "browniemix"
|
||||
required_reagents = list("flour" = 5, "coco" = 5, "sugar" = 5)
|
||||
result_amount = 15
|
||||
|
||||
/datum/chemical_reaction/butter
|
||||
name = "Butter"
|
||||
id = "butter"
|
||||
result = null
|
||||
required_reagents = list("cream" = 20, "sodiumchloride" = 1)
|
||||
result_amount = 1
|
||||
|
||||
/datum/chemical_reaction/butter/on_reaction(var/datum/reagents/holder, var/created_volume)
|
||||
var/location = get_turf(holder.my_atom)
|
||||
for(var/i = 1, i <= created_volume, i++)
|
||||
new /obj/item/weapon/reagent_containers/food/snacks/spreads/butter(location)
|
||||
return
|
||||
|
||||
/datum/chemical_reaction/browniemix
|
||||
name = "Brownie Mix"
|
||||
id = "browniemix"
|
||||
result = "browniemix"
|
||||
required_reagents = list("flour" = 5, "coco" = 5, "sugar" = 5)
|
||||
result_amount = 15
|
||||
@@ -413,3 +413,27 @@
|
||||
/obj/structure/reagent_dispensers/acid/Initialize()
|
||||
. = ..()
|
||||
reagents.add_reagent("sacid", 1000)
|
||||
|
||||
//Cooking oil refill tank
|
||||
/obj/structure/reagent_dispensers/cookingoil
|
||||
name = "cooking oil tank"
|
||||
desc = "A fifty-litre tank of commercial-grade corn oil, intended for use in large scale deep fryers. Store in a cool, dark place"
|
||||
icon = 'icons/obj/objects.dmi'
|
||||
icon_state = "oiltank"
|
||||
amount_per_transfer_from_this = 120
|
||||
|
||||
/obj/structure/reagent_dispensers/cookingoil/New()
|
||||
..()
|
||||
reagents.add_reagent("cornoil",5000)
|
||||
|
||||
/obj/structure/reagent_dispensers/cookingoil/bullet_act(var/obj/item/projectile/Proj)
|
||||
if(Proj.get_structure_damage())
|
||||
explode()
|
||||
|
||||
/obj/structure/reagent_dispensers/cookingoil/ex_act()
|
||||
explode()
|
||||
|
||||
/obj/structure/reagent_dispensers/cookingoil/proc/explode()
|
||||
reagents.splash_area(get_turf(src), 3)
|
||||
visible_message(span("danger", "The [src] bursts open, spreading oil all over the area."))
|
||||
qdel(src)
|
||||
|
||||
BIN
sound/machines/hatch_open.ogg
Normal file
BIN
sound/machines/hatch_open.ogg
Normal file
Binary file not shown.
@@ -299,7 +299,6 @@
|
||||
#include "code\datums\organs.dm"
|
||||
#include "code\datums\position_point_vector.dm"
|
||||
#include "code\datums\progressbar.dm"
|
||||
#include "code\datums\recipe.dm"
|
||||
#include "code\datums\riding.dm"
|
||||
#include "code\datums\soul_link.dm"
|
||||
#include "code\datums\sun.dm"
|
||||
@@ -2063,9 +2062,12 @@
|
||||
#include "code\modules\flufftext\look_up.dm"
|
||||
#include "code\modules\flufftext\TextFilters.dm"
|
||||
#include "code\modules\food\food.dm"
|
||||
#include "code\modules\food\recipe.dm"
|
||||
#include "code\modules\food\recipe_dump.dm"
|
||||
#include "code\modules\food\recipes_fryer.dm"
|
||||
#include "code\modules\food\recipes_microwave.dm"
|
||||
#include "code\modules\food\recipes_microwave_vr.dm"
|
||||
#include "code\modules\food\recipes_oven.dm"
|
||||
#include "code\modules\food\drinkingglass\drinkingglass.dm"
|
||||
#include "code\modules\food\drinkingglass\extras.dm"
|
||||
#include "code\modules\food\drinkingglass\glass_boxes.dm"
|
||||
|
||||
Reference in New Issue
Block a user