Makes Changes requested by maintainer

This commit is contained in:
Rykka
2020-07-30 04:59:01 -04:00
parent d9b4d8bbd6
commit ecfe23398b
11 changed files with 103 additions and 104 deletions
+1 -1
View File
@@ -289,7 +289,7 @@
var/l = ls.len // Made local for sanic speed.
var/i = 0 // Incremented every time a list index is accessed.
if (sep <> null)
if (sep != null)
// Macros expand to long argument lists like so: sep, ls[++i], sep, ls[++i], sep, ls[++i], etc...
#define S1 sep, ls[++i]
#define S4 S1, S1, S1, S1
+20 -17
View File
@@ -142,7 +142,7 @@
. = ..()
if(Adjacent(user))
if(coating)
to_chat(user, "<span class='notice'>It's coated in [coating.name]!</span>")
. += "<span class='notice'>It's coated in [coating.name]!</span>"
if(bitecount==0)
return .
else if (bitecount==1)
@@ -4513,12 +4513,14 @@
filling_color = "#DB0000"
center_of_mass = list("x"=16, "y"=16)
do_coating_prefix = 0
New()
. = ..()
reagents.add_reagent("protein", 6)
reagents.add_reagent("batter", 1.7)
reagents.add_reagent("oil", 1.5)
bitesize = 2
bitesize = 2
/obj/item/weapon/reagent_containers/food/snacks/sausage/battered/Initialize()
. = ..()
reagents.add_reagent("protein", 6)
reagents.add_reagent("batter", 1.7)
reagents.add_reagent("oil", 1.5)
/obj/item/weapon/reagent_containers/food/snacks/jalapeno_poppers
name = "jalapeno popper"
@@ -4543,10 +4545,11 @@
icon = 'icons/obj/food_syn.dmi'
icon_state = "ratburger"
center_of_mass = list("x"=16, "y"=11)
New()
. = ..()
reagents.add_reagent("protein", 4)
bitesize = 2
bitesize = 2
/obj/item/weapon/reagent_containers/food/snacks/mouseburger/Initialize()
. = ..()
reagents.add_reagent("protein", 4)
/obj/item/weapon/reagent_containers/food/snacks/chickenkatsu
name = "chicken katsu"
@@ -4622,13 +4625,13 @@
nutriment_amt = 25
nutriment_desc = list("fried pizza" = 25)
center_of_mass = list("x"=16, "y"=11)
bitesize = 2
New()
. = ..()
reagents.add_reagent("batter", 6.5)
coating = reagents.get_reagent("batter")
reagents.add_reagent("oil", 4)
bitesize = 2
/obj/item/weapon/reagent_containers/food/snacks/sliceable/pizza/crunch/Initialize()
. = ..()
reagents.add_reagent("batter", 6.5)
coating = reagents.get_reagent("batter")
reagents.add_reagent("oil", 4)
/obj/item/weapon/reagent_containers/food/snacks/pizzacrunchslice
name = "pizza crunch"
@@ -53,12 +53,10 @@
if (!available_recipes)
available_recipes = new
for (var/type in subtypesof(/datum/recipe))
var/datum/recipe/test = new type
if ((appliancetype & test.appliance))
available_recipes += test
else
qdel(test)
for(var/type in subtypesof(/datum/recipe))
var/datum/recipe/test = type
if((appliancetype & initial(test.appliance)))
available_recipes += new test
/obj/machinery/appliance/Destroy()
for (var/a in cooking_objs)
@@ -79,7 +77,7 @@
for (var/a in cooking_objs)
var/datum/cooking_item/CI = a
string += "-\a [CI.container.label(null, CI.combine_target)], [report_progress(CI)]</br>"
to_chat(user, string)
return string
else
to_chat(user, "<span class='notice>'It is empty.</span>")
@@ -125,14 +123,14 @@
return
if (!user.IsAdvancedToolUser())
to_chat(user, "You lack the dexterity to do that!")
to_chat(user, "<span class='warning'>You lack the dexterity to do that!</span>")
return
if (user.stat || user.restrained() || user.incapacitated())
return
if (!Adjacent(user) && !issilicon(user))
to_chat(user, "You can't reach [src] from here.")
to_chat(user, "<span class='warning'>You can't reach [src] from here!</span>")
return
if (stat & POWEROFF)//Its turned off
@@ -234,10 +232,10 @@
//This function is overridden by cookers that do stuff with containers
/obj/machinery/appliance/proc/has_space(var/obj/item/I)
if (cooking_objs.len >= max_contents)
if(cooking_objs.len >= max_contents)
return FALSE
else return TRUE
return TRUE
/obj/machinery/appliance/attackby(var/obj/item/I, var/mob/user)
if(!cook_type || (stat & (BROKEN)))
@@ -246,12 +244,9 @@
var/result = can_insert(I, user)
if(!result)
if(default_deconstruction_screwdriver(user, I))
return
else if(default_part_replacement(user, I))
return
else
return
if(!(default_deconstruction_screwdriver(user, I)))
default_part_replacement(user, I)
return
if(result == 2)
var/obj/item/weapon/grab/G = I
@@ -572,17 +567,17 @@
var/datum/cooking_item/CI = menuoptions[selection]
eject(CI, user)
update_icon()
return 1
return 0
return TRUE
return FALSE
/obj/machinery/appliance/proc/can_remove_items(var/mob/user)
if (!Adjacent(user))
return 0
return FALSE
if (isanimal(user))
return 0
return FALSE
return 1
return TRUE
/obj/machinery/appliance/proc/eject(var/datum/cooking_item/CI, var/mob/user = null)
var/obj/item/thing
@@ -19,12 +19,12 @@
if(.) //no need to duplicate adjacency check
if(!stat)
if (temperature < min_temp)
to_chat(user, "<span class='warning'>\The [src] is still heating up and is too cold to cook anything yet.</span>")
. += "<span class='warning'>\The [src] is still heating up and is too cold to cook anything yet.</span>"
else
to_chat(user, "<span class='notice'>It is running at [round(get_efficiency(), 0.1)]% efficiency!</span>")
to_chat(user, "Temperature: [round(temperature - T0C, 0.1)]C / [round(optimal_temp - T0C, 0.1)]C")
. += "<span class='notice'>It is running at [round(get_efficiency(), 0.1)]% efficiency!</span>"
. += "Temperature: [round(temperature - T0C, 0.1)]C / [round(optimal_temp - T0C, 0.1)]C"
else
to_chat(user, "<span class='warning'>It is switched off.</span>")
. += "<span class='warning'>It is switched off.</span>"
/obj/machinery/appliance/cooker/list_contents(var/mob/user)
if (cooking_objs.len)
@@ -17,7 +17,7 @@ fundamental differences
/obj/machinery/appliance/mixer/examine(var/mob/user)
. = ..()
if(Adjacent(user))
to_chat(user, "<span class='notice'>It is currently set to make a [selected_option]</span>")
. += "<span class='notice'>It is currently set to make a [selected_option]</span>"
/obj/machinery/appliance/mixer/Initialize()
. = ..()
@@ -27,7 +27,7 @@ fundamental differences
//Mixers cannot-not do combining mode. So the default option is removed from this. A combine target must be chosen
/obj/machinery/appliance/mixer/choose_output()
set src in oview(1)
set src in view(1)
set name = "Choose output"
set category = "Object"
@@ -91,7 +91,7 @@ fundamental differences
/obj/machinery/appliance/mixer/toggle_power()
set src in view()
set src in view(1)
set name = "Toggle Power"
set category = "Object"
+6 -6
View File
@@ -268,7 +268,7 @@
return
start()
if(reagents.total_volume==0 && !(locate(/obj) in ((contents - component_parts) - circuit))) //dry run
if(!wzhzhzh(16)) //VOREStation Edit - Quicker Microwaves (Undone during Auroraport, left note in case of reversion, was 5)
if(!wzhzhzh(16))
abort()
return
abort()
@@ -279,23 +279,23 @@
if(!recipe)
dirty += 1
if(prob(max(10,dirty*5)))
if(!wzhzhzh(16)) //VOREStation Edit - Quicker Microwaves (Undone during Auroraport, left note in case of reversion, was 2)
if(!wzhzhzh(16))
abort()
return
muck_start()
wzhzhzh(2) //VOREStation Edit - Quicker Microwaves (Undone during Auroraport, left note in case of reversion, was 2)
wzhzhzh(2)
muck_finish()
cooked = fail()
cooked.forceMove(src.loc)
else if(has_extra_item())
if(!wzhzhzh(16)) //VOREStation Edit - Quicker Microwaves (Undone during Auroraport, left note in case of reversion, was 2)
if(!wzhzhzh(16))
abort()
return
broke()
cooked = fail()
cooked.forceMove(src.loc)
else
if(!wzhzhzh(40)) //VOREStation Edit - Quicker Microwaves (Undone during Auroraport, left note in case of reversion, was 5)
if(!wzhzhzh(40))
abort()
return
stop()
@@ -304,7 +304,7 @@
return
//Making multiple copies of a recipe
var/halftime = round(recipe.time*4/10/2) // VOREStation Edit - Quicker Microwaves (Undone during Auroraport, left note in case of reversion, was round(recipe.time/20/2))
var/halftime = round(recipe.time*4/10/2)
if(!wzhzhzh(halftime))
abort()
return
+34 -34
View File
@@ -71,31 +71,31 @@
// This is a bitfield, more than one type can be used
// Grill is presently unused and not listed
/datum/recipe/proc/check_reagents(var/datum/reagents/avail_reagents)
/datum/recipe/proc/check_reagents(var/datum/reagents/avail_reagents, var/exact = 0)
if(!reagents || !reagents.len)
return 1
return TRUE
if(!avail_reagents)
return 0
return FALSE
. = 1
. = TRUE
for(var/r_r in reagents)
var/aval_r_amnt = avail_reagents.get_reagent_amount(r_r)
if(aval_r_amnt - reagents[r_r] >= 0)
if(aval_r_amnt>reagents[r_r])
. = 0
if(aval_r_amnt>(reagents[r_r] && exact))
. = FALSE
else
return -1
return FALSE
if((reagents?(reagents.len):(0)) < avail_reagents.reagent_list.len)
return 0
return FALSE
return .
/datum/recipe/proc/check_fruit(var/obj/container)
/datum/recipe/proc/check_fruit(var/obj/container, var/exact = 0)
if (!fruit || !fruit.len)
return 1
return TRUE
. = 1
. = TRUE
if(fruit && fruit.len)
var/list/checklist = list()
// You should trust Copy().
@@ -107,18 +107,18 @@
checklist[G.seed.kitchen_tag]--
for(var/ktag in checklist)
if(!isnull(checklist[ktag]))
if(checklist[ktag] < 0)
. = 0
if(checklist[ktag] < 0 && exact)
. = FALSE
else if(checklist[ktag] > 0)
. = -1
. = FALSE
break
return .
/datum/recipe/proc/check_items(var/obj/container as obj)
/datum/recipe/proc/check_items(var/obj/container as obj, var/exact = 0)
if(!items || !items.len)
return 1
return TRUE
. = 1
. = TRUE
if(items && items.len)
var/list/checklist = list()
checklist = items.Copy() // You should really trust Copy
@@ -127,50 +127,50 @@
for(var/obj/O in ((machine.contents - machine.component_parts) - machine.circuit))
if(istype(O,/obj/item/weapon/reagent_containers/food/snacks/grown))
continue // Fruit is handled in check_fruit().
var/found = 0
var/found = FALSE
for(var/i = 1; i < checklist.len+1; i++)
var/item_type = checklist[i]
if (istype(O,item_type))
checklist.Cut(i, i+1)
found = 1
found = TRUE
break
if(!found)
. = 0
if(!found && exact)
return FALSE
else
for(var/obj/O in container.contents)
if(istype(O,/obj/item/weapon/reagent_containers/food/snacks/grown))
continue // Fruit is handled in check_fruit().
var/found = 0
var/found = FALSE
for(var/i = 1; i < checklist.len+1; i++)
var/item_type = checklist[i]
if (istype(O,item_type))
if(check_coating(O))
checklist.Cut(i, i+1)
found = 1
found = TRUE
break
if (!found)
. = 0
if (!found && exact)
return FALSE
if(checklist.len)
. = -1
return FALSE
return .
//This is called on individual items within the container.
/datum/recipe/proc/check_coating(var/obj/O)
/datum/recipe/proc/check_coating(var/obj/O, var/exact = FALSE)
if(!istype(O,/obj/item/weapon/reagent_containers/food/snacks))
return 1//Only snacks can be battered
return TRUE //Only snacks can be battered
if (coating == -1)
return 1 //-1 value doesnt care
return TRUE //-1 value doesnt care
var/obj/item/weapon/reagent_containers/food/snacks/S = O
if (!S.coating)
if (!coating)
return 1
return 0
return TRUE
return FALSE
else if (S.coating.type == coating)
return 1
return TRUE
return 0
return FALSE
//general version
/datum/recipe/proc/make(var/obj/container as obj)
@@ -308,7 +308,7 @@
/proc/select_recipe(var/list/datum/recipe/available_recipes, var/obj/obj as obj, var/exact)
var/list/datum/recipe/possible_recipes = list()
for (var/datum/recipe/recipe in available_recipes)
if((recipe.check_reagents(obj.reagents) < exact) || (recipe.check_items(obj) < exact) || (recipe.check_fruit(obj) < exact))
if(!recipe.check_reagents(obj.reagents, exact) || !recipe.check_items(obj, exact) || !recipe.check_fruit(obj, exact))
continue
possible_recipes |= recipe
if (!possible_recipes.len)
+3 -4
View File
@@ -6,6 +6,7 @@
result = /obj/item/weapon/reagent_containers/food/snacks/fries
/datum/recipe/cheesyfries
appliance = FRYER
items = list(
/obj/item/weapon/reagent_containers/food/snacks/fries,
/obj/item/weapon/reagent_containers/food/snacks/cheesewedge,
@@ -100,13 +101,11 @@
)
result = /obj/item/weapon/reagent_containers/food/snacks/donut/poisonberry
/datum/recipe/jellydonut/slime
appliance = FRYER
/datum/recipe/jellydonut/slime // Subtypes of jellydonut, appliance inheritance applies.
reagents = list("slimejelly" = 5, "sugar" = 5)
result = /obj/item/weapon/reagent_containers/food/snacks/donut/slimejelly
/datum/recipe/jellydonut/cherry
appliance = FRYER
/datum/recipe/jellydonut/cherry // Subtypes of jellydonut, appliance inheritance applies.
reagents = list("cherryjelly" = 5, "sugar" = 5)
result = /obj/item/weapon/reagent_containers/food/snacks/donut/cherryjelly
+10 -9
View File
@@ -208,10 +208,11 @@ I said no!
/datum/recipe/amanitajelly
reagents = list("water" = 5, "vodka" = 5, "amatoxin" = 5)
result = /obj/item/weapon/reagent_containers/food/snacks/amanitajelly
make_food(var/obj/container as obj)
. = ..(container)
for(var/obj/item/weapon/reagent_containers/food/snacks/amanitajelly/being_cooked in .)
being_cooked.reagents.del_reagent("amatoxin")
/datum/recipe/amanitajelly/make_food(var/obj/container as obj)
. = ..(container)
for(var/obj/item/weapon/reagent_containers/food/snacks/amanitajelly/being_cooked in .)
being_cooked.reagents.del_reagent("amatoxin")
/datum/recipe/meatballsoup
fruit = list("carrot" = 1, "potato" = 1)
@@ -531,11 +532,11 @@ I said no!
fruit = list("potato" = 1, "ambrosia" = 3)
items = list(/obj/item/weapon/reagent_containers/food/snacks/meatball)
result = /obj/item/weapon/reagent_containers/food/snacks/validsalad
make_food(var/obj/container as obj)
. = ..(container)
for (var/obj/item/weapon/reagent_containers/food/snacks/validsalad/being_cooked in .)
being_cooked.reagents.del_reagent("toxin")
/datum/recipe/validsalad/make_food(var/obj/container as obj)
. = ..(container)
for (var/obj/item/weapon/reagent_containers/food/snacks/validsalad/being_cooked in .)
being_cooked.reagents.del_reagent("toxin")
/datum/recipe/stuffing
reagents = list("water" = 5, "sodiumchloride" = 1, "blackpepper" = 1)
+1
View File
@@ -83,6 +83,7 @@
result = /obj/item/weapon/reagent_containers/food/snacks/flatbread
/datum/recipe/tortilla
appliance = OVEN
reagents = list("flour" = 5)
items = list(
/obj/item/weapon/reagent_containers/food/snacks/sliceable/flatdough
@@ -67,14 +67,14 @@
/datum/reagent/nutriment/coating/affect_ingest(var/mob/living/carbon/M, var/alien, var/removed)
//We'll assume that the batter isnt going to be regurgitated and eaten by someone else. Only show this once
if (data["cooked"] != 1)
if(data["cooked"] != 1)
if (!messaged)
to_chat(M, "Ugh, this raw [name] tastes disgusting.")
to_chat(M, "<span class='warning'>Ugh, this raw [name] tastes disgusting.<span>")
nutriment_factor *= 0.5
messaged = 1
//Raw coatings will sometimes cause vomiting
if (prob(1))
//Raw coatings will sometimes cause vomiting. 75% chance of this happening.
if(prob(75))
M.vomit()
..()