Second Half of Aurora Cooking Initial Port - All files added

Now onto the bugfixing nightmares!
This commit is contained in:
Rykka
2020-07-16 00:37:22 -04:00
parent 940aaec9c8
commit 9f935ff59d
20 changed files with 2569 additions and 448 deletions

View File

@@ -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)

View File

@@ -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"
@@ -430,6 +614,22 @@
reagent_state = LIQUID
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"
@@ -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())

View File

@@ -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

View File

@@ -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)