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

@@ -8,13 +8,13 @@ public class LightScreenEffect(int turns) : Script, IScriptChangeIncomingMoveDam
private int _turns = turns;
/// <inheritdoc />
public void ChangeIncomingMoveDamage(IExecutingMove move, IPokemon target, byte hit, ref uint damage)
public void ChangeIncomingMoveDamage(IExecutingMove move, IBattlePokemon target, byte hit, ref uint damage)
{
if (move.UseMove.Category != MoveCategory.Special ||
// Critical hits are not affected by the barrier
move.GetHitData(target, hit).IsCritical)
return;
var battleData = target.BattleData;
var battleData = target;
// If not a 1v1 battle, damage reduction is only 1/3rd.
if (battleData?.Battle.PositionsPerSide > 1)
damage = (uint)(damage * (2.0f / 3.0f));