mirror of
https://github.com/kwsch/PKHeX
synced 2024-11-23 12:33:06 +00:00
Fix gen1/2 moves with 40 pp given 3 ppups
cap is 61: http://bulbapedia.bulbagarden.net/wiki/Power_Point#Base_value_alteration cap forced maximum at 63
This commit is contained in:
parent
483998d930
commit
63b3c8b020
3 changed files with 12 additions and 10 deletions
|
@ -174,10 +174,10 @@ namespace PKHeX.Core
|
||||||
public int IV_SPC { get => (DV16 >> 0) & 0xF; set => DV16 = (ushort)((DV16 & ~(0xF << 0)) | (ushort)((value > 0xF ? 0xF : value) << 0)); }
|
public int IV_SPC { get => (DV16 >> 0) & 0xF; set => DV16 = (ushort)((DV16 & ~(0xF << 0)) | (ushort)((value > 0xF ? 0xF : value) << 0)); }
|
||||||
public override int IV_SPA { get => IV_SPC; set => IV_SPC = value; }
|
public override int IV_SPA { get => IV_SPC; set => IV_SPC = value; }
|
||||||
public override int IV_SPD { get => IV_SPC; set { } }
|
public override int IV_SPD { get => IV_SPC; set { } }
|
||||||
public override int Move1_PP { get => Data[0x1D] & 0x3F; set => Data[0x1D] = (byte)((Data[0x1D] & 0xC0) | (value & 0x3F)); }
|
public override int Move1_PP { get => Data[0x1D] & 0x3F; set => Data[0x1D] = (byte)((Data[0x1D] & 0xC0) | Math.Min(63, value)); }
|
||||||
public override int Move2_PP { get => Data[0x1E] & 0x3F; set => Data[0x1E] = (byte)((Data[0x1E] & 0xC0) | (value & 0x3F)); }
|
public override int Move2_PP { get => Data[0x1E] & 0x3F; set => Data[0x1E] = (byte)((Data[0x1E] & 0xC0) | Math.Min(63, value)); }
|
||||||
public override int Move3_PP { get => Data[0x1F] & 0x3F; set => Data[0x1F] = (byte)((Data[0x1F] & 0xC0) | (value & 0x3F)); }
|
public override int Move3_PP { get => Data[0x1F] & 0x3F; set => Data[0x1F] = (byte)((Data[0x1F] & 0xC0) | Math.Min(63, value)); }
|
||||||
public override int Move4_PP { get => Data[0x20] & 0x3F; set => Data[0x20] = (byte)((Data[0x20] & 0xC0) | (value & 0x3F)); }
|
public override int Move4_PP { get => Data[0x20] & 0x3F; set => Data[0x20] = (byte)((Data[0x20] & 0xC0) | Math.Min(63, value)); }
|
||||||
public override int Move1_PPUps { get => (Data[0x1D] & 0xC0) >> 6; set => Data[0x1D] = (byte)((Data[0x1D] & 0x3F) | ((value & 0x3) << 6)); }
|
public override int Move1_PPUps { get => (Data[0x1D] & 0xC0) >> 6; set => Data[0x1D] = (byte)((Data[0x1D] & 0x3F) | ((value & 0x3) << 6)); }
|
||||||
public override int Move2_PPUps { get => (Data[0x1E] & 0xC0) >> 6; set => Data[0x1E] = (byte)((Data[0x1E] & 0x3F) | ((value & 0x3) << 6)); }
|
public override int Move2_PPUps { get => (Data[0x1E] & 0xC0) >> 6; set => Data[0x1E] = (byte)((Data[0x1E] & 0x3F) | ((value & 0x3) << 6)); }
|
||||||
public override int Move3_PPUps { get => (Data[0x1F] & 0xC0) >> 6; set => Data[0x1F] = (byte)((Data[0x1F] & 0x3F) | ((value & 0x3) << 6)); }
|
public override int Move3_PPUps { get => (Data[0x1F] & 0xC0) >> 6; set => Data[0x1F] = (byte)((Data[0x1F] & 0x3F) | ((value & 0x3) << 6)); }
|
||||||
|
@ -200,6 +200,7 @@ namespace PKHeX.Core
|
||||||
public override int Stat_SPD { get => Stat_SPC; set { } }
|
public override int Stat_SPD { get => Stat_SPC; set { } }
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
public override int getMovePP(int move, int ppup) => Math.Min(61, base.getMovePP(move, ppup));
|
||||||
public override ushort[] getStats(PersonalInfo p)
|
public override ushort[] getStats(PersonalInfo p)
|
||||||
{
|
{
|
||||||
ushort[] Stats = new ushort[6];
|
ushort[] Stats = new ushort[6];
|
||||||
|
|
|
@ -160,10 +160,10 @@ namespace PKHeX.Core
|
||||||
public int IV_SPC { get => (DV16 >> 0) & 0xF; set => DV16 = (ushort)((DV16 & ~(0xF << 0)) | (ushort)((value > 0xF ? 0xF : value) << 0)); }
|
public int IV_SPC { get => (DV16 >> 0) & 0xF; set => DV16 = (ushort)((DV16 & ~(0xF << 0)) | (ushort)((value > 0xF ? 0xF : value) << 0)); }
|
||||||
public override int IV_SPA { get => IV_SPC; set => IV_SPC = value; }
|
public override int IV_SPA { get => IV_SPC; set => IV_SPC = value; }
|
||||||
public override int IV_SPD { get => IV_SPC; set { } }
|
public override int IV_SPD { get => IV_SPC; set { } }
|
||||||
public override int Move1_PP { get => Data[0x17] & 0x3F; set => Data[0x17] = (byte)((Data[0x17] & 0xC0) | (value & 0x3F)); }
|
public override int Move1_PP { get => Data[0x17] & 0x3F; set => Data[0x17] = (byte)((Data[0x17] & 0xC0) | Math.Min(63, value)); }
|
||||||
public override int Move2_PP { get => Data[0x18] & 0x3F; set => Data[0x18] = (byte)((Data[0x18] & 0xC0) | (value & 0x3F)); }
|
public override int Move2_PP { get => Data[0x18] & 0x3F; set => Data[0x18] = (byte)((Data[0x18] & 0xC0) | Math.Min(63, value)); }
|
||||||
public override int Move3_PP { get => Data[0x19] & 0x3F; set => Data[0x19] = (byte)((Data[0x19] & 0xC0) | (value & 0x3F)); }
|
public override int Move3_PP { get => Data[0x19] & 0x3F; set => Data[0x19] = (byte)((Data[0x19] & 0xC0) | Math.Min(63, value)); }
|
||||||
public override int Move4_PP { get => Data[0x1A] & 0x3F; set => Data[0x1A] = (byte)((Data[0x1A] & 0xC0) | (value & 0x3F)); }
|
public override int Move4_PP { get => Data[0x1A] & 0x3F; set => Data[0x1A] = (byte)((Data[0x1A] & 0xC0) | Math.Min(63, value)); }
|
||||||
public override int Move1_PPUps { get => (Data[0x17] & 0xC0) >> 6; set => Data[0x17] = (byte)((Data[0x17] & 0x3F) | ((value & 0x3) << 6)); }
|
public override int Move1_PPUps { get => (Data[0x17] & 0xC0) >> 6; set => Data[0x17] = (byte)((Data[0x17] & 0x3F) | ((value & 0x3) << 6)); }
|
||||||
public override int Move2_PPUps { get => (Data[0x18] & 0xC0) >> 6; set => Data[0x18] = (byte)((Data[0x18] & 0x3F) | ((value & 0x3) << 6)); }
|
public override int Move2_PPUps { get => (Data[0x18] & 0xC0) >> 6; set => Data[0x18] = (byte)((Data[0x18] & 0x3F) | ((value & 0x3) << 6)); }
|
||||||
public override int Move3_PPUps { get => (Data[0x19] & 0xC0) >> 6; set => Data[0x19] = (byte)((Data[0x19] & 0x3F) | ((value & 0x3) << 6)); }
|
public override int Move3_PPUps { get => (Data[0x19] & 0xC0) >> 6; set => Data[0x19] = (byte)((Data[0x19] & 0x3F) | ((value & 0x3) << 6)); }
|
||||||
|
@ -199,6 +199,7 @@ namespace PKHeX.Core
|
||||||
public override int Stat_SPD { get => BigEndian.ToUInt16(Data, 0x2E); set => BigEndian.GetBytes((ushort)value).CopyTo(Data, 0x2E); }
|
public override int Stat_SPD { get => BigEndian.ToUInt16(Data, 0x2E); set => BigEndian.GetBytes((ushort)value).CopyTo(Data, 0x2E); }
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
public override int getMovePP(int move, int ppup) => Math.Min(61, base.getMovePP(move, ppup));
|
||||||
public override ushort[] getStats(PersonalInfo p)
|
public override ushort[] getStats(PersonalInfo p)
|
||||||
{
|
{
|
||||||
ushort[] Stats = new ushort[6];
|
ushort[] Stats = new ushort[6];
|
||||||
|
|
|
@ -713,7 +713,7 @@ namespace PKHeX.Core
|
||||||
/// <param name="move">Move ID</param>
|
/// <param name="move">Move ID</param>
|
||||||
/// <param name="ppup">PP Ups count</param>
|
/// <param name="ppup">PP Ups count</param>
|
||||||
/// <returns>Current PP for the move.</returns>
|
/// <returns>Current PP for the move.</returns>
|
||||||
public int getMovePP(int move, int ppup)
|
public virtual int getMovePP(int move, int ppup)
|
||||||
{
|
{
|
||||||
return getBasePP(move) * (5 + ppup) / 5;
|
return getBasePP(move) * (5 + ppup) / 5;
|
||||||
}
|
}
|
||||||
|
@ -723,7 +723,7 @@ namespace PKHeX.Core
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="move">Move ID</param>
|
/// <param name="move">Move ID</param>
|
||||||
/// <returns>Amount of PP the move has by default (no PP Ups).</returns>
|
/// <returns>Amount of PP the move has by default (no PP Ups).</returns>
|
||||||
private int getBasePP(int move)
|
protected int getBasePP(int move)
|
||||||
{
|
{
|
||||||
int[] pptable;
|
int[] pptable;
|
||||||
switch (Format)
|
switch (Format)
|
||||||
|
|
Loading…
Reference in a new issue