private EncounterArea(byte[] data) { Location = BitConverter.ToUInt16(data, 0); Slots = new EncounterSlot[(data.Length - 2) / 4]; for (int i = 0; i < Slots.Length; i++) { ushort SpecForm = BitConverter.ToUInt16(data, 2 + i * 4); Slots[i] = new EncounterSlot { Species = SpecForm & 0x7FF, Form = SpecForm >> 11, LevelMin = data[4 + i * 4], LevelMax = data[5 + i * 4], }; } }
private static bool IsDeferred(this EncounterSlot slot, int currentSpecies, PKM pkm, bool IsHidden) { return(slot.IsDeferredWurmple(currentSpecies, pkm) || slot.IsDeferredHiddenAbility(IsHidden)); }
public static bool IsDeferred4(this EncounterSlot slot, int currentSpecies, PKM pkm, bool IsSafariBall, bool IsSportBall) { return(slot.IsDeferredWurmple(currentSpecies, pkm) || slot.IsDeferredSafari4(IsSafariBall) || slot.IsDeferredSport(IsSportBall)); }
private static bool IsHiddenAbilitySlot(this EncounterSlot slot) { return((slot is EncounterSlot6AO ao && ao.CanDexNav) || slot.Area.Type == SlotType.FriendSafari || slot.Area.Type == SlotType.Horde || slot.Area.Type == SlotType.SOS); }
private static bool IsDeferredHiddenAbility(this EncounterSlot slot, bool IsHidden) => IsHidden && !slot.IsHiddenAbilitySlot();
private static bool IsDeferredSport(this EncounterSlot slot, bool IsSportBall) => IsSportBall != (slot.Area.Type == SlotType.BugContest);