/datum/autowiki/soup page = "Template:Autowiki/Content/SoupRecipes" /datum/autowiki/soup/generate() var/output = "" // Since we're here, generate a range icon since that's what is installed in most kitchens var/obj/machinery/oven/range/range = new() upload_icon(getFlatIcon(range, no_anim = TRUE), "kitchen_range") qdel(range) // Also generate a soup pot icon, as that's what makes soup var/obj/item/reagent_containers/cup/soup_pot/soup_pot = new() upload_icon(getFlatIcon(soup_pot, no_anim = TRUE), "soup_pot") qdel(soup_pot) var/container_for_images = /obj/item/reagent_containers/cup/bowl var/list/already_generated_icons = list() for(var/soup_recipe_type in subtypesof(/datum/chemical_reaction/food/soup)) var/datum/chemical_reaction/food/soup/soup_recipe = new soup_recipe_type() // Used to determine what icon is displayed on the wiki var/soup_icon var/soup_icon_state // Used to determine what food types the soup is var/soup_food_types = NONE // Used for filename and description of the result var/result_name var/result_desc var/result_tastes var/result_soup_type // Solid food item results take priority over reagents for showcasing results if(soup_recipe.resulting_food_path) var/obj/item/resulting_food = new soup_recipe.resulting_food_path() result_name = format_text(resulting_food.name) result_desc = resulting_food.desc soup_icon = resulting_food.icon soup_icon_state = resulting_food.icon_state if(istype(resulting_food, /obj/item/food)) var/obj/item/food/resulting_food_casted = resulting_food result_tastes = resulting_food_casted.tastes?.Copy() soup_food_types = resulting_food_casted.foodtypes || NONE qdel(resulting_food) // Otherwise, it should be a reagent. else result_soup_type = soup_recipe.results[1] var/datum/reagent/result_soup = new result_soup_type() result_name = format_text(result_soup.name) result_desc = result_soup.description result_tastes = result_soup.get_taste_description() var/datum/glass_style/has_foodtype/soup_style = GLOB.glass_style_singletons[container_for_images][result_soup_type] soup_icon = soup_style.icon soup_icon_state = soup_style.icon_state soup_food_types = soup_style.drink_type qdel(result_soup) var/filename = "soup_[SANITIZE_FILENAME(escape_value(result_name))]" // -- Compiles a list of required reagents and food items -- var/list/all_needs_text = list() for(var/datum/reagent/reagent_type as anything in soup_recipe.required_reagents) all_needs_text += "[soup_recipe.required_reagents[reagent_type]] units [initial(reagent_type.name)]" for(var/datum/reagent/reagent_type as anything in soup_recipe.required_catalysts) all_needs_text += "[soup_recipe.required_catalysts[reagent_type]] units [initial(reagent_type.name)] (not consumed)" for(var/obj/item/food_type as anything in soup_recipe.required_ingredients) var/num_needed = soup_recipe.required_ingredients[food_type] // Instantiating this so we can do plurality correctly. // We can use initial but it'll give us stuff like "eyballss". var/obj/item/food = new food_type() all_needs_text += "[num_needed] [food.name]\s" qdel(food) all_needs_text += soup_recipe.describe_recipe_details() all_needs_text += "At temperature [soup_recipe.required_temp]K" var/compiled_requirements = "" for(var/req_text in all_needs_text) if(length(req_text)) compiled_requirements += "