diff --git a/code/__DEFINES/maths.dm b/code/__DEFINES/maths.dm index ebe18022c0d..5ea91a648e9 100644 --- a/code/__DEFINES/maths.dm +++ b/code/__DEFINES/maths.dm @@ -115,14 +115,7 @@ //A logarithm that converts an integer to a number scaled between 0 and 1 (can be tweaked to be higher). //Currently, this is used for hydroponics-produce sprite transforming, but could be useful for other transform functions. -//Kept for documentation reasons -///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 -// -// 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 -#define TRANSFORM_USING_VARIABLE(input, max, scale) ( ((input/max)*180) + (-cos((input/max)*180)) ) +#define TRANSFORM_USING_VARIABLE(input, max) ( sin((90*input)/max)**2 ) //converts a uniform distributed random number into a normal distributed one //since this method produces two random numbers, one is saved for subsequent calls diff --git a/code/modules/hydroponics/grown.dm b/code/modules/hydroponics/grown.dm index 7fcef32e879..df2b07113a8 100644 --- a/code/modules/hydroponics/grown.dm +++ b/code/modules/hydroponics/grown.dm @@ -36,7 +36,7 @@ for(var/datum/plant_gene/trait/T in seed.genes) T.on_new(src, loc) seed.prepare_result(src) - transform *= TRANSFORM_USING_VARIABLE(seed.potency, 100, 0.5) //Makes the resulting produce's sprite larger or smaller based on potency! + transform *= TRANSFORM_USING_VARIABLE(seed.potency, 100) + 0.5 //Makes the resulting produce's sprite larger or smaller based on potency! add_juice() diff --git a/code/modules/hydroponics/growninedible.dm b/code/modules/hydroponics/growninedible.dm index 8c90f647714..b0bd44ac8ae 100644 --- a/code/modules/hydroponics/growninedible.dm +++ b/code/modules/hydroponics/growninedible.dm @@ -28,7 +28,7 @@ if(istype(src, seed.product)) // no adding reagents if it is just a trash item seed.prepare_result(src) - transform *= TRANSFORM_USING_VARIABLE(seed.potency, 100, 0.5) + transform *= TRANSFORM_USING_VARIABLE(seed.potency, 100) + 0.5 add_juice()