예제 #1
0
 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],
         };
     }
 }
예제 #2
0
 private static bool IsDeferred(this EncounterSlot slot, int currentSpecies, PKM pkm, bool IsHidden)
 {
     return(slot.IsDeferredWurmple(currentSpecies, pkm) ||
            slot.IsDeferredHiddenAbility(IsHidden));
 }
예제 #3
0
 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));
 }
예제 #4
0
 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);
 }
예제 #5
0
 private static bool IsDeferredHiddenAbility(this EncounterSlot slot, bool IsHidden) => IsHidden && !slot.IsHiddenAbilitySlot();
예제 #6
0
 private static bool IsDeferredSport(this EncounterSlot slot, bool IsSportBall) => IsSportBall != (slot.Area.Type == SlotType.BugContest);