/**
* @return random damage from monster
* @param monster of class Monster
*/
public int getRandomDamage(Monster monster) {
int min = monster.getMinDamage(); //this is set to 20 for monsters
int max = monster.getMaxDamage(); //this is set to 30 for monsters
return randomGenerator.nextInt(max - min + 1) + min;
}
This return statement don't work, since it always returns the integer 20. Any tip for solving, it should return a random number between 20(int min) and 30(int max). Thx for any help.
After some problem solving turned out that getMaxDamage(); returned 20 and not 30, runs good now, thou stupid typing error.