diff --git a/code/__DEFINES/admin.dm b/code/__DEFINES/admin.dm index 054a8e36eb..6a0cd3b8ee 100644 --- a/code/__DEFINES/admin.dm +++ b/code/__DEFINES/admin.dm @@ -75,6 +75,7 @@ #define ADMIN_PUNISHMENT_PIE "Cream Pie" #define ADMIN_PUNISHMENT_CUSTOM_PIE "Custom Cream Pie" #define ADMIN_PUNISHMENT_PICKLE "Pickle-ify" +#define ADMIN_PUNISHMENT_FRY "Fry" #define AHELP_ACTIVE 1 #define AHELP_CLOSED 2 diff --git a/code/__DEFINES/is_helpers.dm b/code/__DEFINES/is_helpers.dm index 90c7c34f8d..a9d9bda00c 100644 --- a/code/__DEFINES/is_helpers.dm +++ b/code/__DEFINES/is_helpers.dm @@ -216,7 +216,7 @@ GLOBAL_LIST_INIT(pointed_types, typecacheof(list( #define isgun(A) (istype(A, /obj/item/gun)) -#define isfood(A) (istype(A, /obj/item/reagent_containers/food)) +#define isfood(A) (istype(A, /obj/item/reagent_containers/food/snacks)) //Assemblies #define isassembly(O) (istype(O, /obj/item/assembly)) diff --git a/code/__HELPERS/unsorted.dm b/code/__HELPERS/unsorted.dm index cbe004ed90..4addae3ac4 100644 --- a/code/__HELPERS/unsorted.dm +++ b/code/__HELPERS/unsorted.dm @@ -1437,7 +1437,6 @@ GLOBAL_DATUM_INIT(dview_mob, /mob/dview, new) /obj/item/reagent_containers/food/snacks/grown, /obj/item/reagent_containers/food/snacks/grown/mushroom, /obj/item/reagent_containers/food/snacks/grown/nettle, // base type - /obj/item/reagent_containers/food/snacks/deepfryholder, /obj/item/reagent_containers/food/snacks/grown/shell, /obj/item/reagent_containers/food/snacks/clothing, /obj/item/reagent_containers/food/snacks/store/bread diff --git a/code/datums/components/edible.dm b/code/datums/components/edible.dm index 47e60a1ee1..dc2e490fe4 100644 --- a/code/datums/components/edible.dm +++ b/code/datums/components/edible.dm @@ -51,7 +51,8 @@ Behavior that's still missing from this component that original food items had t var/atom/owner = parent - owner.create_reagents(volume, INJECTABLE) + if(!owner.reagents) //we don't want to override what's in the item if it possibly contains reagents already + owner.create_reagents(volume, INJECTABLE) if(initial_reagents) for(var/rid in initial_reagents) diff --git a/code/datums/components/fried.dm b/code/datums/components/fried.dm new file mode 100644 index 0000000000..4e21962778 --- /dev/null +++ b/code/datums/components/fried.dm @@ -0,0 +1,107 @@ +/*! + This component essentially encapsulates frying and utilizes the edible component + This means fried items can work like regular ones, and generally the code is far less messy +*/ +/datum/component/fried + var/fry_power //how powerfully was this item fried + var/atom/owner //the atom it is owned by + var/stored_name //name of the owner when the component was first added + var/frying_examine_text = "the coders messed frying code up, report this!" + +/datum/component/fried/Initialize(frying_power) + if(!isatom(parent)) + return COMPONENT_INCOMPATIBLE + + RegisterSignal(parent, COMSIG_PARENT_EXAMINE, .proc/examine) + RegisterSignal(parent, COMSIG_COMPONENT_CLEAN_ACT, .proc/restore) //basically, unfry people who are being cleaned (badmemes fried someone) + + fry_power = frying_power + owner = parent + stored_name = owner.name + + setup_fried_item() + +//some stuff to do with the contents of fried junk +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 = 1, +/datum/reagent/toxin = 1, +/datum/reagent/lithium = 1, +/datum/reagent/mercury = 1, +)) + +/datum/component/fried/proc/examine(datum/source, mob/user, list/examine_list) + examine_list += "[parent] has been [frying_examine_text]" + +/datum/component/fried/proc/setup_fried_item() //sets the name, colour and examine text and edibility up + //first we do some checks depending on the type of item being fried + var/list/fried_tastes = list("crispy") + var/fried_foodtypes = FRIED + var/fried_junk = FALSE + + if(!isfood(owner) && GLOB.frying_hardmode && GLOB.frying_bad_chems.len && !owner.reagents) //you fried some junk, it's not gonna taste great + fried_junk = TRUE + fried_foodtypes |= TOXIC // junk tastes toxic too + else + if(isfood(owner)) + var/obj/item/reagent_containers/food/snacks/food_item = owner + fried_tastes += food_item.tastes + fried_foodtypes |= food_item.foodtype + + var/fried_eat_time = 0 + if(isturf(owner)) + fried_eat_time = 30 //we want turfs to be eaten slowly + + var/colour_priority = FIXED_COLOUR_PRIORITY + if(ismob(owner)) + colour_priority = WASHABLE_COLOUR_PRIORITY //badmins fried someone and we want to let them wash the fry colour off + //lets heavily hint at how to undo their frying + to_chat(owner, "You've been coated in hot cooking oil! You should probably go wash it off at the showers.") + else + owner.AddComponent(/datum/component/edible, foodtypes = fried_tastes, tastes = fried_tastes, eat_time = fried_eat_time) //we don't want mobs to get the edible component + + switch(fry_power) + if(0 to 15) + owner.name = "lightly fried [owner.name]" + owner.add_atom_colour(rgb(166,103,54), colour_priority) + frying_examine_text = "lightly fried" + if(16 to 49) + owner.name = "fried [owner.name]" + owner.add_atom_colour(rgb(103,63,24), colour_priority) + frying_examine_text = "moderately fried" + if(50 to 59) + owner.name = "deep fried [owner.name]" + owner.add_atom_colour(rgb(63,23,4), colour_priority) + frying_examine_text = "deeply fried" + else + owner.name = "the physical manifestation of fried foods" + owner.add_atom_colour(rgb(33,19,9), colour_priority) + frying_examine_text = "incomprehensibly fried to a crisp" + + //adding the edible component gives it reagents meaning we can now add the bad frying reagents if it's junk + if(fried_junk && owner.reagents) //check again just incase + var/R = rand(1, GLOB.frying_bad_chems.len) + var/bad_chem = GLOB.frying_bad_chems[R] + var/bad_chem_amount = max(4,GLOB.frying_bad_chems[bad_chem] * (fry_power/12.5)) //4u of bad chem reached when deeply fried + owner.reagents.add_reagent(bad_chem, bad_chem_amount) + +/datum/component/fried/proc/restore_name() //restore somethings name + //we do string manipulation and not restoring their name to real_name because some things hide your real_name and we want to maintain that + if(copytext(owner.name,1,14) == "lightly fried ") + owner.name = copytext(owner.name,15) + else + if(copytext(owner.name,1,6) == "fried ") + owner.name = copytext(owner.name,7) + else + if(copytext(owner.name,1,11) == "deep fried ") + owner.name = copytext(owner.name, 12) + else + if(owner.name == "the physical manifestation of fried foods") //if the name is still this, their name hasn't changed, so we can safely restore their stored name + owner.name = stored_name + +/datum/component/fried/proc/restore() //restore a fried mob to being not-fried + if(ismob(owner)) + //restore the name, the colour should wash off itself, and then remove the component + restore_name() + RemoveComponent() diff --git a/code/modules/admin/verbs/randomverbs.dm b/code/modules/admin/verbs/randomverbs.dm index 9b36fd7a2a..5027e8fe51 100644 --- a/code/modules/admin/verbs/randomverbs.dm +++ b/code/modules/admin/verbs/randomverbs.dm @@ -1269,7 +1269,19 @@ GLOBAL_LIST_EMPTY(custom_outfits) //Admin created outfits if(!check_rights(R_ADMIN) || !check_rights(R_FUN)) return - var/list/punishment_list = list(ADMIN_PUNISHMENT_PIE, ADMIN_PUNISHMENT_CUSTOM_PIE, ADMIN_PUNISHMENT_FIREBALL, ADMIN_PUNISHMENT_LIGHTNING, ADMIN_PUNISHMENT_BRAINDAMAGE, ADMIN_PUNISHMENT_BSA, ADMIN_PUNISHMENT_GIB, ADMIN_PUNISHMENT_SUPPLYPOD_QUICK, ADMIN_PUNISHMENT_SUPPLYPOD, ADMIN_PUNISHMENT_MAZING, ADMIN_PUNISHMENT_ROD, ADMIN_PUNISHMENT_PICKLE) + var/list/punishment_list = list(ADMIN_PUNISHMENT_PIE, + ADMIN_PUNISHMENT_CUSTOM_PIE, + ADMIN_PUNISHMENT_FIREBALL, + ADMIN_PUNISHMENT_LIGHTNING, + ADMIN_PUNISHMENT_BRAINDAMAGE, + ADMIN_PUNISHMENT_BSA, + ADMIN_PUNISHMENT_GIB, + ADMIN_PUNISHMENT_SUPPLYPOD_QUICK, + ADMIN_PUNISHMENT_SUPPLYPOD, + ADMIN_PUNISHMENT_MAZING, + ADMIN_PUNISHMENT_ROD, + ADMIN_PUNISHMENT_PICKLE, + ADMIN_PUNISHMENT_FRY) var/punishment = input("Choose a punishment", "DIVINE SMITING") as null|anything in punishment_list @@ -1349,6 +1361,8 @@ GLOBAL_LIST_EMPTY(custom_outfits) //Admin created outfits A.splat(target) if(ADMIN_PUNISHMENT_PICKLE) target.turn_into_pickle() + if(ADMIN_PUNISHMENT_FRY) + target.fry() punish_log(target, punishment) diff --git a/code/modules/food_and_drinks/food/snacks.dm b/code/modules/food_and_drinks/food/snacks.dm index de264ff0e4..adb8e47c94 100644 --- a/code/modules/food_and_drinks/food/snacks.dm +++ b/code/modules/food_and_drinks/food/snacks.dm @@ -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,13 @@ 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 + //don't fry reagent containers that aren't food items, indestructable items, or items that are already fried + if(isitem(src)) + var/obj/item/fried_item = src + if(fried_item.resistance_flags & INDESTRUCTIBLE) + return + if(!GetComponent(/datum/component/fried) && (!reagents || isfood(src) || ismob(src))) + AddComponent(/datum/component/fried, frying_power = cook_time) diff --git a/code/modules/food_and_drinks/food/snacks_bread.dm b/code/modules/food_and_drinks/food/snacks_bread.dm index f3d84f7169..0d7c715654 100644 --- a/code/modules/food_and_drinks/food/snacks_bread.dm +++ b/code/modules/food_and_drinks/food/snacks_bread.dm @@ -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." diff --git a/code/modules/food_and_drinks/kitchen_machinery/deep_fryer.dm b/code/modules/food_and_drinks/kitchen_machinery/deep_fryer.dm index d05f0b334f..f3c63c1ba2 100644 --- a/code/modules/food_and_drinks/kitchen_machinery/deep_fryer.dm +++ b/code/modules/food_and_drinks/kitchen_machinery/deep_fryer.dm @@ -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,25 +91,21 @@ God bless America. if(I.resistance_flags & INDESTRUCTIBLE) to_chat(user, "You don't feel it would be wise to fry [I]...") return - if(istype(I, /obj/item/reagent_containers/food/snacks/deepfryholder)) + if(I.GetComponent(/datum/component/fried)) to_chat(user, "Your cooking skills are not up to the legendary Doublefry technique.") return if(default_unfasten_wrench(user, I)) return else if(default_deconstruction_screwdriver(user, "fryer_off", "fryer_off" ,I)) //where's the open maint panel icon?! return + else if(I.reagents && !isfood(I)) + return else 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, "You put [I] into [src].") - 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() diff --git a/code/modules/reagents/chemistry/reagents/food_reagents.dm b/code/modules/reagents/chemistry/reagents/food_reagents.dm index f80cd10792..d449fa310c 100644 --- a/code/modules/reagents/chemistry/reagents/food_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/food_reagents.dm @@ -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 || isfood(O))) //don't fry stuff we shouldn't O.loc.visible_message("[O] rapidly fries as it's splashed with hot oil! Somehow.") - 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)) @@ -141,10 +141,9 @@ /datum/reagent/consumable/cooking_oil/reaction_turf(turf/open/T, reac_volume) if(!istype(T) || isgroundlessturf(T)) return - if(reac_volume >= 5) + if(reac_volume >= 5 && holder && holder.chem_temp >= fry_temperature) T.MakeSlippery(TURF_WET_LUBE, min_wet_time = 10 SECONDS, wet_time_to_add = reac_volume * 1.5 SECONDS) - T.name = "deep-fried [initial(T.name)]" - T.add_atom_colour(color, TEMPORARY_COLOUR_PRIORITY) + T.fry(reac_volume/4) /datum/reagent/consumable/sugar name = "Sugar" diff --git a/code/modules/reagents/chemistry/reagents/toxin_reagents.dm b/code/modules/reagents/chemistry/reagents/toxin_reagents.dm index 02e4a89e1d..c7add16fcf 100644 --- a/code/modules/reagents/chemistry/reagents/toxin_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/toxin_reagents.dm @@ -520,25 +520,6 @@ taste_description = "bad cooking" value = REAGENT_VALUE_NONE -/datum/reagent/toxin/condensed_cooking_oil - name = "Condensed Cooking Oil" - description = "Taste the consequences of your mistakes." - reagent_state = LIQUID - color = "#d6d6d8" - metabolization_rate = 0.25 * REAGENTS_METABOLISM - toxpwr = 0 - taste_mult = -2 - taste_description = "awful cooking" - value = REAGENT_VALUE_NONE - -/datum/reagent/toxin/condensed_cooking_oil/on_mob_life(mob/living/carbon/M) - if(prob(5)) - M.vomit() - else - if(prob(40)) - M.adjustOrganLoss(ORGAN_SLOT_HEART, 0.5) //For reference, bungotoxin does 3 - ..() - /datum/reagent/toxin/itching_powder name = "Itching Powder" description = "A powder that induces itching upon contact with the skin. Causes the victim to scratch at their itches and has a very low chance to decay into Histamine." diff --git a/code/modules/reagents/chemistry/recipes/slime_extracts.dm b/code/modules/reagents/chemistry/recipes/slime_extracts.dm index ead47e2a42..2c3f25e73a 100644 --- a/code/modules/reagents/chemistry/recipes/slime_extracts.dm +++ b/code/modules/reagents/chemistry/recipes/slime_extracts.dm @@ -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)) diff --git a/tgstation.dme b/tgstation.dme index 9314992c5f..2c5d30e2b7 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -415,6 +415,7 @@ #include "code\datums\components\explodable.dm" #include "code\datums\components\field_of_vision.dm" #include "code\datums\components\footstep.dm" +#include "code\datums\components\fried.dm" #include "code\datums\components\identification.dm" #include "code\datums\components\igniter.dm" #include "code\datums\components\infective.dm"