Further work on the script interface rework

This commit is contained in:
2025-07-05 11:30:18 +02:00
parent 1feb27e826
commit 4499927551
100 changed files with 418 additions and 352 deletions

View File

@@ -1,7 +1,7 @@
namespace PkmnLib.Plugin.Gen7.Scripts.Weather;
[Script(ScriptCategory.Weather, "desolate_lands")]
public class DesolateLands : HarshSunlight, IScriptFailMove, IScriptOnEndTurn
public class DesolateLands : HarshSunlight, IScriptFailMove, IScriptOnEndTurn, IScriptOnSwitchOut
{
private readonly HashSet<IPokemon> _placers = [];
@@ -11,7 +11,7 @@ public class DesolateLands : HarshSunlight, IScriptFailMove, IScriptOnEndTurn
}
/// <inheritdoc />
public override void OnSwitchOut(IPokemon oldPokemon, byte position)
public void OnSwitchOut(IPokemon oldPokemon, byte position)
{
_placers.Remove(oldPokemon);
if (_placers.Count == 0)
@@ -35,7 +35,7 @@ public class DesolateLands : HarshSunlight, IScriptFailMove, IScriptOnEndTurn
}
/// <inheritdoc />
public void OnEndTurn(IScriptSource owner, IBattle battle)
public override void OnEndTurn(IScriptSource owner, IBattle battle)
{
// We don't want to call base.OnEndTurn here, as we want to prevent the weather from ending
}