Implements AI Switching
All checks were successful
Build / Build (push) Successful in 58s

This commit is contained in:
2025-07-12 13:03:00 +02:00
parent 364d4b9080
commit bf83b25238
34 changed files with 903 additions and 226 deletions

View File

@@ -3,20 +3,20 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Pokemon;
[Script(ScriptCategory.Pokemon, "perish_song")]
public class PerishSongEffect : Script, IScriptOnEndTurn
{
private int _turns;
internal int Turns { get; private set; }
private IPokemon _owner;
public PerishSongEffect(IPokemon owner, int turns = 3)
{
_owner = owner;
_turns = turns;
Turns = turns;
}
/// <inheritdoc />
public void OnEndTurn(IScriptSource owner, IBattle battle)
{
_turns--;
if (_turns <= 0)
Turns--;
if (Turns <= 0)
{
RemoveSelf();
_owner.Faint(DamageSource.Misc);