mirror of
https://github.com/Melledy/Nebula.git
synced 2025-12-24 18:24:47 +01:00
Implement some star tower npc events
This commit is contained in:
@@ -173,6 +173,10 @@ public class Utils {
|
||||
public static int randomRange(int min, int max) {
|
||||
return ThreadLocalRandom.current().nextInt(min, max + 1);
|
||||
}
|
||||
|
||||
public static boolean randomChance(double chance) {
|
||||
return ThreadLocalRandom.current().nextDouble() < chance;
|
||||
}
|
||||
|
||||
public static int randomElement(int[] array) {
|
||||
return array[ThreadLocalRandom.current().nextInt(0, array.length)];
|
||||
|
||||
Reference in New Issue
Block a user