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,9 +10,9 @@ public class Confusion : Script, IScriptStopBeforeMove
/// <inheritdoc />
public override void OnAddedToParent(IScriptSource source)
{
if (source is not IPokemon pokemon)
if (source is not IBattlePokemon pokemon)
throw new InvalidOperationException("Confusion script can only be added to a Pokemon.");
var battleData = pokemon.BattleData;
var battleData = pokemon;
if (battleData == null)
throw new InvalidOperationException("Confusion script requires a Pokemon to be in a battle.");
_turnsConfused = battleData.Battle.Random.GetInt(2, 5);