namespace PkmnLib.Plugin.Gen7.Scripts.Pokemon;

[Script(ScriptCategory.Pokemon, "ghostcurse")]
public class GhostCurseEffect : Script, IScriptOnEndTurn, IAIInfoScriptExpectedEndOfTurnDamage
{
    private IPokemon _pokemon;

    public GhostCurseEffect(IPokemon pokemon)
    {
        _pokemon = pokemon;
    }

    /// <inheritdoc />
    public void OnEndTurn(IScriptSource owner, IBattle battle)
    {
        _pokemon.Damage(_pokemon.MaxHealth / 4, DamageSource.Misc);
    }

    /// <inheritdoc />
    public void ExpectedEndOfTurnDamage(IPokemon pokemon, ref int damage)
    {
        damage += (int)(_pokemon.MaxHealth / 4f);
    }
}