mirror of
https://github.com/kwsch/PKHeX.git
synced 2026-10-03 12:13:41 -05:00
Remove unused GBLZero PogoType
This was implemented because Niantic messed up some GBL encounters in the past, but it was fixed quick enough for it to not matter for legality, so no encounters actually use this PogoType. Also rename GBLDay => GBLD to match other PogoTypes for consistency across enum names.
This commit is contained in:
@@ -167,8 +167,6 @@ private bool IsMatchPartial(PKM pk)
|
||||
return true;
|
||||
if (!GetIVsAboveMinimum(pk))
|
||||
return true;
|
||||
if (!GetIVsBelowMaximum(pk))
|
||||
return true;
|
||||
|
||||
// Eevee & Glaceon have different base friendships. Make sure if it is invalid that we yield the other encounter before.
|
||||
if (pk.OT_Friendship != OT_Friendship)
|
||||
|
||||
@@ -94,7 +94,7 @@ protected override void ApplyDetails(ITrainerInfo sav, EncounterCriteria criteri
|
||||
pk.MetDate = GetRandomValidDate();
|
||||
if (Gender != Gender.Random)
|
||||
pk.Gender = (int)Gender;
|
||||
pk.SetRandomIVsGO(Type.GetMinIV(), Type.GetMaxIV());
|
||||
pk.SetRandomIVsGO(Type.GetMinIV());
|
||||
}
|
||||
|
||||
public bool GetIVsAboveMinimum(PKM pk)
|
||||
@@ -105,14 +105,6 @@ public bool GetIVsAboveMinimum(PKM pk)
|
||||
return GetIVsAboveMinimum(pk, min);
|
||||
}
|
||||
|
||||
public bool GetIVsBelowMaximum(PKM pk)
|
||||
{
|
||||
int max = Type.GetMaxIV();
|
||||
if (max == 15)
|
||||
return true;
|
||||
return GetIVsBelowMaximum(pk, max);
|
||||
}
|
||||
|
||||
private static bool GetIVsAboveMinimum(PKM pk, int min)
|
||||
{
|
||||
if (pk.IV_ATK >> 1 < min) // ATK
|
||||
@@ -122,21 +114,10 @@ private static bool GetIVsAboveMinimum(PKM pk, int min)
|
||||
return pk.IV_HP >> 1 >= min; // HP
|
||||
}
|
||||
|
||||
private static bool GetIVsBelowMaximum(PKM pk, int max)
|
||||
{
|
||||
if (pk.IV_ATK >> 1 > max) // ATK
|
||||
return false;
|
||||
if (pk.IV_DEF >> 1 > max) // DEF
|
||||
return false;
|
||||
return pk.IV_HP >> 1 <= max; // HP
|
||||
}
|
||||
|
||||
public bool GetIVsValid(PKM pk)
|
||||
{
|
||||
if (!GetIVsAboveMinimum(pk))
|
||||
return false;
|
||||
if (!GetIVsBelowMaximum(pk))
|
||||
return false;
|
||||
|
||||
// HP * 2 | 1 -> HP
|
||||
// ATK * 2 | 1 -> ATK&SPA
|
||||
|
||||
@@ -34,10 +34,7 @@ public enum PogoType : byte
|
||||
/// <summary> Mythical Pokémon captured from the GO Battle League. </summary>
|
||||
GBLM,
|
||||
/// <summary> Pokémon captured from the GO Battle League during GO Battle Day, excluding Legendary and Mythical Pokémon. </summary>
|
||||
/// <remarks> On GO Battle Day (September 18, 2021), IV floor and ceiling were both temporarily set to 0 for non-Legendary encounters. This was fixed at 14:43 UTC (September 17, 2021). </remarks>
|
||||
GBLZero,
|
||||
/// <summary> Pokémon captured from the GO Battle League during GO Battle Day, excluding Legendary and Mythical Pokémon. </summary>
|
||||
GBLDay,
|
||||
GBLD,
|
||||
|
||||
/// <summary> Pokémon captured after defeating members of Team GO Rocket. Must become Purified before transferring to Pokémon HOME. </summary>
|
||||
/// <remarks> Pokémon with this <see cref="PogoType"/> can not be moved to <see cref="GameVersion.GG"/>. </remarks>
|
||||
@@ -61,8 +58,7 @@ public static class PogoTypeExtensions
|
||||
PogoType.ResearchUB => 15,
|
||||
PogoType.GBL => 20,
|
||||
PogoType.GBLM => 20,
|
||||
PogoType.GBLZero => 20,
|
||||
PogoType.GBLDay => 20,
|
||||
PogoType.GBLD => 20,
|
||||
PogoType.Shadow => 8,
|
||||
_ => 1,
|
||||
};
|
||||
@@ -79,22 +75,10 @@ public static class PogoTypeExtensions
|
||||
PogoType.ResearchM => 10,
|
||||
PogoType.ResearchP => 10,
|
||||
PogoType.GBLM => 10,
|
||||
PogoType.GBLZero => 0,
|
||||
PogoType.GBLDay => 0,
|
||||
PogoType.GBLD => 0,
|
||||
_ => 1,
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// Gets the minimum IVs (relative to GO's 0-15) the <see cref="encounterType"/> must have.
|
||||
/// </summary>
|
||||
/// <param name="encounterType">Descriptor indicating how the Pokémon was encountered in GO.</param>
|
||||
/// <returns>Required minimum IV (0-15)</returns>
|
||||
public static int GetMaxIV(this PogoType encounterType) => encounterType switch
|
||||
{
|
||||
PogoType.GBLZero => 0,
|
||||
_ => 15,
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// Checks if the <see cref="ball"/> is valid for the <see cref="encounterType"/>.
|
||||
/// </summary>
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user