Refactor move classes to implement respective interfaces for better structure
All checks were successful
Build / Build (push) Successful in 52s
All checks were successful
Build / Build (push) Successful in 52s
This commit is contained in:
@@ -14,10 +14,10 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
/// If the other Pokémon in the user's party do not know any eligible moves, Assist fails.
|
||||
/// </remarks>
|
||||
[Script(ScriptCategory.Move, "assist")]
|
||||
public class Assist : Script
|
||||
public class Assist : Script, IScriptChangeMove
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void ChangeMove(IMoveChoice choice, ref StringKey moveName)
|
||||
public void ChangeMove(IMoveChoice choice, ref StringKey moveName)
|
||||
{
|
||||
var user = choice.User;
|
||||
if (user.BattleData == null)
|
||||
|
||||
@@ -2,11 +2,12 @@ using PkmnLib.Plugin.Gen7.Scripts.Pokemon;
|
||||
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
public abstract class BaseChargeMove<TVolatile> : Script where TVolatile : RequireChargeEffect
|
||||
public abstract class BaseChargeMove<TVolatile> : Script, IScriptPreventMove, IScriptOnBeforeMove
|
||||
where TVolatile : RequireChargeEffect
|
||||
{
|
||||
public abstract TVolatile CreateVolatile(IPokemon user);
|
||||
|
||||
public override void PreventMove(IExecutingMove move, ref bool prevent)
|
||||
public void PreventMove(IExecutingMove move, ref bool prevent)
|
||||
{
|
||||
if (move.User.Volatile.Contains<TVolatile>())
|
||||
return;
|
||||
@@ -20,7 +21,7 @@ public abstract class BaseChargeMove<TVolatile> : Script where TVolatile : Requi
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void OnBeforeMove(IExecutingMove move)
|
||||
public void OnBeforeMove(IExecutingMove move)
|
||||
{
|
||||
move.User.Volatile.Remove(ScriptUtils.ResolveName<TVolatile>());
|
||||
}
|
||||
|
||||
@@ -3,10 +3,10 @@ using PkmnLib.Plugin.Gen7.Scripts.Pokemon;
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
[Script(ScriptCategory.Move, "beak_blast")]
|
||||
public class BeakBlast : Script
|
||||
public class BeakBlast : Script, IScriptOnBeforeTurnStart
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void OnBeforeTurnStart(ITurnChoice choice)
|
||||
public void OnBeforeTurnStart(ITurnChoice choice)
|
||||
{
|
||||
var battleData = choice.User.BattleData;
|
||||
if (battleData == null)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
[Script(ScriptCategory.Move, "beat_up")]
|
||||
public class BeatUp : Script
|
||||
public class BeatUp : Script, IScriptChangeNumberOfHits
|
||||
{
|
||||
private IPokemon[]? _relevantPartyMembers;
|
||||
|
||||
@@ -16,7 +16,7 @@ public class BeatUp : Script
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void ChangeNumberOfHits(IMoveChoice choice, ref byte numberOfHits)
|
||||
public void ChangeNumberOfHits(IMoveChoice choice, ref byte numberOfHits)
|
||||
{
|
||||
var relevantPartyMembers = _relevantPartyMembers ??= GetRelevantPartyMembers(choice.User).ToArray();
|
||||
|
||||
|
||||
@@ -3,10 +3,10 @@ using PkmnLib.Plugin.Gen7.Scripts.Pokemon;
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
[Script(ScriptCategory.Move, "bounce")]
|
||||
public class Bounce : Script
|
||||
public class Bounce : Script, IScriptPreventMove, IScriptOnBeforeMove
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void PreventMove(IExecutingMove move, ref bool prevent)
|
||||
public void PreventMove(IExecutingMove move, ref bool prevent)
|
||||
{
|
||||
if (move.User.Volatile.Contains<ChargeBounceEffect>())
|
||||
return;
|
||||
@@ -20,7 +20,7 @@ public class Bounce : Script
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void OnBeforeMove(IExecutingMove move)
|
||||
public void OnBeforeMove(IExecutingMove move)
|
||||
{
|
||||
move.User.Volatile.Remove(ScriptUtils.ResolveName<ChargeBounceEffect>());
|
||||
}
|
||||
|
||||
@@ -3,10 +3,10 @@ using PkmnLib.Plugin.Gen7.Scripts.Side;
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
[Script(ScriptCategory.Move, "brick_break")]
|
||||
public class BrickBreak : Script
|
||||
public class BrickBreak : Script, IScriptOnBeforeMove
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void OnBeforeMove(IExecutingMove move)
|
||||
public void OnBeforeMove(IExecutingMove move)
|
||||
{
|
||||
var sides = move.User.BattleData?.Battle.Sides;
|
||||
if (sides == null)
|
||||
|
||||
@@ -3,9 +3,9 @@ using PkmnLib.Plugin.Gen7.Scripts.Pokemon;
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
[Script(ScriptCategory.Move, "charge_move")]
|
||||
public class ChargeMove : Script
|
||||
public class ChargeMove : Script, IScriptPreventMove
|
||||
{
|
||||
public override void PreventMove(IExecutingMove move, ref bool prevent)
|
||||
public void PreventMove(IExecutingMove move, ref bool prevent)
|
||||
{
|
||||
var args = new CustomTriggers.BypassChargeMoveArgs(move, false);
|
||||
move.RunScriptHook(script => script.CustomTrigger(CustomTriggers.BypassChargeMove, args));
|
||||
|
||||
@@ -3,10 +3,10 @@ using PkmnLib.Plugin.Gen7.Scripts.Utils;
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
[Script(ScriptCategory.Move, "copycat")]
|
||||
public class Copycat : Script
|
||||
public class Copycat : Script, IScriptChangeMove
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void ChangeMove(IMoveChoice choice, ref StringKey moveName)
|
||||
public void ChangeMove(IMoveChoice choice, ref StringKey moveName)
|
||||
{
|
||||
var lastMove = choice.User.BattleData?.Battle.PreviousTurnChoices.SelectMany(x => x).OfType<IMoveChoice>()
|
||||
.LastOrDefault();
|
||||
|
||||
@@ -3,16 +3,16 @@ using PkmnLib.Plugin.Gen7.Scripts.Pokemon;
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
[Script(ScriptCategory.Move, "counter")]
|
||||
public class Counter : Script
|
||||
public class Counter : Script, IScriptOnBeforeTurnStart, IScriptChangeTargets
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void OnBeforeTurnStart(ITurnChoice choice)
|
||||
public void OnBeforeTurnStart(ITurnChoice choice)
|
||||
{
|
||||
choice.User.Volatile.Add(new CounterHelperEffect());
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void ChangeTargets(IMoveChoice moveChoice, ref IReadOnlyList<IPokemon?> targets)
|
||||
public void ChangeTargets(IMoveChoice moveChoice, ref IReadOnlyList<IPokemon?> targets)
|
||||
{
|
||||
var counterHelper = moveChoice.User.Volatile.Get<CounterHelperEffect>();
|
||||
var lastHitBy = counterHelper?.LastHitBy;
|
||||
|
||||
@@ -3,10 +3,10 @@ using PkmnLib.Plugin.Gen7.Scripts.Pokemon;
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
[Script(ScriptCategory.Move, "dig")]
|
||||
public class Dig : Script
|
||||
public class Dig : Script, IScriptPreventMove, IScriptOnBeforeMove
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void PreventMove(IExecutingMove move, ref bool prevent)
|
||||
public void PreventMove(IExecutingMove move, ref bool prevent)
|
||||
{
|
||||
if (move.User.Volatile.Contains<DigEffect>())
|
||||
return;
|
||||
@@ -20,7 +20,7 @@ public class Dig : Script
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void OnBeforeMove(IExecutingMove move)
|
||||
public void OnBeforeMove(IExecutingMove move)
|
||||
{
|
||||
move.User.Volatile.Remove(ScriptUtils.ResolveName<DigEffect>());
|
||||
}
|
||||
|
||||
@@ -3,10 +3,10 @@ using PkmnLib.Plugin.Gen7.Scripts.Pokemon;
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
[Script(ScriptCategory.Move, "dive")]
|
||||
public class Dive : Script
|
||||
public class Dive : Script, IScriptPreventMove
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void PreventMove(IExecutingMove move, ref bool prevent)
|
||||
public void PreventMove(IExecutingMove move, ref bool prevent)
|
||||
{
|
||||
if (move.User.Volatile.Contains<DiveEffect>())
|
||||
return;
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
[Script(ScriptCategory.Move, "2_hit_move")]
|
||||
public class DoubleHitMove : Script
|
||||
public class DoubleHitMove : Script, IScriptChangeNumberOfHits
|
||||
{
|
||||
public override void ChangeNumberOfHits(IMoveChoice choice, ref byte numberOfHits)
|
||||
public void ChangeNumberOfHits(IMoveChoice choice, ref byte numberOfHits)
|
||||
{
|
||||
numberOfHits = 2;
|
||||
}
|
||||
|
||||
@@ -3,10 +3,10 @@ using PkmnLib.Plugin.Gen7.Scripts.Side;
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
[Script(ScriptCategory.Move, "double_power_if_target_damaged_in_turn")]
|
||||
public class DoublePowerIfTargetDamagedInTurn : Script
|
||||
public class DoublePowerIfTargetDamagedInTurn : Script, IScriptOnBeforeTurnStart
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void OnBeforeTurnStart(ITurnChoice choice)
|
||||
public void OnBeforeTurnStart(ITurnChoice choice)
|
||||
{
|
||||
if (choice is IMoveChoice moveChoice)
|
||||
{
|
||||
|
||||
@@ -3,10 +3,10 @@ using PkmnLib.Plugin.Gen7.Scripts.Pokemon;
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
[Script(ScriptCategory.Move, "fake_out")]
|
||||
public class FakeOut : Script
|
||||
public class FakeOut : Script, IScriptStopBeforeMove
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void StopBeforeMove(IExecutingMove move, ref bool stop)
|
||||
public void StopBeforeMove(IExecutingMove move, ref bool stop)
|
||||
{
|
||||
var battleData = move.User.BattleData;
|
||||
if (battleData == null)
|
||||
|
||||
@@ -3,10 +3,10 @@ using PkmnLib.Plugin.Gen7.Scripts.MoveVolatile;
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
[Script(ScriptCategory.Move, "fire_pledge")]
|
||||
public class FirePledge : Script
|
||||
public class FirePledge : Script, IScriptStopBeforeMove
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void StopBeforeMove(IExecutingMove move, ref bool stop)
|
||||
public void StopBeforeMove(IExecutingMove move, ref bool stop)
|
||||
{
|
||||
if (move.MoveChoice.Volatile.Contains<FireWaterPledgeMove>() ||
|
||||
move.MoveChoice.Volatile.Contains<FireGrassPledgeMove>())
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
[Script(ScriptCategory.Move, "first_impression")]
|
||||
public class FirstImpression : Script
|
||||
public class FirstImpression : Script, IScriptStopBeforeMove
|
||||
{
|
||||
public override void StopBeforeMove(IExecutingMove move, ref bool stop)
|
||||
public void StopBeforeMove(IExecutingMove move, ref bool stop)
|
||||
{
|
||||
var battleData = move.User.BattleData;
|
||||
if (battleData == null)
|
||||
|
||||
@@ -3,10 +3,10 @@ using PkmnLib.Plugin.Gen7.Scripts.Pokemon;
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
[Script(ScriptCategory.Move, "fly")]
|
||||
public class Fly : Script
|
||||
public class Fly : Script, IScriptPreventMove, IScriptOnBeforeMove
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void PreventMove(IExecutingMove move, ref bool prevent)
|
||||
public void PreventMove(IExecutingMove move, ref bool prevent)
|
||||
{
|
||||
if (move.User.Volatile.Contains<ChargeFlyEffect>())
|
||||
return;
|
||||
@@ -20,7 +20,7 @@ public class Fly : Script
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void OnBeforeMove(IExecutingMove move)
|
||||
public void OnBeforeMove(IExecutingMove move)
|
||||
{
|
||||
move.User.Volatile.Remove(ScriptUtils.ResolveName<ChargeFlyEffect>());
|
||||
}
|
||||
|
||||
@@ -3,10 +3,10 @@ using PkmnLib.Plugin.Gen7.Scripts.Pokemon;
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
[Script(ScriptCategory.Move, "focus_punch")]
|
||||
public class FocusPunch : Script
|
||||
public class FocusPunch : Script, IScriptOnBeforeTurnStart, IScriptPreventMove
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void OnBeforeTurnStart(ITurnChoice choice)
|
||||
public void OnBeforeTurnStart(ITurnChoice choice)
|
||||
{
|
||||
choice.User.Volatile.Add(new FocusPunchEffect());
|
||||
choice.User.BattleData?.Battle.EventHook.Invoke(new DialogEvent("focus_punch_charge",
|
||||
@@ -17,7 +17,7 @@ public class FocusPunch : Script
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void PreventMove(IExecutingMove move, ref bool prevent)
|
||||
public void PreventMove(IExecutingMove move, ref bool prevent)
|
||||
{
|
||||
var focusPunchEffect = move.User.Volatile.Get<FocusPunchEffect>();
|
||||
if (focusPunchEffect == null || focusPunchEffect.WasHit)
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
[Script(ScriptCategory.Move, "follow_me")]
|
||||
public class FollowMe : Script
|
||||
public class FollowMe : Script, IScriptChangeTargets
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void ChangeTargets(IMoveChoice moveChoice, ref IReadOnlyList<IPokemon?> targets)
|
||||
public void ChangeTargets(IMoveChoice moveChoice, ref IReadOnlyList<IPokemon?> targets)
|
||||
{
|
||||
if (targets.Count != 1)
|
||||
return;
|
||||
|
||||
@@ -3,10 +3,10 @@ using PkmnLib.Plugin.Gen7.Scripts.Battle;
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
[Script(ScriptCategory.Move, "future_sight")]
|
||||
public class FutureSight : Script
|
||||
public class FutureSight : Script, IScriptStopBeforeMove
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void StopBeforeMove(IExecutingMove move, ref bool prevent)
|
||||
public void StopBeforeMove(IExecutingMove move, ref bool prevent)
|
||||
{
|
||||
var battleData = move.User.BattleData;
|
||||
if (battleData == null)
|
||||
|
||||
@@ -3,10 +3,10 @@ using PkmnLib.Plugin.Gen7.Scripts.MoveVolatile;
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
[Script(ScriptCategory.Move, "grass_pledge")]
|
||||
public class GrassPledge : Script
|
||||
public class GrassPledge : Script, IScriptStopBeforeMove
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void StopBeforeMove(IExecutingMove move, ref bool stop)
|
||||
public void StopBeforeMove(IExecutingMove move, ref bool stop)
|
||||
{
|
||||
if (move.MoveChoice.Volatile.Contains<GrassWaterPledgeMove>() ||
|
||||
move.MoveChoice.Volatile.Contains<FireGrassPledgeMove>())
|
||||
|
||||
@@ -3,10 +3,10 @@ using PkmnLib.Plugin.Gen7.Scripts.MoveVolatile;
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
[Script(ScriptCategory.Move, "me_first")]
|
||||
public class MeFirst : Script
|
||||
public class MeFirst : Script, IScriptChangeMove
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void ChangeMove(IMoveChoice choice, ref StringKey moveName)
|
||||
public void ChangeMove(IMoveChoice choice, ref StringKey moveName)
|
||||
{
|
||||
var battleData = choice.User.BattleData;
|
||||
if (battleData == null)
|
||||
|
||||
@@ -3,10 +3,10 @@ using PkmnLib.Static.Moves;
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
[Script(ScriptCategory.Move, "metal_burst")]
|
||||
public class MetalBurst : Script
|
||||
public class MetalBurst : Script, IScriptOnBeforeTurnStart
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void OnBeforeTurnStart(ITurnChoice choice)
|
||||
public void OnBeforeTurnStart(ITurnChoice choice)
|
||||
{
|
||||
choice.User.Volatile.Add(new MetalBurstHelper());
|
||||
}
|
||||
|
||||
@@ -3,10 +3,10 @@ using PkmnLib.Plugin.Gen7.Scripts.Utils;
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
[Script(ScriptCategory.Move, "metronome")]
|
||||
public class Metronome : Script
|
||||
public class Metronome : Script, IScriptChangeMove
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void ChangeMove(IMoveChoice choice, ref StringKey moveName)
|
||||
public void ChangeMove(IMoveChoice choice, ref StringKey moveName)
|
||||
{
|
||||
var battleData = choice.User.BattleData;
|
||||
if (battleData == null)
|
||||
|
||||
@@ -3,10 +3,10 @@ using PkmnLib.Static.Moves;
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
[Script(ScriptCategory.Move, "mirror_coat")]
|
||||
public class MirrorCoat : Script
|
||||
public class MirrorCoat : Script, IScriptOnBeforeTurnStart
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void OnBeforeTurnStart(ITurnChoice choice)
|
||||
public void OnBeforeTurnStart(ITurnChoice choice)
|
||||
{
|
||||
choice.User.Volatile.Add(new MirrorCoatHelper());
|
||||
}
|
||||
|
||||
@@ -3,10 +3,10 @@ using PkmnLib.Plugin.Gen7.Scripts.Utils;
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
[Script(ScriptCategory.Move, "mirror_move")]
|
||||
public class MirrorMove : Script
|
||||
public class MirrorMove : Script, IScriptChangeMove
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void ChangeMove(IMoveChoice choice, ref StringKey moveName)
|
||||
public void ChangeMove(IMoveChoice choice, ref StringKey moveName)
|
||||
{
|
||||
var battleData = choice.User.BattleData;
|
||||
if (battleData == null)
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
[Script(ScriptCategory.Move, "2_5_hit_move")]
|
||||
public class MultiHitMove : Script
|
||||
public class MultiHitMove : Script, IScriptChangeNumberOfHits
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void ChangeNumberOfHits(IMoveChoice choice, ref byte numberOfHits)
|
||||
public void ChangeNumberOfHits(IMoveChoice choice, ref byte numberOfHits)
|
||||
{
|
||||
var random = choice.User.BattleData?.Battle.Random;
|
||||
if (random == null)
|
||||
|
||||
@@ -4,10 +4,10 @@ using PkmnLib.Static.Moves;
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
[Script(ScriptCategory.Move, "nature_power")]
|
||||
public class NaturePower : Script
|
||||
public class NaturePower : Script, IScriptChangeMove
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void ChangeMove(IMoveChoice choice, ref StringKey moveName)
|
||||
public void ChangeMove(IMoveChoice choice, ref StringKey moveName)
|
||||
{
|
||||
var battleData = choice.User.BattleData;
|
||||
if (battleData is null)
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
[Script(ScriptCategory.Move, "parabolic_charge")]
|
||||
public class ParabolicCharge : Script
|
||||
public class ParabolicCharge : Script, IScriptOnAfterMove
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void OnAfterMove(IExecutingMove move)
|
||||
public void OnAfterMove(IExecutingMove move)
|
||||
{
|
||||
if (move.User.IsFainted)
|
||||
return;
|
||||
|
||||
@@ -7,10 +7,10 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
/// and attacks on the second turn.
|
||||
/// </summary>
|
||||
[Script(ScriptCategory.Move, "phantom_force")]
|
||||
public class PhantomForce : Script
|
||||
public class PhantomForce : Script, IScriptPreventMove
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void PreventMove(IExecutingMove move, ref bool prevent)
|
||||
public void PreventMove(IExecutingMove move, ref bool prevent)
|
||||
{
|
||||
if (move.User.Volatile.Contains<PhantomForceCharge>())
|
||||
return;
|
||||
|
||||
@@ -3,10 +3,10 @@ using PkmnLib.Plugin.Gen7.Scripts.Pokemon;
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
[Script(ScriptCategory.Move, "pursuit")]
|
||||
public class Pursuit : Script
|
||||
public class Pursuit : Script, IScriptOnBeforeTurnStart, IScriptOnAfterMove
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void OnBeforeTurnStart(ITurnChoice choice)
|
||||
public void OnBeforeTurnStart(ITurnChoice choice)
|
||||
{
|
||||
if (choice is IMoveChoice moveChoice)
|
||||
choice.User.Volatile.Add(new PursuitEffect(moveChoice));
|
||||
@@ -17,5 +17,5 @@ public class Pursuit : Script
|
||||
move.User.Volatile.Remove<PursuitEffect>();
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void OnAfterMove(IExecutingMove move) => move.User.Volatile.Remove<PursuitEffect>();
|
||||
public void OnAfterMove(IExecutingMove move) => move.User.Volatile.Remove<PursuitEffect>();
|
||||
}
|
||||
@@ -3,10 +3,10 @@ using PkmnLib.Plugin.Gen7.Scripts.Pokemon;
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
[Script(ScriptCategory.Move, "razor_wind")]
|
||||
public class RazorWind : Script
|
||||
public class RazorWind : Script, IScriptPreventMove
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void PreventMove(IExecutingMove move, ref bool prevent)
|
||||
public void PreventMove(IExecutingMove move, ref bool prevent)
|
||||
{
|
||||
var chargeMoveEffect = move.User.Volatile.Get<ChargeMoveEffect>();
|
||||
if (chargeMoveEffect != null && chargeMoveEffect.MoveName == move.UseMove.Name)
|
||||
|
||||
@@ -3,10 +3,10 @@ using PkmnLib.Plugin.Gen7.Scripts.MoveVolatile;
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
[Script(ScriptCategory.Move, "round")]
|
||||
public class Round : Script
|
||||
public class Round : Script, IScriptOnAfterMove
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void OnAfterMove(IExecutingMove move)
|
||||
public void OnAfterMove(IExecutingMove move)
|
||||
{
|
||||
var choiceQueue = move.Battle.ChoiceQueue;
|
||||
if (choiceQueue is null)
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
[Script(ScriptCategory.Move, "self_destruct")]
|
||||
public class SelfDestruct : Script
|
||||
public class SelfDestruct : Script, IScriptOnAfterMove
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void OnAfterMove(IExecutingMove move)
|
||||
public void OnAfterMove(IExecutingMove move)
|
||||
{
|
||||
if (move.User.IsFainted)
|
||||
return;
|
||||
|
||||
@@ -3,10 +3,10 @@ using PkmnLib.Plugin.Gen7.Scripts.Pokemon;
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
[Script(ScriptCategory.Move, "shadow_force")]
|
||||
public class ShadowForce : Script
|
||||
public class ShadowForce : Script, IScriptPreventMove
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void PreventMove(IExecutingMove move, ref bool prevent)
|
||||
public void PreventMove(IExecutingMove move, ref bool prevent)
|
||||
{
|
||||
if (move.User.Volatile.Contains<ShadowForceCharge>())
|
||||
return;
|
||||
|
||||
@@ -3,16 +3,16 @@ using PkmnLib.Plugin.Gen7.Scripts.Pokemon;
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
[Script(ScriptCategory.Move, "shell_trap")]
|
||||
public class ShellTrap : Script
|
||||
public class ShellTrap : Script, IScriptOnBeforeMove, IScriptFailMove
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void OnBeforeMove(IExecutingMove move)
|
||||
public void OnBeforeMove(IExecutingMove move)
|
||||
{
|
||||
move.User.Volatile.Add(new ShellTrapHelper());
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void FailMove(IExecutingMove move, ref bool fail)
|
||||
public void FailMove(IExecutingMove move, ref bool fail)
|
||||
{
|
||||
var shellTrapHelper = move.User.Volatile.Get<ShellTrapHelper>();
|
||||
if (shellTrapHelper is not { HasHit: true })
|
||||
|
||||
@@ -3,10 +3,10 @@ using PkmnLib.Plugin.Gen7.Scripts.Pokemon;
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
[Script(ScriptCategory.Move, "skull_bash")]
|
||||
public class SkullBash : Script
|
||||
public class SkullBash : Script, IScriptPreventMove
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void PreventMove(IExecutingMove move, ref bool prevent)
|
||||
public void PreventMove(IExecutingMove move, ref bool prevent)
|
||||
{
|
||||
if (move.User.Volatile.Contains<SkullBashEffect>())
|
||||
return;
|
||||
|
||||
@@ -3,10 +3,10 @@ using PkmnLib.Plugin.Gen7.Scripts.Pokemon;
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
[Script(ScriptCategory.Move, "sky_attack")]
|
||||
public class SkyAttack : Script
|
||||
public class SkyAttack : Script, IScriptPreventMove
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void PreventMove(IExecutingMove move, ref bool prevent)
|
||||
public void PreventMove(IExecutingMove move, ref bool prevent)
|
||||
{
|
||||
if (move.User.Volatile.Contains<SkyAttackEffect>())
|
||||
return;
|
||||
|
||||
@@ -3,10 +3,10 @@ using PkmnLib.Plugin.Gen7.Scripts.Pokemon;
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
[Script(ScriptCategory.Move, "sky_drop")]
|
||||
public class SkyDrop : Script
|
||||
public class SkyDrop : Script, IScriptPreventMove, IScriptOnBeforeMove
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void PreventMove(IExecutingMove move, ref bool prevent)
|
||||
public void PreventMove(IExecutingMove move, ref bool prevent)
|
||||
{
|
||||
if (move.User.Volatile.Contains<ChargeSkyDropEffect>())
|
||||
return;
|
||||
@@ -20,7 +20,7 @@ public class SkyDrop : Script
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void OnBeforeMove(IExecutingMove move)
|
||||
public void OnBeforeMove(IExecutingMove move)
|
||||
{
|
||||
move.User.Volatile.Remove(ScriptUtils.ResolveName<ChargeSkyDropEffect>());
|
||||
}
|
||||
|
||||
@@ -4,10 +4,10 @@ using PkmnLib.Plugin.Gen7.Scripts.Utils;
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
[Script(ScriptCategory.Move, "sleep_talk")]
|
||||
public class SleepTalk : Script
|
||||
public class SleepTalk : Script, IScriptChangeMove
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void ChangeMove(IMoveChoice choice, ref StringKey moveName)
|
||||
public void ChangeMove(IMoveChoice choice, ref StringKey moveName)
|
||||
{
|
||||
if (!choice.User.HasStatus(ScriptUtils.ResolveName<Status.Sleep>()))
|
||||
{
|
||||
|
||||
@@ -3,10 +3,10 @@ using PkmnLib.Plugin.Gen7.Scripts.Pokemon;
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
[Script(ScriptCategory.Move, "snore")]
|
||||
public class Snore : Script
|
||||
public class Snore : Script, IScriptFailMove
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void FailMove(IExecutingMove move, ref bool fail)
|
||||
public void FailMove(IExecutingMove move, ref bool fail)
|
||||
{
|
||||
if (!move.User.HasStatus(ScriptUtils.ResolveName<Status.Sleep>()))
|
||||
fail = true;
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
[Script(ScriptCategory.Move, "struggle")]
|
||||
public class Struggle : Script
|
||||
public class Struggle : Script, IScriptChangeNumberOfHits
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void ChangeNumberOfHits(IMoveChoice choice, ref byte numberOfHits)
|
||||
public void ChangeNumberOfHits(IMoveChoice choice, ref byte numberOfHits)
|
||||
{
|
||||
numberOfHits = 1;
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
[Script(ScriptCategory.Move, "synchronoise")]
|
||||
public class Synchronoise : Script
|
||||
public class Synchronoise : Script, IScriptChangeTargets
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void ChangeTargets(IMoveChoice moveChoice, ref IReadOnlyList<IPokemon?> targets)
|
||||
public void ChangeTargets(IMoveChoice moveChoice, ref IReadOnlyList<IPokemon?> targets)
|
||||
{
|
||||
var battleData = moveChoice.User.BattleData;
|
||||
if (battleData == null)
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
[Script(ScriptCategory.Move, "triple_kick")]
|
||||
public class TripleKick : Script
|
||||
public class TripleKick : Script, IScriptChangeNumberOfHits
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void ChangeNumberOfHits(IMoveChoice choice, ref byte numberOfHits)
|
||||
public void ChangeNumberOfHits(IMoveChoice choice, ref byte numberOfHits)
|
||||
{
|
||||
numberOfHits = 3;
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
[Script(ScriptCategory.Move, "twineedle")]
|
||||
public class Twineedle : Script
|
||||
public class Twineedle : Script, IScriptChangeNumberOfHits
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void ChangeNumberOfHits(IMoveChoice choice, ref byte numberOfHits) => numberOfHits = 2;
|
||||
public void ChangeNumberOfHits(IMoveChoice choice, ref byte numberOfHits) => numberOfHits = 2;
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void OnSecondaryEffect(IExecutingMove move, IPokemon target, byte hit)
|
||||
|
||||
@@ -3,10 +3,10 @@ using PkmnLib.Plugin.Gen7.Scripts.MoveVolatile;
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
[Script(ScriptCategory.Move, "water_pledge")]
|
||||
public class WaterPledge : Script
|
||||
public class WaterPledge : Script, IScriptStopBeforeMove
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void StopBeforeMove(IExecutingMove move, ref bool stop)
|
||||
public void StopBeforeMove(IExecutingMove move, ref bool stop)
|
||||
{
|
||||
if (move.MoveChoice.Volatile.Contains<GrassWaterPledgeMove>() ||
|
||||
move.MoveChoice.Volatile.Contains<FireWaterPledgeMove>())
|
||||
|
||||
Reference in New Issue
Block a user