fuck me for forgetting to graph this one

This commit is contained in:
ninjanomnom
2017-11-23 00:28:20 -05:00
parent 04fa786453
commit 45d7acea2f
3 changed files with 3 additions and 10 deletions

View File

@@ -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

View File

@@ -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()

View File

@@ -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()