Adding armors and updating the Armor Class.
This commit is contained in:
@@ -3,12 +3,14 @@ package org.project.entity.players;
|
||||
import org.project.entity.Entity;
|
||||
import org.project.entity.enemies.Enemy;
|
||||
import org.project.item.armors.Armor;
|
||||
import org.project.item.weapons.Sword;
|
||||
import org.project.item.weapons.Weapon;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
|
||||
public class Knight extends Player {
|
||||
Sword sword = new Sword()
|
||||
public Knight(String name, Weapon weapon, Armor armor) {
|
||||
super(name, 45, 45, weapon, armor);
|
||||
}
|
||||
@@ -23,13 +25,12 @@ public class Knight extends Player {
|
||||
}
|
||||
|
||||
//Consuming mana
|
||||
super.setMp(super.getMp()-15);
|
||||
super.setMp(getMp()-15);
|
||||
|
||||
//Stunning the enemies
|
||||
target.takeDamage(25);
|
||||
if (target instanceof Enemy) {
|
||||
((Enemy) target).setStunned(true);
|
||||
}
|
||||
if (getWeapon() instanceof Sword) {
|
||||
((Sword) getWeapon()).uniqueAbility(target);
|
||||
}
|
||||
|
||||
System.out.println("💥 Shield Bash! Enemy is stunned!");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user