package org.project.item.weapons;

import org.project.entity.Entity;

import java.util.List;

/**
 * The Knight's starting weapon. A reliable, high-damage blade.
 *
 * Also keeps the example "unique ability" idea from the skeleton: a sweeping
 * slash that can hit several targets at once (useful in the bonus party mode).
 */
public class Sword extends Weapon {

    private int abilityCharge;

    public Sword() {
        super("Iron Sword", 6, 8, 30);
    }

    /** Constructor overloading: lets the merchant sell fancier swords. */
    public Sword(String name, int damage, int price) {
        super(name, damage, 8, price);
    }

    /** Bonus: a charged sweep that damages every target passed in. */
    public void uniqueAbility(List<Entity> targets) {
        abilityCharge += 2;
        for (Entity target : targets) {
            target.takeDamage(getDamage() + abilityCharge);
        }
    }
}
