-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWarrior.java
More file actions
29 lines (23 loc) · 730 Bytes
/
Copy pathWarrior.java
File metadata and controls
29 lines (23 loc) · 730 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
public class Warrior extends Hero {
public Warrior() {
super();
}
public Warrior(String name) {
super(name);
}
public Warrior(String name, int level, int hp, int mana, int strength, int dexterity, int agility, int exp, int coins) {
super(name, level, hp, mana, strength, dexterity, agility, exp, coins);
}
@Override
public void levelUp() {
super.levelUp();
strength = (int) (strength * 1.1);
dexterity = (int) (dexterity * 1.05);
agility = (int) (agility * 1.1);
}
public Warrior createHero(String attributes) {
Warrior warrior = new Warrior();
warrior.setAttributes(attributes);
return warrior;
}
}