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() {
        // TODO: DESIGN SWORD'S ATTRIBUTES IMPLEMENT THE CONSTRUCTOR
        // Added default sword stats based on the combat system requirements.
        super(15, 5);

        // Initialize ability charge for gameplay progression.
        this.abilityCharge = 0;
    }

    // TODO: (BONUS) UPDATE THE UNIQUE ABILITY
    // Added a sword-specific multi-target attack ability.
    // The ability gains charge after each use and damages all enemies in range.
    public void uniqueAbility(ArrayList<Entity> targets) {
        abilityCharge++;
        for (Entity target : targets) {
            target.takeDamage(getDamage());
        }
    }
    // Added item identity methods required by the Item contract.
    @Override
    public String getName() {
        return "Sword";
    }

    @Override
    public String getDescription() {
        return "A balanced melee weapon used by knights.";
    }

    @Override
    public int getValue() {
        return 100;
    }
}
