Adds battle history, fixes code style

This commit is contained in:
2024-08-23 09:24:00 +02:00
parent d48889e21a
commit e7dc885afd
21 changed files with 80 additions and 70 deletions

View File

@@ -523,7 +523,7 @@ public class PokemonImpl : ScriptSource, IPokemon
{
> 0 => StatBoost.IncreaseStatistic(stat, change),
< 0 => StatBoost.DecreaseStatistic(stat, change),
_ => changed
_ => changed,
};
if (!changed)
return false;
@@ -599,7 +599,7 @@ public class PokemonImpl : ScriptSource, IPokemon
// If the Pokémon is in a battle, we trigger an event to the front-end.
BattleData.Battle.EventHook.Invoke(new DamageEvent(this, CurrentHealth, newHealth, source)
{
BatchId = batchId
BatchId = batchId,
});
// And allow scripts to execute.
this.RunScriptHook(script => script.OnDamage(this, source, CurrentHealth, newHealth));