Move all battle state from IPokemon to an ephemeral IBattlePokemon wrapper
This commit is contained in:
@@ -14,11 +14,11 @@ public class BellyDrumTests
|
||||
/// <summary>
|
||||
/// Creates a fully mocked test setup for Belly Drum. The target of the secondary effect is the user itself.
|
||||
/// </summary>
|
||||
private static (BellyDrum script, IExecutingMove move, IPokemon user, IHitData hitData) CreateTestSetup(uint maxHp,
|
||||
uint currentHp, sbyte attackBoost = 0)
|
||||
private static (BellyDrum script, IExecutingMove move, IBattlePokemon user, IHitData hitData) CreateTestSetup(
|
||||
uint maxHp, uint currentHp, sbyte attackBoost = 0)
|
||||
{
|
||||
var script = new BellyDrum();
|
||||
var user = Substitute.For<IPokemon>();
|
||||
var user = Substitute.For<IBattlePokemon>();
|
||||
user.BoostedStats.Returns(new StatisticSet<uint>(maxHp, 10, 10, 10, 10, 10));
|
||||
user.CurrentHealth.Returns(currentHp);
|
||||
user.StatBoost.Returns(new StatBoostStatisticSet(0, attackBoost, 0, 0, 0, 0));
|
||||
@@ -34,7 +34,7 @@ public class BellyDrumTests
|
||||
/// <summary>
|
||||
/// Helper to extract the received Damage call from the user, if any.
|
||||
/// </summary>
|
||||
private static (uint damage, DamageSource source, bool forceDamage)? GetDamageCall(IPokemon user)
|
||||
private static (uint damage, DamageSource source, bool forceDamage)? GetDamageCall(IBattlePokemon user)
|
||||
{
|
||||
var call = user.ReceivedCalls().FirstOrDefault(c => c.GetMethodInfo().Name == "Damage");
|
||||
if (call == null)
|
||||
@@ -46,7 +46,7 @@ public class BellyDrumTests
|
||||
/// <summary>
|
||||
/// Helper to extract the received ChangeStatBoost call from the user, if any.
|
||||
/// </summary>
|
||||
private static (Statistic stat, sbyte change, bool selfInflicted)? GetStatBoostCall(IPokemon user)
|
||||
private static (Statistic stat, sbyte change, bool selfInflicted)? GetStatBoostCall(IBattlePokemon user)
|
||||
{
|
||||
var call = user.ReceivedCalls().FirstOrDefault(c => c.GetMethodInfo().Name == "ChangeStatBoost");
|
||||
if (call == null)
|
||||
|
||||
Reference in New Issue
Block a user