internal static EncounterSlot[] getValidFriendSafari(PKM pkm) { if (!pkm.XY) { return(null); } if (pkm.Met_Location != 148) // Friend Safari { return(null); } if (pkm.Met_Level != 30) { return(null); } IEnumerable <DexLevel> vs = getValidPreEvolutions(pkm); List <EncounterSlot> slots = new List <EncounterSlot>(); foreach (DexLevel d in vs.Where(d => FriendSafari.Contains(d.Species) && d.Level >= 30)) { slots.Add(new EncounterSlot { Species = d.Species, LevelMin = 30, LevelMax = 30, Form = 0, Type = SlotType.FriendSafari, }); } return(slots.Any() ? slots.ToArray() : null); }
internal static bool getCanBeCaptured(int species, int version = -1) { if (version < 0 || version == (int)GameVersion.X) { if (SlotsX.Any(loc => loc.Slots.Any(slot => slot.Species == species))) { return(true); } if (FriendSafari.Contains(species)) { return(true); } if (StaticX.Any(enc => enc.Species == species && !enc.Gift)) { return(true); } } if (version < 0 || version == (int)GameVersion.Y) { if (SlotsY.Any(loc => loc.Slots.Any(slot => slot.Species == species))) { return(true); } if (FriendSafari.Contains(species)) { return(true); } if (StaticY.Any(enc => enc.Species == species && !enc.Gift)) { return(true); } } if (version < 0 || version == (int)GameVersion.AS) { if (SlotsA.Any(loc => loc.Slots.Any(slot => slot.Species == species))) { return(true); } if (StaticA.Any(enc => enc.Species == species && !enc.Gift)) { return(true); } } if (version < 0 || version == (int)GameVersion.OR) { if (SlotsO.Any(loc => loc.Slots.Any(slot => slot.Species == species))) { return(true); } if (StaticO.Any(enc => enc.Species == species && !enc.Gift)) { return(true); } } return(false); }
private static bool getCanBeCaptured(int species, IEnumerable <EncounterArea> area, IEnumerable <EncounterStatic> statics, bool XY = false) { if (XY && FriendSafari.Contains(species)) { return(true); } if (area.Any(loc => loc.Slots.Any(slot => slot.Species == species))) { return(true); } if (statics.Any(enc => enc.Species == species && !enc.Gift)) { return(true); } return(false); }