-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMage.java
More file actions
37 lines (32 loc) · 1.23 KB
/
Copy pathMage.java
File metadata and controls
37 lines (32 loc) · 1.23 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
package org.example.entities.characters;
//import java.lang.Character;
//Class used to implement the Mage character class
public class Mage extends Character {
public Mage(String name, int currentExp, int level) {
super(name,currentExp,level,3,2,5,150,200);
this.imuneIce = true;
}
@Override
public String toString() {
return "Mage stats : Name : " + this.name + " Level : " + this.currentLevel + " Experience : " + this.currentExperience + "/" + this.currentLevel*10 + " Damage : " + this.getDamage() + " Health : " + this.getCurrentHealth() + " Mana : " + this.getCurrentMana();
}
//Method used to receive damage
@Override
public void receiveDamage(int damage) {
//int receivedDamage = damage;
//The secondary atributes lower damage
damage -= this.dexterityLevel * 2;
damage -= this.strengthLevel ;
if (damage > 0)
this.currentHealth -= damage;
if (this.currentHealth <= 0) {
this.currentHealth = 0;
}
}
//Method used to deal damage
@Override
public int getDamage() {
//The main atribute affects damage
return 10 + this.charismaLevel * 5;
}
}