Further work on the script interface rework
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ public class HarshSunlight : Script, ILimitedTurnsScript, IScriptChangeBasePower
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public void OnEndTurn(IScriptSource owner, IBattle battle)
|
||||
public virtual void OnEndTurn(IScriptSource owner, IBattle battle)
|
||||
{
|
||||
_duration--;
|
||||
if (_duration <= 0)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Weather;
|
||||
|
||||
[Script(ScriptCategory.Weather, "primordial_sea")]
|
||||
public class PrimordialSea : Rain, IScriptFailMove, IScriptOnEndTurn
|
||||
public class PrimordialSea : Rain, IScriptFailMove, IScriptOnEndTurn, IScriptOnSwitchOut
|
||||
{
|
||||
private HashSet<IPokemon> _placers = new();
|
||||
|
||||
@@ -11,7 +11,7 @@ public class PrimordialSea : Rain, 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)
|
||||
@@ -34,7 +34,7 @@ public class PrimordialSea : Rain, 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
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ public class Rain : Script, ILimitedTurnsScript, IScriptChangeBasePower, IScript
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public void OnEndTurn(IScriptSource owner, IBattle battle)
|
||||
public virtual void OnEndTurn(IScriptSource owner, IBattle battle)
|
||||
{
|
||||
_duration--;
|
||||
if (_duration <= 0)
|
||||
|
||||
@@ -6,7 +6,7 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Weather;
|
||||
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Strong_winds">Bulbapedia - Strong Winds</see>
|
||||
/// </summary>
|
||||
[Script(ScriptCategory.Weather, "strong_winds")]
|
||||
public class StrongWinds : Script
|
||||
public class StrongWinds : Script, IScriptOnSwitchOut
|
||||
{
|
||||
private HashSet<IPokemon> _placers = new();
|
||||
|
||||
@@ -16,7 +16,7 @@ public class StrongWinds : Script
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void OnSwitchOut(IPokemon oldPokemon, byte position)
|
||||
public void OnSwitchOut(IPokemon oldPokemon, byte position)
|
||||
{
|
||||
_placers.Remove(oldPokemon);
|
||||
if (_placers.Count == 0)
|
||||
|
||||
Reference in New Issue
Block a user