mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-09 16:12:17 +00:00
[MIRROR] var/global/list -> GLOB. conversion (#11193)
Co-authored-by: Cameron Lennox <killer65311@gmail.com> Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
6f8cbcf612
commit
2c9453b5c3
@@ -36,12 +36,12 @@
|
||||
// If the machine has multiple output modes, define them here.
|
||||
var/selected_option
|
||||
var/list/output_options = list()
|
||||
var/list/datum/recipe/available_recipes
|
||||
var/list/datum/recipe/appliance_available_recipes = list()
|
||||
|
||||
var/container_type = null
|
||||
|
||||
var/combine_first = FALSE // If TRUE, this appliance will do combination cooking before checking recipes
|
||||
var/food_safety = FALSE //RS ADD - If true, the appliance automatically ejects food instead of burning it
|
||||
var/food_safety = FALSE // If true, the appliance automatically ejects food instead of burning it
|
||||
|
||||
var/static/radial_eject = image(icon = 'icons/mob/radial.dmi', icon_state = "radial_eject")
|
||||
var/static/radial_power = image(icon = 'icons/mob/radial.dmi', icon_state = "radial_power")
|
||||
@@ -56,12 +56,10 @@
|
||||
if(output_options.len)
|
||||
verbs += /obj/machinery/appliance/proc/choose_output
|
||||
|
||||
if (!available_recipes)
|
||||
available_recipes = new
|
||||
|
||||
for(var/datum/recipe/test as anything in subtypesof(/datum/recipe))
|
||||
if((appliancetype & initial(test.appliance)))
|
||||
available_recipes += new test
|
||||
if(!LAZYLEN(appliance_available_recipes))
|
||||
for(var/datum/recipe/test as anything in subtypesof(/datum/recipe))
|
||||
if((appliancetype & initial(test.appliance)))
|
||||
appliance_available_recipes += new test
|
||||
|
||||
/obj/machinery/appliance/Destroy()
|
||||
for(var/datum/cooking_item/CI as anything in cooking_objs)
|
||||
@@ -441,7 +439,7 @@
|
||||
C = CI.container
|
||||
else
|
||||
C = src
|
||||
recipe = select_recipe(available_recipes, C)
|
||||
recipe = select_recipe(appliance_available_recipes, C)
|
||||
|
||||
var/list/results = list()
|
||||
if(recipe)
|
||||
@@ -496,7 +494,7 @@
|
||||
C = CI.container
|
||||
else
|
||||
C = src
|
||||
recipe = select_recipe(available_recipes,C)
|
||||
recipe = select_recipe(appliance_available_recipes,C)
|
||||
|
||||
if (recipe)
|
||||
CI.result_type = 4//Recipe type, a specific recipe will transform the ingredients into a new food
|
||||
@@ -508,7 +506,7 @@
|
||||
AM.forceMove(temp)
|
||||
|
||||
//making multiple copies of a recipe from one container. For example, tons of fries
|
||||
while (select_recipe(available_recipes,C) == recipe)
|
||||
while (select_recipe(appliance_available_recipes,C) == recipe)
|
||||
var/list/TR = list()
|
||||
TR += recipe.make_food(C)
|
||||
for (var/atom/movable/AM in TR) //Move results to buffer
|
||||
|
||||
@@ -19,9 +19,6 @@
|
||||
var/broken = 0 // ={0,1,2} How broken is it???
|
||||
var/circuit_item_capacity = 1 //how many items does the circuit add to max number of items
|
||||
var/item_level = 0 // items microwave can handle, 0 foodstuff, 1 materials
|
||||
var/global/list/acceptable_items // List of the items you can put in
|
||||
var/global/list/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 = 20
|
||||
var/appliancetype = MICROWAVE
|
||||
@@ -42,26 +39,23 @@
|
||||
|
||||
default_apply_parts()
|
||||
|
||||
if(!available_recipes)
|
||||
available_recipes = new
|
||||
if(!LAZYLEN(GLOB.available_recipes))
|
||||
for(var/datum/recipe/typepath as anything in subtypesof(/datum/recipe))
|
||||
if((initial(typepath.appliance) & appliancetype))
|
||||
available_recipes += new typepath
|
||||
GLOB.available_recipes += new typepath
|
||||
|
||||
acceptable_items = new
|
||||
acceptable_reagents = new
|
||||
for (var/datum/recipe/recipe in available_recipes)
|
||||
for (var/datum/recipe/recipe in GLOB.available_recipes)
|
||||
for (var/item in recipe.items)
|
||||
acceptable_items |= item
|
||||
GLOB.acceptable_items |= item
|
||||
for (var/reagent in recipe.reagents)
|
||||
acceptable_reagents |= reagent
|
||||
GLOB.acceptable_reagents |= reagent
|
||||
// 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
|
||||
acceptable_items |= /obj/item/holder
|
||||
acceptable_items |= /obj/item/reagent_containers/food/snacks/grown
|
||||
acceptable_items |= /obj/item/soulstone
|
||||
acceptable_items |= /obj/item/fuel_assembly/supermatter
|
||||
GLOB.acceptable_items |= /obj/item/holder
|
||||
GLOB.acceptable_items |= /obj/item/reagent_containers/food/snacks/grown
|
||||
GLOB.acceptable_items |= /obj/item/soulstone
|
||||
GLOB.acceptable_items |= /obj/item/fuel_assembly/supermatter
|
||||
|
||||
soundloop = new(list(src), FALSE)
|
||||
|
||||
@@ -126,7 +120,7 @@
|
||||
else //Otherwise bad luck!!
|
||||
to_chat(user, span_warning("It's dirty!"))
|
||||
return 1
|
||||
else if(is_type_in_list(O,acceptable_items))
|
||||
else if(is_type_in_list(O,GLOB.acceptable_items))
|
||||
var/list/workingList = cookingContents()
|
||||
if(workingList.len>=(max_n_of_items + 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_warning("This [src] is full of ingredients, you cannot put more."))
|
||||
@@ -184,7 +178,7 @@
|
||||
if (!O.reagents)
|
||||
return 1
|
||||
for (var/datum/reagent/R in O.reagents.reagent_list)
|
||||
if (!(R.id in acceptable_reagents))
|
||||
if (!(R.id in GLOB.acceptable_reagents))
|
||||
to_chat(user, span_warning("Your [O] contains components unsuitable for cookery."))
|
||||
return 1
|
||||
// gotta let afterattack resolve
|
||||
@@ -260,7 +254,7 @@
|
||||
/obj/machinery/microwave/tgui_static_data(mob/user)
|
||||
var/list/data = ..()
|
||||
|
||||
var/datum/recipe/recipe = select_recipe(available_recipes,src)
|
||||
var/datum/recipe/recipe = select_recipe(GLOB.available_recipes,src)
|
||||
data["recipe"] = recipe ? sanitize_css_class_name("[recipe.type]") : null
|
||||
data["recipe_name"] = recipe ? initial(recipe.result:name) : null
|
||||
|
||||
@@ -371,7 +365,7 @@
|
||||
abort()
|
||||
return
|
||||
|
||||
var/datum/recipe/recipe = select_recipe(available_recipes,src)
|
||||
var/datum/recipe/recipe = select_recipe(GLOB.available_recipes,src)
|
||||
var/obj/cooked
|
||||
if(!recipe)
|
||||
dirty += 1
|
||||
@@ -427,7 +421,7 @@
|
||||
|
||||
valid = 0
|
||||
recipe.after_cook(src)
|
||||
recipe = select_recipe(available_recipes,src)
|
||||
recipe = select_recipe(GLOB.available_recipes,src)
|
||||
if(recipe && recipe.result == result)
|
||||
valid = 1
|
||||
sleep(2)
|
||||
|
||||
Reference in New Issue
Block a user