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

@@ -10,7 +10,7 @@ public class DoublePowerIfTargetDamagedInTurn : Script, IScriptOnBeforeTurnStart
{
if (choice is IMoveChoice moveChoice)
{
var battle = choice.User.BattleData?.Battle;
var battle = choice.User.Battle;
if (battle == null)
return;
var side = battle.Sides[moveChoice.TargetSide];
@@ -19,14 +19,12 @@ public class DoublePowerIfTargetDamagedInTurn : Script, IScriptOnBeforeTurnStart
}
/// <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)
{
var battle = move.User.BattleData?.Battle;
var battle = move.User.Battle;
if (battle == null)
return;
if (target.BattleData == null)
return;
var side = battle.Sides[target.BattleData.SideIndex];
var side = battle.Sides[target.SideIndex];
var data = side.VolatileScripts.Get<DoublePowerIfTargetDamagedInTurnData>();
if (data == null)
return;