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

@@ -10,9 +10,9 @@ public class Present : Script, IScriptOnSecondaryEffect, IScriptChangeBasePower,
private byte _basePower;
/// <inheritdoc />
public void OnBeforeHit(IExecutingMove move, IPokemon target, byte hitIndex)
public void OnBeforeHit(IExecutingMove move, IBattlePokemon target, byte hitIndex)
{
var battleRandom = move.User.BattleData?.Battle.Random;
var battleRandom = move.User.Battle.Random;
if (battleRandom == null)
return;
var percentRoll = battleRandom.GetFloat() * 100.0;
@@ -34,20 +34,20 @@ public class Present : Script, IScriptOnSecondaryEffect, IScriptChangeBasePower,
}
/// <inheritdoc />
public void ChangeCategory(IExecutingMove move, IPokemon target, byte hitIndex, ref MoveCategory category)
public void ChangeCategory(IExecutingMove move, IBattlePokemon target, byte hitIndex, ref MoveCategory category)
{
if (_isHealing)
category = MoveCategory.Status;
}
/// <inheritdoc />
public void ChangeBasePower(IExecutingMove move, IPokemon target, byte hit, ref ushort basePower)
public void ChangeBasePower(IExecutingMove move, IBattlePokemon target, byte hit, ref ushort basePower)
{
basePower = _basePower;
}
/// <inheritdoc />
public void OnSecondaryEffect(IExecutingMove move, IPokemon target, byte hit)
public void OnSecondaryEffect(IExecutingMove move, IBattlePokemon target, byte hit)
{
if (!_isHealing)
return;