forked from TechHead27/EW
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFinalBoss.java
More file actions
50 lines (45 loc) · 1.08 KB
/
FinalBoss.java
File metadata and controls
50 lines (45 loc) · 1.08 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
import greenfoot.*;
/** 500, 135 location
* Write a description of class FinalBoss here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class FinalBoss extends Monster
{
public FinalBoss()
{
super();
GreenfootImage boss = new GreenfootImage("images/monsters/toilet.png");
boss.scale(350, 350);
setImage(boss);
health = 250;
strength = 10;
defense = 10;
piety = 0;
will = 8;
speed = 9001;
}
/**
* Attack with a physical attack
* @return the amount of damage dealt
*/
public int attack(Character player)
{
int damage = 0;
int playDef = player.getDefense();
damage = ((strength * 5) / playDef) + 6;
if (damage == 0)
damage = 1;
return damage;
}
/**
* Attack with a magical attack
* @return the amount of damage dealt
*/
public int cast(Character player)
{
// Do nothing if Monster has no magic attacks
return 0;
}
}