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.Battle;
|
||||
|
||||
[Script(ScriptCategory.Battle, "fairy_lock")]
|
||||
public class FairyLockEffect : Script
|
||||
public class FairyLockEffect : Script, IScriptOnEndTurn
|
||||
{
|
||||
private int _turns = 1;
|
||||
|
||||
@@ -18,7 +18,7 @@ public class FairyLockEffect : Script
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void OnEndTurn(IScriptSource owner, IBattle battle)
|
||||
public void OnEndTurn(IScriptSource owner, IBattle battle)
|
||||
{
|
||||
if (_turns <= 0)
|
||||
RemoveSelf();
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Battle;
|
||||
|
||||
[Script(ScriptCategory.Battle, "future_sight")]
|
||||
public class FutureSightEffect : Script
|
||||
public class FutureSightEffect : Script, IScriptOnEndTurn
|
||||
{
|
||||
private int _turnsLeft = 3;
|
||||
private readonly IMoveChoice _moveChoice;
|
||||
@@ -12,7 +12,7 @@ public class FutureSightEffect : Script
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void OnEndTurn(IScriptSource owner, IBattle battle)
|
||||
public void OnEndTurn(IScriptSource owner, IBattle battle)
|
||||
{
|
||||
_turnsLeft -= 1;
|
||||
if (_turnsLeft <= 0)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Battle;
|
||||
|
||||
[Script(ScriptCategory.Battle, "gravity")]
|
||||
public class Gravity : Script, IScriptFailIncomingMove
|
||||
public class Gravity : Script, IScriptFailIncomingMove, IScriptOnEndTurn
|
||||
{
|
||||
private int _turns = 5;
|
||||
|
||||
@@ -32,7 +32,7 @@ public class Gravity : Script, IScriptFailIncomingMove
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void OnEndTurn(IScriptSource owner, IBattle battle)
|
||||
public void OnEndTurn(IScriptSource owner, IBattle battle)
|
||||
{
|
||||
_turns--;
|
||||
if (_turns > 0)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Battle;
|
||||
|
||||
[Script(ScriptCategory.Battle, "magic_room")]
|
||||
public class MagicRoomEffect : Script, IScriptOnBeforeAnyHookInvoked
|
||||
public class MagicRoomEffect : Script, IScriptOnBeforeAnyHookInvoked, IScriptOnEndTurn
|
||||
{
|
||||
private int _turnsLeft = 5;
|
||||
|
||||
@@ -19,7 +19,7 @@ public class MagicRoomEffect : Script, IScriptOnBeforeAnyHookInvoked
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void OnEndTurn(IScriptSource owner, IBattle battle)
|
||||
public void OnEndTurn(IScriptSource owner, IBattle battle)
|
||||
{
|
||||
if (_turnsLeft > 0)
|
||||
_turnsLeft--;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Battle;
|
||||
|
||||
[Script(ScriptCategory.Battle, "mud_sport")]
|
||||
public class MudSportEffect : Script, IScriptChangeBasePower
|
||||
public class MudSportEffect : Script, IScriptChangeBasePower, IScriptOnEndTurn
|
||||
{
|
||||
private int _turnsLeft = 5;
|
||||
|
||||
@@ -15,7 +15,7 @@ public class MudSportEffect : Script, IScriptChangeBasePower
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void OnEndTurn(IScriptSource owner, IBattle battle)
|
||||
public void OnEndTurn(IScriptSource owner, IBattle battle)
|
||||
{
|
||||
_turnsLeft--;
|
||||
if (_turnsLeft <= 0)
|
||||
|
||||
@@ -4,7 +4,7 @@ using PkmnLib.Dynamic.BattleFlow;
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Battle;
|
||||
|
||||
[Script(ScriptCategory.Battle, "snatch_effect")]
|
||||
public class SnatchEffect : Script, IScriptStopBeforeMove
|
||||
public class SnatchEffect : Script, IScriptStopBeforeMove, IScriptOnEndTurn
|
||||
{
|
||||
private Queue<IPokemon> _snatchers = new();
|
||||
|
||||
@@ -53,7 +53,7 @@ public class SnatchEffect : Script, IScriptStopBeforeMove
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void OnEndTurn(IScriptSource owner, IBattle battle)
|
||||
public void OnEndTurn(IScriptSource owner, IBattle battle)
|
||||
{
|
||||
RemoveSelf();
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Battle;
|
||||
|
||||
[Script(ScriptCategory.Battle, "trick_room")]
|
||||
public class TrickRoomEffect : Script, IScriptChangeSpeed
|
||||
public class TrickRoomEffect : Script, IScriptChangeSpeed, IScriptOnEndTurn
|
||||
{
|
||||
private int _turnsLeft = 5;
|
||||
|
||||
@@ -12,7 +12,7 @@ public class TrickRoomEffect : Script, IScriptChangeSpeed
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void OnEndTurn(IScriptSource owner, IBattle battle)
|
||||
public void OnEndTurn(IScriptSource owner, IBattle battle)
|
||||
{
|
||||
_turnsLeft--;
|
||||
if (_turnsLeft <= 0)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Battle;
|
||||
|
||||
[Script(ScriptCategory.Battle, "uproar_effect")]
|
||||
public class UproarEffect : Script, IScriptOnBeforeTurnStart, IScriptOnSecondaryEffect
|
||||
public class UproarEffect : Script, IScriptOnBeforeTurnStart, IScriptOnSecondaryEffect, IScriptOnEndTurn
|
||||
{
|
||||
private IPokemon? _placer;
|
||||
private bool _hasUsedUproar;
|
||||
@@ -37,7 +37,7 @@ public class UproarEffect : Script, IScriptOnBeforeTurnStart, IScriptOnSecondary
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void OnEndTurn(IScriptSource owner, IBattle battle)
|
||||
public void OnEndTurn(IScriptSource owner, IBattle battle)
|
||||
{
|
||||
if (!_hasUsedUproar)
|
||||
{
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Battle;
|
||||
|
||||
[Script(ScriptCategory.Battle, "water_sport")]
|
||||
public class WaterSportEffect : Script
|
||||
public class WaterSportEffect : Script, IScriptChangeMoveDamage
|
||||
{
|
||||
public readonly HashSet<IPokemon> Placers = new();
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void ChangeMoveDamage(IExecutingMove move, IPokemon target, byte hit, ref uint damage)
|
||||
public void ChangeMoveDamage(IExecutingMove move, IPokemon target, byte hit, ref uint damage)
|
||||
{
|
||||
if (move.UseMove.MoveType.Name == "fire")
|
||||
{
|
||||
|
||||
@@ -2,12 +2,12 @@ using PkmnLib.Static.Moves;
|
||||
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Battle;
|
||||
|
||||
public class WonderRoomEffect : Script
|
||||
public class WonderRoomEffect : Script, IScriptChangeDefensiveStatValue, IScriptOnEndTurn
|
||||
{
|
||||
public int TurnsLeft { get; private set; } = 5;
|
||||
|
||||
/// <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)
|
||||
{
|
||||
value = move.UseMove.Category switch
|
||||
@@ -19,7 +19,7 @@ public class WonderRoomEffect : Script
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void OnEndTurn(IScriptSource owner, IBattle battle)
|
||||
public void OnEndTurn(IScriptSource owner, IBattle battle)
|
||||
{
|
||||
TurnsLeft--;
|
||||
if (TurnsLeft <= 0)
|
||||
|
||||
Reference in New Issue
Block a user