Move all battle state from IPokemon to an ephemeral IBattlePokemon wrapper
This commit is contained in:
@@ -5,11 +5,11 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Side;
|
||||
[Script(ScriptCategory.Side, "aroma_veil")]
|
||||
public class AromaVeilEffect : Script, IScriptFailIncomingMove, IScriptPreventIncomingSecondaryEffect
|
||||
{
|
||||
private HashSet<IPokemon> _placers = new();
|
||||
private HashSet<IBattlePokemon> _placers = new();
|
||||
|
||||
public void PlacerActivated(IPokemon placer) => _placers.Add(placer);
|
||||
public void PlacerActivated(IBattlePokemon placer) => _placers.Add(placer);
|
||||
|
||||
public void PlacerDeactivated(IPokemon placer)
|
||||
public void PlacerDeactivated(IBattlePokemon placer)
|
||||
{
|
||||
_placers.Remove(placer);
|
||||
if (_placers.Count == 0)
|
||||
@@ -17,14 +17,14 @@ public class AromaVeilEffect : Script, IScriptFailIncomingMove, IScriptPreventIn
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public void FailIncomingMove(IExecutingMove move, IPokemon target, ref bool fail)
|
||||
public void FailIncomingMove(IExecutingMove move, IBattlePokemon target, ref bool fail)
|
||||
{
|
||||
if (move.UseMove.HasFlag(MoveFlags.Mental) && move.UseMove.Category == MoveCategory.Status)
|
||||
fail = true;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public void PreventIncomingSecondaryEffect(IExecutingMove move, IPokemon target, byte hit, ref bool prevent)
|
||||
public void PreventIncomingSecondaryEffect(IExecutingMove move, IBattlePokemon target, byte hit, ref bool prevent)
|
||||
{
|
||||
if (move.UseMove.HasFlag(MoveFlags.Mental))
|
||||
prevent = true;
|
||||
|
||||
Reference in New Issue
Block a user