Deukhoofd 43813c1c1c
All checks were successful
Build / Build (push) Successful in 48s
Implements pledge moves
2025-06-22 12:17:08 +02:00

28 lines
683 B
C#

namespace PkmnLib.Plugin.Gen7.Scripts.Side;
[Script(ScriptCategory.Side, "sea_of_fire_effect")]
public class SeaOfFireEffect : Script
{
private int _turns = 5;
/// <inheritdoc />
public override void OnEndTurn(IScriptSource owner, IBattle battle)
{
if (owner is not IBattleSide side)
return;
_turns--;
if (_turns <= 0)
{
RemoveSelf();
return;
}
foreach (var pokemon in side.Pokemon.WhereNotNull())
{
if (pokemon.Types.Any(x => x.Name == "fire"))
continue;
pokemon.Damage(pokemon.MaxHealth / 8, DamageSource.Misc);
}
}
}