package org.project.entity.players;

import org.project.entity.Entity;
import org.project.item.weapons.Sword;
import org.project.item.weapons.Weapon;

// TODO: UPDATE IMPLEMENTATION
public class Knight extends Player {
    // TODO: DESIGN KNIGHT'S WEAPON AND ARMOR AND IMPLEMENT THE CONSTRUCTOR
    public Knight(String name) {
        super(name, 80, 50, null, null, "Knight",
                0, 80, 50);

    }

    public void lightAttack(Entity target) {
        int damage = 20;
        System.out.println(name + " (Knight) used Light Attack! (0 MP)");
        target.takeDamage(damage);
        System.out.println(name + " MP: " + getMP() + "/" + getMaxMP());
    }

    public void heavyAttack(Entity target) {
        if (getMP() >= 8) {
            fillMana(-8);
            int damage = 35;
            System.out.println(name + " (Knight) used Heavy Attack! (-8 MP)");
            target.takeDamage(damage);
        }
        else {
            System.out.println("Not enough MP for Heavy Attack! (Need 8, have " + getMP() + ")");
        }
        System.out.println(name + " MP: " + getMP() + "/" + getMaxMP());
    }
    @Override
    public void heal(int health) {
        if (getMP() >= 12) {
            fillMana(-12);
            super.heal(health);
            System.out.println(name + " used Heal! (-12 MP)");
        } else {
            System.out.println("Not enough MP to heal! (Need 12, have " + getMP() + ")");
        }
        System.out.println(name + " MP: " + getMP() + "/" + getMaxMP());
    }

    public void specialAbility(Entity target) {
        if (getMP() >= 15) {
            fillMana(-15);
            int damage = 40;
            System.out.println(name + " (Knight) used SHIELD BASH! (-15 MP)");
            System.out.println("The enemy is STUNNED and loses their next turn!");
            target.takeDamage(damage);
        }
        else
            System.out.println("Not enough MP for Shield Bash! (Need 15, have " + getMP() + ")");
        System.out.println(name + " MP: " + getMP() + "/" + getMaxMP());
    }

}
