- Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathFinalBoss.java
More file actions
Latest commit
50 lines (45 loc) · 1.08 KB
/
Copy pathFinalBoss.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
importgreenfoot.*;
/** 500, 135 location
* Write a description of class FinalBoss here.
*
* @author (your name)
* @version (a version number or a date)
*/
publicclassFinalBossextendsMonster
{
publicFinalBoss()
{
super();
GreenfootImageboss = newGreenfootImage("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
*/
publicintattack(Characterplayer)
{
intdamage = 0;
intplayDef = player.getDefense();
damage = ((strength * 5) / playDef) + 6;
if (damage == 0)
damage = 1;
returndamage;
}
/**
* Attack with a magical attack
* @return the amount of damage dealt
*/
publicintcast(Characterplayer)
{
// Do nothing if Monster has no magic attacks
return0;
}
}