-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMonster.java
More file actions
120 lines (103 loc) · 2.2 KB
/
Monster.java
File metadata and controls
120 lines (103 loc) · 2.2 KB
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
package mockTextGameProject;
import java.util.ArrayList;
public class Monster extends Character
{
private String description;
private int id;
private ArrayList<Collectible> itemPouch = new ArrayList<Collectible>();
private String catagory;
public Monster()
{
super.setName(" Godzilla");
super.setCurrentHealth(100);
super.setMaxHealthPoints(100);
super.setCurrentRoom(0);
super.setAttackValue(5);
this.catagory = "Living";
this.description = " A ferocious reptile monster.";
this.id = 0;
}
public Monster(String name, int healthPoints, String description, int id)
{
super.setCurrentHealth(healthPoints);
super.setMaxHealthPoints(healthPoints);
super.setName(name);
this.description = description;
this.id = id;
}
public int attack()
{
return getAttackValue();
}
public void recieveAttack(int attackValue)
{
super.setCurrentHealth(super.getCurrentHealth() - attackValue);
}
/**
* @return the description
*/
public String getDescription()
{
return description;
}
/**
* @param description the description to set
*/
public void setDescription(String description)
{
this.description = description;
}
/**
* @return the id
*/
public int getId()
{
return id;
}
/**
* @param id the id to set
*/
public void setId(int id)
{
this.id = id;
}
/**
* @return the itemPouch
*/
public ArrayList<Collectible> getItemPouch()
{
return itemPouch;
}
/**
* @param itemPouch the itemPouch to set
*/
public void setItemPouch(ArrayList<Collectible> itemPouch)
{
this.itemPouch = itemPouch;
}
/**
* @return the catagory
*/
public String getCatagory()
{
return catagory;
}
/**
* @param catagory the catagory to set
*/
public void setCatagory(String catagory)
{
this.catagory = catagory;
}
/* (non-Javadoc)
* @see java.lang.Object#toString()
*/
@Override
public String toString()
{
return "Monster [description=" + description + ", id=" + id + ", getCurrentRoom()=" + getCurrentRoom()
+ ", getCurrentHealth()=" + getCurrentHealth() + ", getAttackValue()=" + getAttackValue()
+ ", getMaxHealthPoints()=" + getMaxHealthPoints() + ", getName()=" + getName() + ", isAlive()=" + isAlive();
}
//Method talk, attack
}