-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathRandom.java
More file actions
30 lines (27 loc) · 751 Bytes
/
Random.java
File metadata and controls
30 lines (27 loc) · 751 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package dungeonzero;
//Carter wrote these randoms for us,
public class Random
{
public static int RandInt(int min, int max)
{
int random_int = (int)Math.floor(Math.random()*(max-min+1)+min);
return random_int;
}
public static Monster RandMonGen(int min, int max)
{ String name = "Randy";
int maxHP = RandInt(min,max);
int maxStam = RandInt(min,max);
int maxMana = RandInt(min,max);
Monster newMonster = new Monster(name, maxHP, maxStam, maxMana, World.allAbilities);
return newMonster;
}
public static Gem RandGemGen(int min,int max)
{
int hp = RandInt(min,max);
int stam = RandInt(min,max);
int mana = RandInt(min,max);
int type = RandInt(0,3);
Gem newGem = new Gem(hp, mana, stam, type);
return newGem;
}
}