First couple abilities implemented
All checks were successful
Build / Build (push) Successful in 48s

This commit is contained in:
2025-05-31 12:29:03 +02:00
parent c1a7b806b1
commit b090aa65f9
34 changed files with 733 additions and 50 deletions

View File

@@ -271,18 +271,25 @@ public class BattleSideImpl : ScriptSource, IBattleSide
pokemon.SetBattleData(Battle, Index);
pokemon.SetOnBattlefield(true);
pokemon.SetBattleSidePosition(position);
Battle.EventHook.Invoke(new SwitchEvent(Index, position, pokemon));
pokemon.RunScriptHook(script => script.OnSwitchIn(pokemon, position));
foreach (var side in Battle.Sides)
{
if (side == this)
continue;
var scripts = new List<IEnumerable<ScriptContainer>>(10);
foreach (var opponent in side.Pokemon.WhereNotNull())
{
opponent.MarkOpponentAsSeen(pokemon);
pokemon.MarkOpponentAsSeen(opponent);
scripts.Clear();
opponent.GetOwnScripts(scripts);
opponent.RunScriptHook(script => script.OnOpponentSwitchIn(pokemon, position));
}
side.RunScriptHook(script => script.OnOpponentSwitchIn(pokemon, position));
}
Battle.EventHook.Invoke(new SwitchEvent(Index, position, pokemon));
pokemon.RunScriptHook(script => script.OnSwitchIn(pokemon, position));
}
else
{