Deukhoofd 1b9d137bb0
All checks were successful
Build / Build (push) Successful in 50s
Surprisingly, more abilities
2025-06-14 13:37:58 +02:00

26 lines
626 B
C#

using PkmnLib.Plugin.Gen7.Scripts.Status;
namespace PkmnLib.Plugin.Gen7.Scripts.Pokemon;
[Script(ScriptCategory.Pokemon, "nightmare")]
public class NightmareEffect : Script
{
private readonly IPokemon _owner;
public NightmareEffect(IPokemon owner)
{
_owner = owner;
}
/// <inheritdoc />
public override void OnEndTurn(IScriptSource owner, IBattle battle)
{
if (!_owner.HasStatus(ScriptUtils.ResolveName<Sleep>()))
{
RemoveSelf();
return;
}
var maxHp = _owner.MaxHealth;
_owner.Damage(maxHp / 4, DamageSource.Misc);
}
}