package org.project.item.weapons;

import org.project.entity.Entity;

import java.util.ArrayList;

// TODO: UPDATE IMPLEMENTATION
public class Sword extends Weapon {

    /*
    THIS IS AN EXAMPLE OF A WEAPON DESIGN.
    */

    int abilityCharge;

    public Sword() {

        super(
                25,  // damage
                10   // manaCost
        );

        this.abilityCharge = 0;
    }

    // TODO: (BONUS) UPDATE THE UNIQUE ABILITY
    public void uniqueAbility(ArrayList<Entity> targets) {

        abilityCharge += 2;

        System.out.println("Sword Unique Ability Activated!");

        int damage = getDamage();

        // BONUS EFFECT: charged attack
        if (abilityCharge >= 4) {
            damage *= 2;
            abilityCharge = 0;
            System.out.println("POWER STRIKE!");
        }

        for (Entity target : targets) {
            target.takeDamage(damage);
        }
    }
}