More work on refactor to interfaces
All checks were successful
Build / Build (push) Successful in 50s
All checks were successful
Build / Build (push) Successful in 50s
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
|
||||
public class DesolateLands : HarshSunlight, IScriptFailMove, IScriptOnEndTurn
|
||||
{
|
||||
private readonly HashSet<IPokemon> _placers = [];
|
||||
|
||||
@@ -35,7 +35,7 @@ public class DesolateLands : HarshSunlight, IScriptFailMove
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void OnEndTurn(IScriptSource owner, IBattle battle)
|
||||
public void OnEndTurn(IScriptSource owner, IBattle battle)
|
||||
{
|
||||
// We don't want to call base.OnEndTurn here, as we want to prevent the weather from ending
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Weather;
|
||||
|
||||
[Script(ScriptCategory.Weather, "hail")]
|
||||
public class Hail : Script, ILimitedTurnsScript
|
||||
public class Hail : Script, ILimitedTurnsScript, IScriptOnEndTurn
|
||||
{
|
||||
private int? _duration;
|
||||
|
||||
@@ -15,7 +15,7 @@ public class Hail : Script, ILimitedTurnsScript
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void OnEndTurn(IScriptSource owner, IBattle battle)
|
||||
public void OnEndTurn(IScriptSource owner, IBattle battle)
|
||||
{
|
||||
if (!battle.Library.StaticLibrary.Types.TryGetTypeIdentifier("ice", out var iceType))
|
||||
{
|
||||
|
||||
@@ -6,7 +6,7 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Weather;
|
||||
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Harsh_sunlight">Bulbapedia - Harsh Sunlight</see>
|
||||
/// </summary>
|
||||
[Script(ScriptCategory.Weather, "harsh_sunlight")]
|
||||
public class HarshSunlight : Script, ILimitedTurnsScript, IScriptChangeBasePower
|
||||
public class HarshSunlight : Script, ILimitedTurnsScript, IScriptChangeBasePower, IScriptOnEndTurn
|
||||
{
|
||||
private int? _duration;
|
||||
|
||||
@@ -20,7 +20,7 @@ public class HarshSunlight : Script, ILimitedTurnsScript, IScriptChangeBasePower
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void OnEndTurn(IScriptSource owner, IBattle battle)
|
||||
public 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
|
||||
public class PrimordialSea : Rain, IScriptFailMove, IScriptOnEndTurn
|
||||
{
|
||||
private HashSet<IPokemon> _placers = new();
|
||||
|
||||
@@ -34,7 +34,7 @@ public class PrimordialSea : Rain, IScriptFailMove
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void OnEndTurn(IScriptSource owner, IBattle battle)
|
||||
public void OnEndTurn(IScriptSource owner, IBattle battle)
|
||||
{
|
||||
// We don't want to call base.OnEndTurn here, as we want to prevent the weather from ending
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Weather;
|
||||
|
||||
[Script(ScriptCategory.Weather, "rain")]
|
||||
public class Rain : Script, ILimitedTurnsScript, IScriptChangeBasePower
|
||||
public class Rain : Script, ILimitedTurnsScript, IScriptChangeBasePower, IScriptOnEndTurn
|
||||
{
|
||||
private int? _duration;
|
||||
|
||||
@@ -15,7 +15,7 @@ public class Rain : Script, ILimitedTurnsScript, IScriptChangeBasePower
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void OnEndTurn(IScriptSource owner, IBattle battle)
|
||||
public void OnEndTurn(IScriptSource owner, IBattle battle)
|
||||
{
|
||||
_duration--;
|
||||
if (_duration <= 0)
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Weather;
|
||||
|
||||
[Script(ScriptCategory.Weather, "sandstorm")]
|
||||
public class Sandstorm : Script, IScriptChangeBasePower
|
||||
public class Sandstorm : Script, IScriptChangeBasePower, IScriptChangeDefensiveStatValue, IScriptOnEndTurn
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void OnEndTurn(IScriptSource owner, IBattle battle)
|
||||
public void OnEndTurn(IScriptSource owner, IBattle battle)
|
||||
{
|
||||
foreach (var pokemon in battle.Sides.SelectMany(x => x.Pokemon).WhereNotNull())
|
||||
{
|
||||
@@ -25,7 +25,7 @@ public class Sandstorm : Script, IScriptChangeBasePower
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void ChangeDefensiveStatValue(IExecutingMove move, IPokemon target, byte hit, uint offensiveStat,
|
||||
public void ChangeDefensiveStatValue(IExecutingMove move, IPokemon target, byte hit, uint offensiveStat,
|
||||
ImmutableStatisticSet<uint> targetStats, Statistic stat, ref uint value)
|
||||
{
|
||||
if (stat == Statistic.SpecialDefense && target.Types.Any(x => x.Name == "rock"))
|
||||
|
||||
Reference in New Issue
Block a user