mirror of
https://github.com/kwsch/PKHeX.git
synced 2026-05-06 05:27:14 -05:00
Update egg location -> encounter generating checks
WasEgg only checks for EncounterEgg valid locations; check for any value instead.
This commit is contained in:
parent
1c05001fb7
commit
75801e22e0
|
|
@ -121,7 +121,7 @@ private static bool IsDeferred(this EncounterSlot slot, int currentSpecies, PKM
|
|||
|
||||
public static IEnumerable<EncounterSlot> GetValidFriendSafari(PKM pkm)
|
||||
{
|
||||
if (!pkm.XY || pkm.Met_Location != 148 || pkm.Met_Level != 30) // Friend Safari
|
||||
if (!pkm.XY || pkm.Met_Location != 148 || pkm.Met_Level != 30 || pkm.Egg_Location != 0) // Friend Safari
|
||||
return Enumerable.Empty<EncounterSlot>();
|
||||
var vs = EvolutionChain.GetValidPreEvolutions(pkm).Where(d => d.Level >= 30);
|
||||
return vs.SelectMany(z => Encounters6.FriendSafari[z.Species]);
|
||||
|
|
@ -129,7 +129,7 @@ public static IEnumerable<EncounterSlot> GetValidFriendSafari(PKM pkm)
|
|||
|
||||
private static IEnumerable<EncounterSlot> GetValidEncounterSlots(PKM pkm, EncounterArea loc, IEnumerable<DexLevel> vs, bool DexNav = false, int lvl = -1, bool ignoreLevel = false)
|
||||
{
|
||||
if (pkm.WasEgg)
|
||||
if (pkm.Egg_Location != 0)
|
||||
return Enumerable.Empty<EncounterSlot>();
|
||||
if (lvl < 0)
|
||||
lvl = GetMinLevelEncounter(pkm);
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ public override void Verify(LegalityAnalysis data)
|
|||
var pkm = data.pkm;
|
||||
if (data.EncounterMatch is EncounterStatic)
|
||||
VerifyCXDStarterCorrelation(data);
|
||||
else if (pkm.WasEgg) // can't obtain eggs in CXD
|
||||
else if (pkm.Egg_Location != 0) // can't obtain eggs in CXD
|
||||
data.AddLine(GetInvalid(V80, CheckIdentifier.Encounter)); // invalid encounter
|
||||
|
||||
if (pkm.OT_Gender == 1)
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ private static EncounterType GetEncounterTypeValue(PKM pkm, IEncounterable enc)
|
|||
{
|
||||
// Encounter type data is only stored for gen 4 encounters
|
||||
// All eggs have encounter type none, even if they are from static encounters
|
||||
if (!pkm.Gen4 || pkm.WasEgg)
|
||||
if (!pkm.Gen4 || pkm.Egg_Location != 0)
|
||||
return EncounterType.None;
|
||||
|
||||
if (enc is EncounterSlot w)
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ public static uint GetHexValue(string s)
|
|||
}
|
||||
|
||||
private static bool IsHex(char c) => (c >= '0' && c <= '9') || (c >= 'A' && c <= 'F') || (c >= 'a' && c <= 'f');
|
||||
private static string TitleCase(string word) => word[0].ToString().ToUpper() + word.Substring(1, word.Length - 1).ToLower();
|
||||
private static string TitleCase(string word) => char.ToUpper(word[0]) + word.Substring(1, word.Length - 1).ToLower();
|
||||
|
||||
/// <summary>
|
||||
/// Filters the string down to only valid hex characters, returning a new string.
|
||||
|
|
|
|||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue
Block a user