Adding armors and updating the Armor Class.

This commit is contained in:
2026-05-09 23:28:16 +03:30
parent 0b00500450
commit 3804297a29
6 changed files with 72 additions and 22 deletions
@@ -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!");
}