This commit is contained in:
@@ -248,7 +248,7 @@ public class BattleSideImpl : ScriptSource, IBattleSide
|
||||
var pokemon = _pokemon[index];
|
||||
if (pokemon is not null)
|
||||
{
|
||||
pokemon.RunScriptHook(script => script.OnRemove());
|
||||
pokemon.RunScriptHook<IScriptOnRemove>(script => script.OnRemove());
|
||||
pokemon.SetOnBattlefield(false);
|
||||
}
|
||||
|
||||
@@ -261,8 +261,8 @@ public class BattleSideImpl : ScriptSource, IBattleSide
|
||||
var oldPokemon = _pokemon[position];
|
||||
if (oldPokemon is not null)
|
||||
{
|
||||
oldPokemon.RunScriptHookInterface<IScriptOnSwitchOut>(script => script.OnSwitchOut(oldPokemon, position));
|
||||
oldPokemon.RunScriptHook(script => script.OnRemove());
|
||||
oldPokemon.RunScriptHook<IScriptOnSwitchOut>(script => script.OnSwitchOut(oldPokemon, position));
|
||||
oldPokemon.RunScriptHook<IScriptOnRemove>(script => script.OnRemove());
|
||||
oldPokemon.SetOnBattlefield(false);
|
||||
}
|
||||
_pokemon[position] = pokemon;
|
||||
@@ -272,7 +272,7 @@ public class BattleSideImpl : ScriptSource, IBattleSide
|
||||
pokemon.SetOnBattlefield(true);
|
||||
pokemon.SetBattleSidePosition(position);
|
||||
Battle.EventHook.Invoke(new SwitchEvent(Index, position, pokemon));
|
||||
pokemon.RunScriptHookInterface<IScriptOnSwitchIn>(script => script.OnSwitchIn(pokemon, position));
|
||||
pokemon.RunScriptHook<IScriptOnSwitchIn>(script => script.OnSwitchIn(pokemon, position));
|
||||
|
||||
foreach (var side in Battle.Sides)
|
||||
{
|
||||
@@ -286,11 +286,10 @@ public class BattleSideImpl : ScriptSource, IBattleSide
|
||||
|
||||
scripts.Clear();
|
||||
opponent.GetOwnScripts(scripts);
|
||||
opponent.RunScriptHookInterface<IScriptOnOpponentSwitchIn>(script =>
|
||||
opponent.RunScriptHook<IScriptOnOpponentSwitchIn>(script =>
|
||||
script.OnOpponentSwitchIn(pokemon, position));
|
||||
}
|
||||
side.RunScriptHookInterface<IScriptOnOpponentSwitchIn>(script =>
|
||||
script.OnOpponentSwitchIn(pokemon, position));
|
||||
side.RunScriptHook<IScriptOnOpponentSwitchIn>(script => script.OnOpponentSwitchIn(pokemon, position));
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user