Move all battle state from IPokemon to an ephemeral IBattlePokemon wrapper
This commit is contained in:
@@ -27,12 +27,13 @@ public class Poisoned : Script, IScriptOnEndTurn, IAIInfoScriptExpectedEndOfTurn
|
||||
if (damage == 0)
|
||||
damage = 1;
|
||||
|
||||
var battleData = _pokemon.BattleData;
|
||||
var args = new CustomTriggers.PoisonedDamageArgs(_pokemon, damage);
|
||||
if (_pokemon is not IBattlePokemon battlePokemon)
|
||||
return;
|
||||
var args = new CustomTriggers.PoisonedDamageArgs(battlePokemon, damage);
|
||||
_pokemon.RunScriptHook<IScriptCustomTrigger>(x => x.CustomTrigger(CustomTriggers.PoisonedDamage, args));
|
||||
|
||||
var eventBatchId = new EventBatchId();
|
||||
battleData?.Battle.EventHook.Invoke(new DialogEvent("poisoned_damage", new Dictionary<string, object>
|
||||
battle.EventHook.Invoke(new DialogEvent("poisoned_damage", new Dictionary<string, object>
|
||||
{
|
||||
{ "pokemon", _pokemon },
|
||||
{ "damage", damage },
|
||||
@@ -48,7 +49,7 @@ public class Poisoned : Script, IScriptOnEndTurn, IAIInfoScriptExpectedEndOfTurn
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public virtual void ExpectedEndOfTurnDamage(IPokemon pokemon, ref int damage)
|
||||
public virtual void ExpectedEndOfTurnDamage(IBattlePokemon pokemon, ref int damage)
|
||||
{
|
||||
if (_pokemon != null)
|
||||
damage += (int)(_pokemon.MaxHealth * GetPoisonMultiplier());
|
||||
|
||||
Reference in New Issue
Block a user