mirror of
https://github.com/kwsch/PKHeX.git
synced 2026-05-14 08:00:33 -05:00
looks like for gen4 I have to yield twice as many frames (for FixedLevel and non) as level call usage is dependent on encounter
70 lines
2.5 KiB
C#
70 lines
2.5 KiB
C#
namespace PKHeX.Core
|
|
{
|
|
public class EncounterSlotPermissions
|
|
{
|
|
public int StaticIndex { get; set; } = -1;
|
|
public int MagnetPullIndex { get; set; } = -1;
|
|
public int StaticCount { get; set; }
|
|
public int MagnetPullCount { get; set; }
|
|
|
|
public bool AllowDexNav { get; set; }
|
|
public bool Pressure { get; set; }
|
|
public bool DexNav { get; set; }
|
|
public bool WhiteFlute { get; set; }
|
|
public bool BlackFlute { get; set; }
|
|
public bool IsNormalLead => !(WhiteFlute || BlackFlute || DexNav);
|
|
public bool IsDexNav => AllowDexNav && DexNav;
|
|
}
|
|
/// <summary>
|
|
/// Wild Encounter Slot data
|
|
/// </summary>
|
|
public class EncounterSlot : IEncounterable, IGeneration
|
|
{
|
|
public int Species { get; set; }
|
|
public int Form { get; set; }
|
|
public int LevelMin { get; set; }
|
|
public int LevelMax { get; set; }
|
|
public SlotType Type { get; set; } = SlotType.Any;
|
|
public EncounterType TypeEncounter { get; set; } = EncounterType.None;
|
|
public int SlotNumber { get; set; }
|
|
public bool EggEncounter => false;
|
|
public int Generation { get; set; } = -1;
|
|
internal EncounterSlotPermissions _perm;
|
|
public EncounterSlotPermissions Permissions => _perm ?? (_perm = new EncounterSlotPermissions());
|
|
|
|
internal EncounterArea Area { get; set; }
|
|
public int Location => Area.Location;
|
|
public EncounterSlot Clone() => (EncounterSlot)MemberwiseClone();
|
|
public bool FixedLevel => LevelMin == LevelMax;
|
|
|
|
public string Name
|
|
{
|
|
get
|
|
{
|
|
const string wild = "Wild Encounter";
|
|
if (Type == SlotType.Any)
|
|
return wild;
|
|
return $"{wild} {Type.ToString().Replace("_", " ")}";
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Generation 1 Wild Encounter Slot data
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Contains Time data which is present in <see cref="GameVersion.C"/> origin data.
|
|
/// Contains <see cref="GameVersion"/> identification, as this Version value is not stored in <see cref="PK1"/> or <see cref="PK2"/> formats.
|
|
/// </remarks>
|
|
public class EncounterSlot1 : EncounterSlot
|
|
{
|
|
public int Rate;
|
|
internal EncounterTime Time = EncounterTime.Any;
|
|
public GameVersion Version = GameVersion.Any;
|
|
}
|
|
public class EncounterSlotMoves : EncounterSlot, IMoveset
|
|
{
|
|
public int[] Moves { get; set; }
|
|
}
|
|
}
|