-
Notifications
You must be signed in to change notification settings - Fork 47
Expand file tree
/
Copy pathKnight.java
More file actions
33 lines (30 loc) · 1010 Bytes
/
Knight.java
File metadata and controls
33 lines (30 loc) · 1010 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
package org.project.entity.players;
import org.project.entity.Entity;
import org.project.object.armors.Armor;
import org.project.object.weapons.Weapon;
// TODO: UPDATE IMPLEMENTATION
public class Knight extends Player {
public static int BaseAttack = 90;
//constructor
public Knight(String name, Weapon weapon, Armor armor) {
super(name, 1000, 100, weapon, armor);
}
//uses mana for special ability
@Override
public void Special(Entity target) {
if(super.getMp() >= 50) {
super.setMp(super.getMp() - 50);
target.takeDamage(5*BaseAttack);
System.out.printf("%s uses Holy Strike on %s!%n", getName(), target.getClass().getSimpleName());
}
else {
System.out.println("Not enough mana to perform Holy Strike!");
}
}
//leveling up mechanism
@Override
public void levelUP(){
BaseAttack = BaseAttack + (int)(20*Math.sqrt(super.getLevel()+1));
super.levelUP();
}
}