Processable and grillables and microwavables now give helpful examines, some condiment containers also do (#57694)

* IM DONE LOOKING AT THE WIKI FOR BASIC SNIZZLE

* microwaved, too

* HOOH

* LINT, review

* review but this time im not lying :trollface:

* maybe i should just like test or something

* reviews i missed

* 🐑
This commit is contained in:
tralezab
2021-04-03 00:51:12 -04:00
committed by GitHub
parent 9339319023
commit 9338775bea
5 changed files with 104 additions and 3 deletions
+48
View File
@@ -227,3 +227,51 @@ GLOBAL_DATUM(syndicate_code_response_regex, /regex)
/proc/odd_organ_name()
return "[pick(GLOB.gross_adjectives)], [pick(GLOB.gross_adjectives)] organ"
/**
* returns an ic name of the tool needed
* Arguments:
* * tool_behaviour: the tool described!
*/
/proc/tool_behaviour_name(tool_behaviour)
switch(tool_behaviour)
if(TOOL_CROWBAR)
return "a crowbar"
if(TOOL_MULTITOOL)
return "a multitool"
if(TOOL_SCREWDRIVER)
return "a screwdriver"
if(TOOL_WIRECUTTER)
return "a pair of wirecutters"
if(TOOL_WRENCH)
return "a wrench"
if(TOOL_WELDER)
return "a welder"
if(TOOL_ANALYZER)
return "an analyzer tool"
if(TOOL_MINING)
return "a mining implement"
if(TOOL_SHOVEL)
return "a digging tool"
if(TOOL_RETRACTOR)
return "a retractor"
if(TOOL_HEMOSTAT)
return "something to clamp bleeding"
if(TOOL_CAUTERY)
return "a cautery"
if(TOOL_DRILL)
return "a drilling tool"
if(TOOL_SCALPEL)
return "a fine cutting tool"
if(TOOL_SAW)
return "a saw"
if(TOOL_BONESET)
return "a bone setter"
if(TOOL_KNIFE)
return "a cutting tool"
if(TOOL_BLOODFILTER)
return "a blood filter"
if(TOOL_ROLLINGPIN)
return "a rolling pin"
else
return "something... but the gods didn't set this up right (Please report this bug)"
+4 -1
View File
@@ -43,7 +43,7 @@ Behavior that's still missing from this component that original food items had t
///The flavortext for taste (haha get it flavor text)
var/list/tastes
///The type of atom this creates when the object is microwaved.
var/microwaved_type
var/atom/microwaved_type
/datum/component/edible/Initialize(list/initial_reagents,
food_flags = NONE,
@@ -139,6 +139,9 @@ Behavior that's still missing from this component that original food items had t
/datum/component/edible/proc/examine(datum/source, mob/user, list/examine_list)
SIGNAL_HANDLER
if(microwaved_type)
examine_list += "[parent] could be <b>microwaved</b> into [initial(microwaved_type.name)]!"
if(!(food_flags & FOOD_IN_CONTAINER))
switch (bitecount)
if (0)
+3
View File
@@ -81,7 +81,10 @@
///Ran when an object almost finishes grilling
/datum/component/grillable/proc/OnExamine(atom/A, mob/user, list/examine_list)
SIGNAL_HANDLER
if(!current_cook_time) //Not grilled yet
if(positive_result)
examine_list += "<span class='notice'>[parent] can be <b>grilled</b> into \a [initial(cook_result.name)].</span>"
return
if(positive_result)
+12 -2
View File
@@ -3,7 +3,7 @@
element_flags = ELEMENT_BESPOKE
id_arg_index = 2
///The type of atom this creates when the processing recipe is used.
var/result_atom_type
var/atom/result_atom_type
///The tool behaviour for this processing recipe
var/tool_behaviour
///Time to process the atom
@@ -22,13 +22,23 @@
src.result_atom_type = result_atom_type
RegisterSignal(target, COMSIG_ATOM_TOOL_ACT(tool_behaviour), .proc/try_process)
RegisterSignal(target, COMSIG_PARENT_EXAMINE, .proc/OnExamine)
/datum/element/processable/Detach(datum/target)
. = ..()
UnregisterSignal(target, COMSIG_ATOM_TOOL_ACT(tool_behaviour))
UnregisterSignal(target, list(COMSIG_ATOM_TOOL_ACT(tool_behaviour), COMSIG_PARENT_EXAMINE))
/datum/element/processable/proc/try_process(datum/source, mob/living/user, obj/item/I, list/mutable_recipes)
SIGNAL_HANDLER
mutable_recipes += list(list(TOOL_PROCESSING_RESULT = result_atom_type, TOOL_PROCESSING_AMOUNT = amount_created, TOOL_PROCESSING_TIME = time_to_process))
return COMPONENT_NO_AFTERATTACK
///So people know what the frick they're doing without reading from a wiki page (I mean they will inevitably but i'm trying to help, ok?)
/datum/element/processable/proc/OnExamine(atom/source, mob/user, list/examine_list)
SIGNAL_HANDLER
if(amount_created > 1)
examine_list += "<span class='notice'>It can be turned into [amount_created] [initial(result_atom_type.name)]s with <b>[tool_behaviour_name(tool_behaviour)]</b>!</span>"
else
examine_list += "<span class='notice'>It can be turned into \a [initial(result_atom_type.name)] with <b>[tool_behaviour_name(tool_behaviour)]</b>!</span>"
@@ -101,6 +101,14 @@
list_reagents = list(/datum/reagent/consumable/enzyme = 50)
fill_icon_thresholds = null
/obj/item/reagent_containers/food/condiment/enzyme/examine(mob/user)
. = ..()
var/datum/chemical_reaction/recipe = GLOB.chemical_reactions_list[/datum/chemical_reaction/food/cheesewheel]
var/milk_required = recipe.required_reagents[/datum/reagent/consumable/milk]
var/enzyme_required = recipe.required_catalysts[/datum/reagent/consumable/enzyme]
. += "<span class='notice'>[milk_required] milk, [enzyme_required] enzyme and you got cheese.</span>"
. += "<span class='warning'>Remember, the enzyme isn't used up, so return it to the bottle, dingus!</span>"
/obj/item/reagent_containers/food/condiment/sugar
name = "sugar sack"
desc = "Tasty spacey sugar!"
@@ -111,6 +119,14 @@
list_reagents = list(/datum/reagent/consumable/sugar = 50)
fill_icon_thresholds = null
/obj/item/reagent_containers/food/condiment/sugar/examine(mob/user)
. = ..()
var/datum/chemical_reaction/recipe = GLOB.chemical_reactions_list[/datum/chemical_reaction/food/cakebatter]
var/flour_required = recipe.required_reagents[/datum/reagent/consumable/flour]
var/eggyolk_required = recipe.required_reagents[/datum/reagent/consumable/eggyolk]
var/sugar_required = recipe.required_reagents[/datum/reagent/consumable/sugar]
. += "<span class='notice'>[flour_required] flour, [eggyolk_required] egg yolk (or soy milk), [sugar_required] sugar makes cake dough. You can make pie dough from it.</span>"
/obj/item/reagent_containers/food/condiment/saltshaker //Separate from above since it's a small shaker rather then
name = "salt shaker" // a large one.
desc = "Salt. From space oceans, presumably."
@@ -167,6 +183,14 @@
list_reagents = list(/datum/reagent/consumable/milk = 50)
fill_icon_thresholds = null
/obj/item/reagent_containers/food/condiment/milk/examine(mob/user)
. = ..()
var/datum/chemical_reaction/recipe = GLOB.chemical_reactions_list[/datum/chemical_reaction/food/cheesewheel]
var/milk_required = recipe.required_reagents[/datum/reagent/consumable/milk]
var/enzyme_required = recipe.required_catalysts[/datum/reagent/consumable/enzyme]
. += "<span class='notice'>[milk_required] milk, [enzyme_required] enzyme and you got cheese.</span>"
. += "<span class='warning'>Remember, the enzyme isn't used up, so return it to the bottle, dingus!</span>"
/obj/item/reagent_containers/food/condiment/flour
name = "flour sack"
desc = "A big bag of flour. Good for baking!"
@@ -177,6 +201,19 @@
list_reagents = list(/datum/reagent/consumable/flour = 30)
fill_icon_thresholds = null
/obj/item/reagent_containers/food/condiment/flour/examine(mob/user)
. = ..()
var/datum/chemical_reaction/recipe_dough = GLOB.chemical_reactions_list[/datum/chemical_reaction/food/dough]
var/datum/chemical_reaction/recipe_cakebatter = GLOB.chemical_reactions_list[/datum/chemical_reaction/food/cakebatter]
var/dough_flour_required = recipe_dough.required_reagents[/datum/reagent/consumable/flour]
var/dough_water_required = recipe_dough.required_reagents[/datum/reagent/water]
var/cakebatter_flour_required = recipe_cakebatter.required_reagents[/datum/reagent/consumable/flour]
var/cakebatter_eggyolk_required = recipe_cakebatter.required_reagents[/datum/reagent/consumable/eggyolk]
var/cakebatter_sugar_required = recipe_cakebatter.required_reagents[/datum/reagent/consumable/sugar]
. += "<b><i>You retreat inward and recall the teachings of... Making Dough...</i></b>"
. += "<span class='notice'>[dough_flour_required] flour, [dough_water_required] water makes normal dough. You can make flat dough from it.</span>"
. += "<span class='notice'>[cakebatter_flour_required] flour, [cakebatter_eggyolk_required] egg yolk (or soy milk), [cakebatter_sugar_required] sugar makes cake dough. You can make pie dough from it.</span>"
/obj/item/reagent_containers/food/condiment/soymilk
name = "soy milk"
desc = "It's soy milk. White and nutritious goodness!"