Move all battle state from IPokemon to an ephemeral IBattlePokemon wrapper

This commit is contained in:
2026-08-28 15:20:26 +02:00
parent 942be8eaeb
commit 8a2733a0a9
859 changed files with 4408 additions and 5331 deletions

View File

@@ -13,9 +13,9 @@ public class PursuitEffect : Script, IScriptOnSwitchOut
}
/// <inheritdoc />
public void OnSwitchOut(IPokemon oldPokemon, byte position)
public void OnSwitchOut(IBattlePokemon oldPokemon, byte position)
{
var battleData = oldPokemon.BattleData;
var battleData = oldPokemon;
if (battleData == null)
return;
if (battleData.Battle.HasEnded)
@@ -25,7 +25,7 @@ public class PursuitEffect : Script, IScriptOnSwitchOut
return;
if (!_choice.User.IsUsable)
return;
if (_choice.User.BattleData?.IsOnBattlefield != true)
if (_choice.User.IsOnBattlefield != true)
return;
var choiceQueue = battleData.Battle.ChoiceQueue;
@@ -43,7 +43,7 @@ public class PursuitEffect : Script, IScriptOnSwitchOut
private class PursuitDoublePowerEffect : Script, IScriptChangeBasePower
{
/// <inheritdoc />
public void ChangeBasePower(IExecutingMove move, IPokemon target, byte hit, ref ushort basePower)
public void ChangeBasePower(IExecutingMove move, IBattlePokemon target, byte hit, ref ushort basePower)
{
basePower = basePower.MultiplyOrMax(2);
}