mirror of
https://github.com/kwsch/PKHeX
synced 2024-11-10 14:44:24 +00:00
Update movepp sig to use ushort
This commit is contained in:
parent
3a5aa22c6f
commit
f1dcc33168
3 changed files with 11 additions and 10 deletions
|
@ -794,14 +794,14 @@ public abstract class PKM : ISpeciesForm, ITrainerID, IGeneration, IShiny, ILang
|
|||
/// <param name="move">Move ID</param>
|
||||
/// <param name="ppUpCount">PP Ups count</param>
|
||||
/// <returns>Current PP for the move.</returns>
|
||||
public virtual int GetMovePP(int move, int ppUpCount) => GetBasePP(move) * (5 + ppUpCount) / 5;
|
||||
public virtual int GetMovePP(ushort move, int ppUpCount) => GetBasePP(move) * (5 + ppUpCount) / 5;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the base PP of a move ID depending on the <see cref="PKM"/>'s format.
|
||||
/// </summary>
|
||||
/// <param name="move">Move ID</param>
|
||||
/// <returns>Amount of PP the move has by default (no PP Ups).</returns>
|
||||
private int GetBasePP(int move) => MoveInfo.GetPP(Context, (ushort)move);
|
||||
private int GetBasePP(ushort move) => MoveInfo.GetPP(Context, move);
|
||||
|
||||
/// <summary>
|
||||
/// Applies a shiny <see cref="PID"/> to the <see cref="PKM"/>.
|
||||
|
|
|
@ -217,7 +217,7 @@ public abstract class GBPKM : PKM
|
|||
return (ushort)((((2 * (baseStat + iv)) + effort) * level / 100) + 5);
|
||||
}
|
||||
|
||||
public sealed override int GetMovePP(int move, int ppUpCount)
|
||||
public sealed override int GetMovePP(ushort move, int ppUpCount)
|
||||
{
|
||||
var pp = base.GetMovePP(move, 0);
|
||||
return pp + (ppUpCount * Math.Min(7, pp / 5));
|
||||
|
|
|
@ -1003,18 +1003,19 @@ public sealed partial class PKMEditor : UserControl, IMainEditor
|
|||
|
||||
private void RefreshMovePP(int index)
|
||||
{
|
||||
var cb = Moves[index];
|
||||
int move = WinFormsUtil.GetIndex(cb);
|
||||
var ppUpControl = PPUps[index];
|
||||
int ppUpCount = ppUpControl.SelectedIndex;
|
||||
var moveCB = Moves[index];
|
||||
var ppText = MovePP[index];
|
||||
var ppUps = PPUps[index];
|
||||
int move = WinFormsUtil.GetIndex(moveCB);
|
||||
if (move <= 0)
|
||||
{
|
||||
ppUpControl.SelectedIndex = 0;
|
||||
MovePP[index].Text = 0.ToString();
|
||||
ppUps.SelectedIndex = 0;
|
||||
ppText.Text = 0.ToString();
|
||||
}
|
||||
else
|
||||
{
|
||||
MovePP[index].Text = Entity.GetMovePP(move, ppUpCount).ToString();
|
||||
int ppUpCount = ppUps.SelectedIndex;
|
||||
ppText.Text = Entity.GetMovePP((ushort)move, ppUpCount).ToString();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue