mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-26 05:27:01 +01:00
more adjustments and fixes
This commit is contained in:
@@ -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
|
||||
|
||||
+21
-21
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -170,7 +170,7 @@
|
||||
if(issilicon(crosser))
|
||||
return
|
||||
if(prob(severity) && istype(crosser) && !isvineimmune(crosser))
|
||||
crosser << "<span class='alert'>You accidently touch the vine and feel a strange sensation.</span>"
|
||||
to_chat(crosser, "<span class='alert'>You accidently touch the vine and feel a strange sensation.</span>")
|
||||
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 << "<span class='alert'>You cut yourself on the thorny vines.</span>"
|
||||
to_chat(M, "<span class='alert'>You cut yourself on the thorny vines.</span>")
|
||||
|
||||
/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 << "<span class='alert'>You cut yourself on the thorny vines.</span>"
|
||||
to_chat(M, "<span class='alert'>You cut yourself on the thorny vines.</span>")
|
||||
. = 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 << "<span class='danger'>The vines [pick("wind", "tangle", "tighten")] around you!</span>"
|
||||
to_chat(V, "<span class='danger'>The vines [pick("wind", "tangle", "tighten")] around you!</span>")
|
||||
buckle_mob(V, 1)
|
||||
|
||||
/obj/effect/spacevine/proc/spread()
|
||||
|
||||
@@ -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
|
||||
@@ -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
|
||||
|
||||
@@ -97,7 +97,7 @@
|
||||
if(A.density && A != L)
|
||||
continue grasping
|
||||
if(prob(grasp_chance))
|
||||
L << "<span class='userdanger'>\The [src] has you entangled!</span>"
|
||||
to_chat(L, "<span class='userdanger'>\The [src] has you entangled!</span>")
|
||||
grasping[L] = Beam(L, "vine", time=INFINITY, maxdistance=5, beam_type=/obj/effect/ebeam/vine)
|
||||
|
||||
break //only take 1 new victim per cycle
|
||||
|
||||
@@ -120,18 +120,18 @@
|
||||
update_icon()
|
||||
src.updateUsrDialog()
|
||||
else
|
||||
user << "<span class='warning'>There's already a container inside.</span>"
|
||||
to_chat(user, "<span class='warning'>There's already a container inside.</span>")
|
||||
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 << "<span class='warning'>You must dry that first!</span>"
|
||||
to_chat(user, "<span class='warning'>You must dry that first!</span>")
|
||||
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 << "<span class='notice'>You fill the All-In-One grinder to the brim.</span>"
|
||||
to_chat(user, "<span class='notice'>You fill the All-In-One grinder to the brim.</span>")
|
||||
break
|
||||
|
||||
if(!I.contents.len)
|
||||
user << "<span class='notice'>You empty the plant bag into the All-In-One grinder.</span>"
|
||||
to_chat(user, "<span class='notice'>You empty the plant bag into the All-In-One grinder.</span>")
|
||||
|
||||
src.updateUsrDialog()
|
||||
return 1
|
||||
@@ -154,7 +154,7 @@
|
||||
if(user.a_intent == I_HARM)
|
||||
return ..()
|
||||
else
|
||||
user << "<span class='warning'>Cannot refine into a reagent!</span>"
|
||||
to_chat(user, "<span class='warning'>Cannot refine into a reagent!</span>")
|
||||
return 1
|
||||
|
||||
if(user.drop_item())
|
||||
|
||||
Reference in New Issue
Block a user