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

@@ -15,7 +15,7 @@ public class FoulPlayTests
/// Creates a fully mocked test setup for Foul Play tests, with a target whose (boosted) offensive
/// stats are set to the given values.
/// </summary>
private static (FoulPlay script, IExecutingMove move, IPokemon target) CreateTestSetup(MoveCategory category,
private static (FoulPlay script, IExecutingMove move, IBattlePokemon target) CreateTestSetup(MoveCategory category,
uint targetAttack, uint targetSpecialAttack)
{
var script = new FoulPlay();
@@ -24,10 +24,10 @@ public class FoulPlayTests
useMove.Category.Returns(category);
move.UseMove.Returns(useMove);
var target = Substitute.For<IPokemon>();
var target = Substitute.For<IBattlePokemon>();
target.BoostedStats.Returns(new StatisticSet<uint>(100, targetAttack, 80, targetSpecialAttack, 80, 80));
var user = Substitute.For<IPokemon>();
var user = Substitute.For<IBattlePokemon>();
move.User.Returns(user);
return (script, move, target);
@@ -54,8 +54,8 @@ public class FoulPlayTests
/// <summary>
/// Bulbapedia: "The target's Attack stat stage-modifiers are applied (rather than the user's)".
/// The stat used must be the target's boosted Attack (<see cref="IPokemon.BoostedStats"/>, which includes
/// stat stages), not its flat Attack (<see cref="IPokemon.FlatStats"/>).
/// The stat used must be the target's boosted Attack (<see cref="IBattlePokemon.BoostedStats"/>, which includes
/// stat stages), not its flat Attack (<see cref="IBattlePokemon.FlatStats"/>).
/// </summary>
[Test]
public async Task ChangeOffensiveStatValue_PhysicalMove_TargetStatStagesApplied()