mirror of
https://github.com/kwsch/PKHeX
synced 2024-11-27 14:30:56 +00:00
1a1cfbda4a
* Fix broken hidden power power calculation * Fix broken Gen 2 Hidden Power calculation * Add parentheses * WIP UI * Finalize UI, only show on gens 1-5 * Inline some logic to reduce allocations * Add unit tests for both hidden power calculation cases Co-authored-by: Kurt <kaphotics@gmail.com>
28 lines
889 B
C#
28 lines
889 B
C#
using System;
|
|
using FluentAssertions;
|
|
using PKHeX.Core;
|
|
using Xunit;
|
|
|
|
namespace PKHeX.Tests.PKM
|
|
{
|
|
public class HiddenPowerTests
|
|
{
|
|
[Theory]
|
|
[InlineData(14, 15, 15, 14, 14, 15, MoveType.Dark, 69, typeof(PK2))]
|
|
[InlineData(30, 31, 31, 30, 31, 31, MoveType.Grass, 70, typeof(PK3))]
|
|
[InlineData(26, 31, 31, 30, 31, 31, MoveType.Grass, 70, typeof(PK3))]
|
|
public void HiddenPowerTest(int h, int a, int b, int c, int d, int s, MoveType type, int power, Type pkmType)
|
|
{
|
|
var pkm = PKMConverter.GetBlank(pkmType);
|
|
pkm.IV_HP = h;
|
|
pkm.IV_ATK = a;
|
|
pkm.IV_DEF = b;
|
|
pkm.IV_SPA = c;
|
|
pkm.IV_SPD = d;
|
|
pkm.IV_SPE = s;
|
|
|
|
pkm.HPType.Should().Be((int)type - 1); // no normal type, down-shift by 1
|
|
pkm.HPPower.Should().Be(power);
|
|
}
|
|
}
|
|
}
|