This commit is contained in:
28
Plugins/PkmnLib.Plugin.Gen7/Scripts/Side/SeaOfFireEffect.cs
Normal file
28
Plugins/PkmnLib.Plugin.Gen7/Scripts/Side/SeaOfFireEffect.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user