コード例 #1
0
ファイル: EncounterArea.cs プロジェクト: kwsch/PKHeX
 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);