Move all battle state from IPokemon to an ephemeral IBattlePokemon wrapper

This commit is contained in:
2026-08-28 15:20:26 +02:00
parent 942be8eaeb
commit 8a2733a0a9
859 changed files with 4408 additions and 5331 deletions

View File

@@ -5,17 +5,16 @@ public class PowderEffect : Script, IScriptBlockOutgoingHit
{
/// <inheritdoc />
/// <inheritdoc />
public void BlockOutgoingHit(IExecutingMove executingMove, IPokemon target, byte hitIndex, ref bool block)
public void BlockOutgoingHit(IExecutingMove executingMove, IBattlePokemon target, byte hitIndex, ref bool block)
{
var hit = executingMove.GetHitData(target, hitIndex);
if (hit.Type?.Name == TypeNames.Fire)
{
executingMove.User.BattleData?.Battle.EventHook.Invoke(new DialogEvent("powder_explodes",
new Dictionary<string, object>
{
{ "user", executingMove.User },
{ "target", target },
}));
executingMove.User.Battle.EventHook.Invoke(new DialogEvent("powder_explodes", new Dictionary<string, object>
{
{ "user", executingMove.User },
{ "target", target },
}));
var health = executingMove.User.MaxHealth / 4;
executingMove.User.Damage(health, DamageSource.Misc);