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