mirror of
https://github.com/kwsch/PKHeX
synced 2025-02-16 21:38:40 +00:00
parent
297952db66
commit
fb818f203d
2 changed files with 46 additions and 1 deletions
|
@ -264,7 +264,12 @@ namespace PKHeX.Core
|
|||
return (ushort)((((2 * (BV + IV)) + EV) * LV / 100) + 5);
|
||||
}
|
||||
|
||||
public override int GetMovePP(int move, int ppup) => GetBasePP(move) + ppup * Math.Min(7, GetBasePP(move) / 5)
|
||||
public override int GetMovePP(int move, int ppup)
|
||||
{
|
||||
var pp = base.GetMovePP(move, 0);
|
||||
return pp + (ppup * Math.Min(7, pp / 5));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Applies <see cref="PKM.IVs"/> to the <see cref="PKM"/> to make it shiny.
|
||||
/// </summary>
|
||||
|
|
40
Tests/PKHeX.Core.Tests/PKM/StatTest.cs
Normal file
40
Tests/PKHeX.Core.Tests/PKM/StatTest.cs
Normal file
|
@ -0,0 +1,40 @@
|
|||
using FluentAssertions;
|
||||
using PKHeX.Core;
|
||||
using Xunit;
|
||||
|
||||
namespace PKHeX.Tests.PKM
|
||||
{
|
||||
public class StatTest
|
||||
{
|
||||
[Fact]
|
||||
public void CalcStatsGB()
|
||||
{
|
||||
var pk = new PK2
|
||||
{
|
||||
Species = (int) Species.Gyarados,
|
||||
CurrentLevel = 38,
|
||||
IV_HP = 0,
|
||||
IV_ATK = 14,
|
||||
IV_DEF = 10,
|
||||
IV_SPC = 10,
|
||||
IV_SPE = 10,
|
||||
EV_HP = 5120, // 2 HP Ups
|
||||
|
||||
Move1 = 45, // Growl (PP 40)
|
||||
Move2 = 45, // Growl (PP 40)
|
||||
Move3 = 45, // Growl (PP 40)
|
||||
Move1_PPUps = 1,
|
||||
Move2_PPUps = 2,
|
||||
Move3_PPUps = 3,
|
||||
};
|
||||
|
||||
pk.Heal();
|
||||
|
||||
pk.Stat_HPCurrent.Should().Be(127, "stat re-calculation");
|
||||
|
||||
pk.Move1_PP.Should().Be(47, "pp calc oddity");
|
||||
pk.Move2_PP.Should().Be(54, "pp calc oddity");
|
||||
pk.Move3_PP.Should().Be(61, "pp calc oddity");
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue