public class MathFunc extends Object
| Constructor and Description |
|---|
MathFunc() |
| Modifier and Type | Method and Description |
|---|---|
static float |
addStatFromArray(Enemy[] ens,
StatusArrayPosition pos)
Adds stats from an array of enemies, given what StatusArrayPosition you
want.
|
static boolean |
checkHit(Move selectedMove,
float targetEvasion)
Checks to see if a move should hit.
|
static int |
expToNextLevel(int level,
int baseExp,
float exponent)
Calculates the experience required for the next level.
|
static int |
getPercentageOf(float percent,
int number)
Gets an amount from number, given the percent.
|
static Object |
hatpull(int[] amountOfEach,
Object[] elements)
Runs a virtual hat pull.
|
static double |
randomD(int min,
int max)
Returns a number between min and max, as a double.
|
static int |
randomInt(int min,
int max)
Returns a number between min and max.
|
static int |
statIncrease(int oldStat,
int levelNeeded,
double growthRate)
Increases a stat, given the old stat, the levels needed, and the growth
rate.
|
public static double randomD(int min,
int max)
min - max - public static int randomInt(int min,
int max)
min - max - public static Object hatpull(int[] amountOfEach, Object[] elements)
amountOfEach - elements - public static boolean checkHit(Move selectedMove, float targetEvasion)
selectedMove - targetEvasion - public static int expToNextLevel(int level,
int baseExp,
float exponent)
level - baseExp - exponent - public static int statIncrease(int oldStat,
int levelNeeded,
double growthRate)
oldStat - levelNeeded - growthRate - public static int getPercentageOf(float percent,
int number)
percent - number - public static float addStatFromArray(Enemy[] ens, StatusArrayPosition pos)
ens - pos - Copyright © 2022. All rights reserved.