This commit is contained in:
@@ -0,0 +1,56 @@
|
||||
using PkmnLib.Dynamic.Models;
|
||||
using PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
namespace PkmnLib.Plugin.Gen7.Tests.Scripts.Moves;
|
||||
|
||||
/// <summary>
|
||||
/// Tests for the <see cref="LowKick"/> move script.
|
||||
/// Gen VII Bulbapedia behavior (Generation III onwards): "Low Kick now has 100% accuracy, and its power is
|
||||
/// now dependent on the weight of the target, inflicting greater damage on heavier targets."
|
||||
/// </summary>
|
||||
public class LowKickTests
|
||||
{
|
||||
/// <summary>
|
||||
/// Bulbapedia weight-to-power table: 0.1–9.9 kg → 20, 10.0–24.9 kg → 40, 25.0–49.9 kg → 60,
|
||||
/// 50.0–99.9 kg → 80, 100.0–199.9 kg → 100, 200.0+ kg → 120. Each row tests a boundary of the table.
|
||||
/// </summary>
|
||||
[Test, Arguments(0.1f, 20), Arguments(9.9f, 20), Arguments(10.0f, 40), Arguments(24.9f, 40), Arguments(25.0f, 60),
|
||||
Arguments(49.9f, 60), Arguments(50.0f, 80), Arguments(99.9f, 80), Arguments(100.0f, 100), Arguments(199.9f, 100),
|
||||
Arguments(200.0f, 120), Arguments(950.0f, 120)]
|
||||
public async Task ChangeBasePower_TargetWeight_PowerFollowsWeightTable(float weightInKg, int expectedPower)
|
||||
{
|
||||
// Arrange
|
||||
var script = new LowKick();
|
||||
var move = Substitute.For<IExecutingMove>();
|
||||
var target = Substitute.For<IPokemon>();
|
||||
target.WeightInKg.Returns(weightInKg);
|
||||
ushort basePower = 50;
|
||||
|
||||
// Act
|
||||
script.ChangeBasePower(move, target, 0, ref basePower);
|
||||
|
||||
// Assert
|
||||
await Assert.That(basePower).IsEqualTo((ushort)expectedPower);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Bulbapedia: the power is "dependent on the weight of the target" only — the move's original base
|
||||
/// power is irrelevant and fully replaced by the table value.
|
||||
/// </summary>
|
||||
[Test]
|
||||
public async Task ChangeBasePower_HighOriginalBasePower_OverwrittenByWeightTable()
|
||||
{
|
||||
// Arrange
|
||||
var script = new LowKick();
|
||||
var move = Substitute.For<IExecutingMove>();
|
||||
var target = Substitute.For<IPokemon>();
|
||||
target.WeightInKg.Returns(5f);
|
||||
var basePower = ushort.MaxValue;
|
||||
|
||||
// Act
|
||||
script.ChangeBasePower(move, target, 0, ref basePower);
|
||||
|
||||
// Assert
|
||||
await Assert.That(basePower).IsEqualTo((ushort)20);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user