-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMonster.java
More file actions
39 lines (34 loc) · 887 Bytes
/
Monster.java
File metadata and controls
39 lines (34 loc) · 887 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
31
32
33
34
35
36
37
38
39
/*
Riley and Peyton are awesome
5/11/2022
This class helps creates the monsters, including their stats
*/
public class Monster extends Character
{
private int monsterStrength, monsterAttack, monsterHarm, stunned = 0;
//*****************Monster Constructors***************
public Monster()
{
initiative = d6(1,0,20);
}//end Monster default constructor
public Monster(String n, int hp, int strength)
{
super(n, hp); //call to superclass
monsterStrength = strength;
initiative = d6(1,0,20);
}//end Monster all filled out constructor
public int getStrength()
{
return monsterStrength;
}//get strength
public void setStrength(int s)
{
strength = s;
}//set strength
public String toString()
{
return "Monster Facts:\n"+super.name+
"\nStrength: "+monsterStrength+
"\nHP: "+super.hp+"/"+super.hpTotal;
}
}//end Monster class