-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFireMonster.java
45 lines (40 loc) · 1.34 KB
/
FireMonster.java
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
/**
* Write a description of class FireMonster here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class FireMonster extends Monster {
/**
* Passes the necessary variables to Monster.
* @pre: files are in right places
*/
public FireMonster(String name, int x, int y) {
super(name, new Sprite(x, y, 3,"MonsterSprites\\FireMonster Idle 1.png",
"MonsterSprites\\FireMonster Idle 2.png", "MonsterSprites\\FireMonster Moving 1.png",
"MonsterSprites\\FireMonster Moving 2.png"));
}
/**
* Returns the element of the Monster.
* @return: String element of the Monster
*/
public String attackMessage() {
return "Fire";
}
/**
* Checks if the Monster has a type advantage against the other Monster.
* @param: Monster m to compare
* @return: boolean, true if te Monster has a type advantage, false otherwise
*/
public boolean attackAdvantage(Monster m) {
return (m instanceof EarthMonster);
}
/**
* Checks if the Monster has a type disadvantage against the other Monster.
* @param: Monster m to compare
* @return: boolean, true if te Monster has a type disadvantage, false otherwise
*/
public boolean attackDisadvantage(Monster m) {
return (m instanceof WaterMonster);
}
}