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,7 +13,7 @@ public class SpikesEffect : Script, IScriptOnSwitchIn, IScriptStack, IAIInfoScri
}
/// <inheritdoc />
public void OnSwitchIn(IPokemon pokemon, byte position)
public void OnSwitchIn(IBattlePokemon pokemon, byte position)
{
if (pokemon.IsFloating)
return;
@@ -22,7 +22,7 @@ public class SpikesEffect : Script, IScriptOnSwitchIn, IScriptStack, IAIInfoScri
EventBatchId eventBatch = new();
pokemon.Damage(damage, DamageSource.Misc, eventBatch);
pokemon.BattleData?.Battle.EventHook.Invoke(new DialogEvent("spikes_damage", new Dictionary<string, object>
pokemon.Battle.EventHook.Invoke(new DialogEvent("spikes_damage", new Dictionary<string, object>
{
{ "pokemon", pokemon },
})
@@ -31,7 +31,7 @@ public class SpikesEffect : Script, IScriptOnSwitchIn, IScriptStack, IAIInfoScri
});
}
private uint CalculateDamage(IPokemon pokemon)
private uint CalculateDamage(IBattlePokemon pokemon)
{
var modifier = _layers switch
{
@@ -45,7 +45,7 @@ public class SpikesEffect : Script, IScriptOnSwitchIn, IScriptStack, IAIInfoScri
}
/// <inheritdoc />
public void ExpectedEntryDamage(IPokemon pokemon, ref uint damage)
public void ExpectedEntryDamage(IBattlePokemon pokemon, ref uint damage)
{
if (pokemon.IsFloating)
return;