Move all battle state from IPokemon to an ephemeral IBattlePokemon wrapper
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user