Deukhoofd 1feb27e826
All checks were successful
Build / Build (push) Successful in 50s
More work on refactor to interfaces
2025-06-29 12:03:51 +02:00

28 lines
692 B
C#

namespace PkmnLib.Plugin.Gen7.Scripts.Side;
[Script(ScriptCategory.Side, "sea_of_fire_effect")]
public class SeaOfFireEffect : Script, IScriptOnEndTurn
{
private int _turns = 5;
/// <inheritdoc />
public 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);
}
}
}