diff --git a/code/__HELPERS/maths.dm b/code/__HELPERS/maths.dm index 5d83243a43c..b0312d44134 100644 --- a/code/__HELPERS/maths.dm +++ b/code/__HELPERS/maths.dm @@ -60,11 +60,11 @@ var/const/Sqrt2 = 1.41421356 //Currently, this is used for hydroponics-produce sprite transforming, but could be useful for other transform functions. /proc/TransformUsingVariable(input, inputmaximum, scaling_modifier = 0) - var/inputToDegrees = (input/inputmaximum)*180 //Converting from a 0 -> 100 scale to a 0 -> 180 scale. The 0 -> 180 scale corresponds to degrees - var/size_factor = ((-cos(inputToDegrees) +1) /2) //returns a value from 0 to 1 + var/inputToDegrees = (input/inputmaximum)*180 //Converting from a 0 -> 100 scale to a 0 -> 180 scale. The 0 -> 180 scale corresponds to degrees + var/size_factor = ((-cos(inputToDegrees) +1) /2) //returns a value from 0 to 1 - return size_factor + scaling_modifier //scale mod of 0 results in a number from 0 to 1. A scale modifier of +0.5 returns 0.5 to 1.5 - //world<< "Transform multiplier of [src] is [size_factor + scaling_modifer]" + return size_factor + scaling_modifier //scale mod of 0 results in a number from 0 to 1. A scale modifier of +0.5 returns 0.5 to 1.5 + //world<< "Transform multiplier of [src] is [size_factor + scaling_modifer]" /proc/RaiseToPower(num, power) if(!power) return 1 diff --git a/code/datums/recipe.dm b/code/datums/recipe.dm index 95575387fbe..e379de25209 100644 --- a/code/datums/recipe.dm +++ b/code/datums/recipe.dm @@ -42,42 +42,42 @@ /datum/recipe/proc/check_reagents(datum/reagents/avail_reagents) //1=precisely, 0=insufficiently, -1=superfluous . = 1 - for (var/r_r in reagents) + for(var/r_r in reagents) var/aval_r_amnt = avail_reagents.get_reagent_amount(r_r) - if (!(abs(aval_r_amnt - reagents[r_r])<0.5)) //if NOT equals - if (aval_r_amnt>reagents[r_r]) + if(!(abs(aval_r_amnt - reagents[r_r])<0.5)) //if NOT equals + if(aval_r_amnt>reagents[r_r]) . = -1 else return 0 - if ((reagents?(reagents.len):(0)) < avail_reagents.reagent_list.len) + if((reagents?(reagents.len):(0)) < avail_reagents.reagent_list.len) return -1 return . /datum/recipe/proc/check_items(obj/container) //1=precisely, 0=insufficiently, -1=superfluous - if (!items) - if (locate(/obj/) in container) + if(!items) + if(locate(/obj/) in container) return -1 else return 1 . = 1 var/list/checklist = items.Copy() - for (var/obj/O in container) + for(var/obj/O in container) var/found = 0 - for (var/type in checklist) - if (istype(O,type)) + for(var/type in checklist) + if(istype(O,type)) checklist-=type found = 1 break - if (!found) + if(!found) . = -1 - if (checklist.len) + if(checklist.len) return 0 return . //general version /datum/recipe/proc/make(obj/container) var/obj/result_obj = new result(container) - for (var/obj/O in (container.contents-result_obj)) + for(var/obj/O in (container.contents-result_obj)) O.reagents.trans_to(result_obj, O.reagents.total_volume) qdel(O) container.reagents.clear_reagents() @@ -86,8 +86,8 @@ // food-related /datum/recipe/proc/make_food(obj/container) var/obj/result_obj = new result(container) - for (var/obj/O in (container.contents-result_obj)) - if (O.reagents) + for(var/obj/O in (container.contents-result_obj)) + if(O.reagents) O.reagents.del_reagent("nutriment") O.reagents.update_total() O.reagents.trans_to(result_obj, O.reagents.total_volume) @@ -96,24 +96,24 @@ return result_obj /proc/select_recipe(list/datum/recipe/avaiable_recipes, obj/obj, exact = 1 as num) - if (!exact) + if(!exact) exact = -1 var/list/datum/recipe/possible_recipes = new - for (var/datum/recipe/recipe in avaiable_recipes) - if (recipe.check_reagents(obj.reagents)==exact && recipe.check_items(obj)==exact) + for(var/datum/recipe/recipe in avaiable_recipes) + if(recipe.check_reagents(obj.reagents)==exact && recipe.check_items(obj)==exact) possible_recipes+=recipe - if (possible_recipes.len==0) + if(possible_recipes.len==0) return null - else if (possible_recipes.len==1) + else if(possible_recipes.len==1) return possible_recipes[1] else //okay, let's select the most complicated recipe var/r_count = 0 var/i_count = 0 . = possible_recipes[1] - for (var/datum/recipe/recipe in possible_recipes) + for(var/datum/recipe/recipe in possible_recipes) var/N_i = (recipe.items)?(recipe.items.len):0 var/N_r = (recipe.reagents)?(recipe.reagents.len):0 - if (N_i > i_count || (N_i== i_count && N_r > r_count )) + if(N_i > i_count || (N_i== i_count && N_r > r_count )) r_count = N_r i_count = N_i . = recipe diff --git a/code/game/objects/items/weapons/storage/bags.dm b/code/game/objects/items/weapons/storage/bags.dm index 0c4b29527e8..ccb5ff4dd4a 100644 --- a/code/game/objects/items/weapons/storage/bags.dm +++ b/code/game/objects/items/weapons/storage/bags.dm @@ -182,6 +182,8 @@ if(usr.incapacitated()) return + for(var/obj/item/O in contents) + seedify(O, 1) for(var/mob/M in range(1)) if(M.s_active == src) close(M) diff --git a/code/modules/events/spacevine.dm b/code/modules/events/spacevine.dm index 5d626284fad..dc67da123c2 100644 --- a/code/modules/events/spacevine.dm +++ b/code/modules/events/spacevine.dm @@ -170,7 +170,7 @@ if(issilicon(crosser)) return if(prob(severity) && istype(crosser) && !isvineimmune(crosser)) - crosser << "You accidently touch the vine and feel a strange sensation." + to_chat(crosser, "You accidently touch the vine and feel a strange sensation.") crosser.adjustToxLoss(5) /datum/spacevine_mutation/toxicity/on_eat(obj/effect/spacevine/holder, mob/living/eater) @@ -249,13 +249,13 @@ if(prob(severity) && istype(crosser) && !isvineimmune(holder)) var/mob/living/M = crosser M.adjustBruteLoss(5) - M << "You cut yourself on the thorny vines." + to_chat(M, "You cut yourself on the thorny vines.") /datum/spacevine_mutation/thorns/on_hit(obj/effect/spacevine/holder, mob/living/hitter, obj/item/I, expected_damage) if(prob(severity) && istype(hitter) && !isvineimmune(holder)) var/mob/living/M = hitter M.adjustBruteLoss(5) - M << "You cut yourself on the thorny vines." + to_chat(M, "You cut yourself on the thorny vines.") . = expected_damage /datum/spacevine_mutation/woodening @@ -321,7 +321,7 @@ else text += " normal" text += " vine." - user << text + to_chat(user, text) /obj/effect/spacevine/Destroy() for(var/datum/spacevine_mutation/SM in mutations) @@ -520,7 +520,7 @@ for(var/datum/spacevine_mutation/SM in mutations) SM.on_buckle(src, V) if((V.stat != DEAD) && (V.buckled != src)) //not dead or captured - V << "The vines [pick("wind", "tangle", "tighten")] around you!" + to_chat(V, "The vines [pick("wind", "tangle", "tighten")] around you!") buckle_mob(V, 1) /obj/effect/spacevine/proc/spread() diff --git a/code/modules/hydroponics/grown/ambrosia.dm b/code/modules/hydroponics/grown/ambrosia.dm index 9d50bffb8f5..9700b8f3d3b 100644 --- a/code/modules/hydroponics/grown/ambrosia.dm +++ b/code/modules/hydroponics/grown/ambrosia.dm @@ -80,7 +80,7 @@ product = /obj/item/weapon/reagent_containers/food/snacks/grown/ambrosia/cruciatus potency = 10 mutatelist = list() - reagents_add = list("thc" = 0.15, "silver_sulfadiazine" = 0.15, "styptic_powder" = 0.1, "bath salts" = 0.20, "plantmatter" = 0.05) + reagents_add = list("thc" = 0.15, "kelotane" = 0.15, "bicaridine" = 0.1, "bath_salts" = 0.20, "nutriment" = 0.05) /obj/item/weapon/reagent_containers/food/snacks/grown/ambrosia/cruciatus seed = /obj/item/seeds/ambrosia/cruciatus \ No newline at end of file diff --git a/code/modules/hydroponics/grown/peanut.dm b/code/modules/hydroponics/grown/peanut.dm index 28642135010..8b8488f3d52 100644 --- a/code/modules/hydroponics/grown/peanut.dm +++ b/code/modules/hydroponics/grown/peanut.dm @@ -14,7 +14,7 @@ icon_grow = "potato-grow" icon_dead = "potato-dead" genes = list(/datum/plant_gene/trait/repeated_harvest) - reagents_add = list("plantmatter" = 0.1) + reagents_add = list("nutriment" = 0.1) /obj/item/weapon/reagent_containers/food/snacks/grown/peanuts seed = /obj/item/seeds/peanuts diff --git a/code/modules/mob/living/simple_animal/hostile/venus_human_trap.dm b/code/modules/mob/living/simple_animal/hostile/venus_human_trap.dm index 3033cdfc21e..b4ac6212220 100644 --- a/code/modules/mob/living/simple_animal/hostile/venus_human_trap.dm +++ b/code/modules/mob/living/simple_animal/hostile/venus_human_trap.dm @@ -97,7 +97,7 @@ if(A.density && A != L) continue grasping if(prob(grasp_chance)) - L << "\The [src] has you entangled!" + to_chat(L, "\The [src] has you entangled!") grasping[L] = Beam(L, "vine", time=INFINITY, maxdistance=5, beam_type=/obj/effect/ebeam/vine) break //only take 1 new victim per cycle diff --git a/code/modules/reagents/chemistry/machinery/reagentgrinder.dm b/code/modules/reagents/chemistry/machinery/reagentgrinder.dm index 828e8967e5d..857672f8467 100644 --- a/code/modules/reagents/chemistry/machinery/reagentgrinder.dm +++ b/code/modules/reagents/chemistry/machinery/reagentgrinder.dm @@ -120,18 +120,18 @@ update_icon() src.updateUsrDialog() else - user << "There's already a container inside." + to_chat(user, "There's already a container inside.") return 1 //no afterattack if(is_type_in_list(I, dried_items)) if(istype(I, /obj/item/weapon/reagent_containers/food/snacks/grown)) var/obj/item/weapon/reagent_containers/food/snacks/grown/G = I if(!G.dry) - user << "You must dry that first!" + to_chat(user, "You must dry that first!") return 1 if(holdingitems && holdingitems.len >= limit) - usr << "The machine cannot hold anymore items." + to_chat(usr, "The machine cannot hold anymore items.") return 1 //Fill machine with a bag! @@ -141,11 +141,11 @@ B.remove_from_storage(G, src) holdingitems += G if(holdingitems && holdingitems.len >= limit) //Sanity checking so the blender doesn't overfill - user << "You fill the All-In-One grinder to the brim." + to_chat(user, "You fill the All-In-One grinder to the brim.") break if(!I.contents.len) - user << "You empty the plant bag into the All-In-One grinder." + to_chat(user, "You empty the plant bag into the All-In-One grinder.") src.updateUsrDialog() return 1 @@ -154,7 +154,7 @@ if(user.a_intent == I_HARM) return ..() else - user << "Cannot refine into a reagent!" + to_chat(user, "Cannot refine into a reagent!") return 1 if(user.drop_item())