fry everything

This commit is contained in:
timothyteakettle
2020-07-20 00:40:18 +01:00
parent b47872c079
commit 8709a72fc0
10 changed files with 107 additions and 108 deletions
+6 -1
View File
@@ -21,7 +21,7 @@ Food formatting and crafting examples.
icon_state = "saltychip" //Refers to an icon, usually in food.dmi
bitesize = 3 //How many reagents are consumed in each bite.
list_reagents = list(/datum/reagent/consumable/nutriment = 6, //What's inside the snack, but only if spawned. For example, from a chemical reaction, vendor, or slime core spawn.
/datum/reagent/consumable/nutriment/vitamin = 2)
/datum/reagent/consumable/nutriment/vitamin = 2)
bonus_reagents = list(/datum/reagent/consumable/nutriment = 1, //What's -added- to the food, in addition to the reagents contained inside the foods used to craft it. Basically, a reward for cooking.
/datum/reagent/consumable/nutriment/vitamin = 1) ^^For example. Egg+Egg = 2Egg + Bonus Reagents.
filling_color = "#F4A460" //What color it will use if put in a custom food.
@@ -406,3 +406,8 @@ All foods are distributed among various categories. Use common sense.
TB.MouseDrop(over)
else
return ..()
// //////////////////////////////////////////////Frying////////////////////////////////////////
/atom/proc/fry(cook_time = 30) //you can truly fry anything
if(!GetComponent(/datum/component/fried))
AddComponent(/datum/component/fried, frying_power = cook_time)
@@ -191,93 +191,6 @@
tastes = list("bread" = 1, "garlic" = 1, "butter" = 1)
foodtype = GRAIN
/obj/item/reagent_containers/food/snacks/deepfryholder
name = "Deep Fried Foods Holder Obj"
desc = "If you can see this description the code for the deep fryer fucked up."
icon = 'icons/obj/food/food.dmi'
icon_state = ""
bitesize = 2
var/fried_garbage = FALSE //did you really fry a fire extinguisher?
GLOBAL_VAR_INIT(frying_hardmode, TRUE)
GLOBAL_VAR_INIT(frying_bad_chem_add_volume, TRUE)
GLOBAL_LIST_INIT(frying_bad_chems, list(
/datum/reagent/toxin/bad_food = 3,
/datum/reagent/drug/aranesp = 2,
/datum/reagent/toxin = 2,
/datum/reagent/lithium = 2,
/datum/reagent/mercury = 2,
))
/obj/item/reagent_containers/food/snacks/deepfryholder/Initialize(mapload, obj/item/fried)
. = ..()
name = fried.name //We'll determine the other stuff when it's actually removed
appearance = fried.appearance
layer = initial(layer)
plane = initial(plane)
lefthand_file = fried.lefthand_file
righthand_file = fried.righthand_file
item_state = fried.item_state
desc = fried.desc
w_class = fried.w_class
slowdown = fried.slowdown
equip_delay_self = fried.equip_delay_self
equip_delay_other = fried.equip_delay_other
strip_delay = fried.strip_delay
species_exception = fried.species_exception
item_flags = fried.item_flags
obj_flags = fried.obj_flags
if(isfood(fried))
fried.reagents.trans_to(src, fried.reagents.total_volume)
qdel(fried)
else
fried.forceMove(src)
trash = fried
fried_garbage = TRUE
/obj/item/reagent_containers/food/snacks/deepfryholder/Destroy()
if(trash)
QDEL_NULL(trash)
. = ..()
/obj/item/reagent_containers/food/snacks/deepfryholder/On_Consume(mob/living/eater)
if(fried_garbage && GLOB.frying_hardmode && GLOB.frying_bad_chems.len)
var/R = rand(1, GLOB.frying_bad_chems.len)
var/bad_chem = GLOB.frying_bad_chems[R]
var/bad_chem_amount = GLOB.frying_bad_chems[bad_chem]
eater.reagents.add_reagent(bad_chem, bad_chem_amount)
//All fried inedible items also get condensed cooking oil added, which induces minor vomiting and heart damage
eater.reagents.add_reagent(/datum/reagent/toxin/condensed_cooking_oil, 2)
if(trash)
QDEL_NULL(trash)
..()
/obj/item/reagent_containers/food/snacks/deepfryholder/proc/fry(cook_time = 30)
switch(cook_time)
if(0 to 15)
add_atom_colour(rgb(166,103,54), FIXED_COLOUR_PRIORITY)
name = "lightly-fried [name]"
desc = "[desc] It's been lightly fried in a deep fryer."
adjust_food_quality(food_quality - 5)
if(16 to 49)
add_atom_colour(rgb(103,63,24), FIXED_COLOUR_PRIORITY)
name = "fried [name]"
desc = "[desc] It's been fried, increasing its tastiness value by [rand(1, 75)]%."
adjust_food_quality(food_quality - 10)
if(50 to 59)
add_atom_colour(rgb(63,23,4), FIXED_COLOUR_PRIORITY)
name = "deep-fried [name]"
desc = "[desc] Deep-fried to perfection."
adjust_food_quality(food_quality) //we shouldn't punish perfection in the fried arts
if(60 to INFINITY)
add_atom_colour(rgb(33,19,9), FIXED_COLOUR_PRIORITY)
name = "the physical manifestation of the very concept of fried foods"
desc = "A heavily-fried...something. Who can tell anymore?"
adjust_food_quality(0) //good job, you're truly the best cook.
filling_color = color
foodtype |= FRIED
/obj/item/reagent_containers/food/snacks/butteredtoast
name = "buttered toast"
desc = "Butter lightly spread over a piece of toast."
@@ -29,7 +29,7 @@ God bless America.
use_power = IDLE_POWER_USE
idle_power_usage = 5
layer = BELOW_OBJ_LAYER
var/obj/item/reagent_containers/food/snacks/deepfryholder/frying //What's being fried RIGHT NOW?
var/obj/item/frying //What's being fried RIGHT NOW?
var/cook_time = 0
var/oil_use = 0.05 //How much cooking oil is used per tick
var/fry_speed = 1 //How quickly we fry food
@@ -91,7 +91,7 @@ God bless America.
if(I.resistance_flags & INDESTRUCTIBLE)
to_chat(user, "<span class='warning'>You don't feel it would be wise to fry [I]...</span>")
return
if(istype(I, /obj/item/reagent_containers/food/snacks/deepfryholder))
if(I.GetComponent(/datum/component/fried))
to_chat(user, "<span class='userdanger'>Your cooking skills are not up to the legendary Doublefry technique.</span>")
return
if(default_unfasten_wrench(user, I))
@@ -102,14 +102,8 @@ God bless America.
if(is_type_in_typecache(I, deepfry_blacklisted_items) || HAS_TRAIT(I, TRAIT_NODROP) || (I.item_flags & (ABSTRACT | DROPDEL)))
return ..()
else if(!frying && user.transferItemToLoc(I, src))
frying = I
to_chat(user, "<span class='notice'>You put [I] into [src].</span>")
frying = new/obj/item/reagent_containers/food/snacks/deepfryholder(src, I)
//setup food quality for item depending on if it's edible or not
if(isfood(I))
var/obj/item/reagent_containers/food/original_food = I
frying.adjust_food_quality(original_food.food_quality) //food quality remains unchanged until degree of frying is calculated
else
frying.adjust_food_quality(10) //inedible fried item has low quality
icon_state = "fryer_on"
fry_loop.start()
@@ -115,11 +115,11 @@
/datum/reagent/consumable/cooking_oil/reaction_obj(obj/O, reac_volume)
if(holder && holder.chem_temp >= fry_temperature)
if(isitem(O) && !istype(O, /obj/item/reagent_containers/food/snacks/deepfryholder) && !(O.resistance_flags & (FIRE_PROOF|INDESTRUCTIBLE)))
if(isitem(O) && !O.GetComponent(/datum/component/fried) && !(O.resistance_flags & (FIRE_PROOF|INDESTRUCTIBLE)) && !O.reagents) //don't fry stuff we shouldn't
O.loc.visible_message("<span class='warning'>[O] rapidly fries as it's splashed with hot oil! Somehow.</span>")
var/obj/item/reagent_containers/food/snacks/deepfryholder/F = new(O.drop_location(), O)
F.fry(volume)
F.reagents.add_reagent(/datum/reagent/consumable/cooking_oil, reac_volume)
O.fry(volume)
if(O.reagents)
O.reagents.add_reagent(/datum/reagent/consumable/cooking_oil, reac_volume)
/datum/reagent/consumable/cooking_oil/reaction_mob(mob/living/M, method = TOUCH, reac_volume, show_message = 1, touch_protection = 0)
if(!istype(M))
@@ -165,10 +165,7 @@
var/chosen = getbork()
var/obj/B = new chosen(T)
if(prob(5))//Fry it!
var/obj/item/reagent_containers/food/snacks/deepfryholder/fried
fried = new(T, B)
fried.fry() // actually set the name and colour it
B = fried
B.fry() // actually set the name and colour it
if(prob(50))
for(var/j in 1 to rand(1, 3))
step(B, pick(NORTH,SOUTH,EAST,WEST))