package org.project.item.weapons;

import org.project.entity.Entity;
import org.project.entity.enemies.Enemy;
import org.project.item.Item;

import java.util.ArrayList;

//The knight's weapon
public class Sword extends Weapon {
    private int abilityCharge;

    public Sword() {
        super(10, 8);
        this.abilityCharge = 0;
    }

    //Bonus method
    public void uniqueAbility(Entity target) {
        abilityCharge += 2;
        int totalDamage = getDamage() + (abilityCharge / 2);

        target.takeDamage(totalDamage);
        if (target instanceof Enemy) {
            ((Enemy) target).setStunned(true);
        }
    }

    public int getAbilityCharge() {
        return abilityCharge;
    }
}
