namespace PKHeX.Core { /// /// Static Encounter Data /// /// /// Static Encounters are fixed position encounters with properties that are not subject to Wild Encounter conditions. /// public class EncounterStatic : IEncounterable, IMoveset, IGeneration, ILocation { public int Species { get; set; } public int[] Moves { get; set; } public int Level { get; set; } public int LevelMin => Level; public int LevelMax => Level; public int Generation { get; set; } = -1; public int Location { get; set; } public int Ability { get; set; } public int Form { get; set; } public bool? Shiny { get; set; } // false = never, true = always, null = possible public int[] Relearn { get; set; } = new int[4]; public int Gender { get; set; } = -1; public int EggLocation { get; set; } public Nature Nature { get; set; } = Nature.Random; public bool Gift { get; set; } public int Ball { get; set; } = 4; // Only checked when is Gift public GameVersion Version = GameVersion.Any; public int[] IVs { get; set; } public int FlawlessIVCount { get; internal set; } public bool IV3 { set => FlawlessIVCount = value ? 3 : 0; } public int[] Contest { get; set; } public int HeldItem { get; set; } public int EggCycles { get; set; } public bool Fateful { get; set; } public bool RibbonWishing { get; set; } public bool SkipFormCheck { get; set; } public bool Roaming { get; set; } public bool EggEncounter => EggLocation > 0; private void CloneArrays() { // dereference original arrays with new copies Moves = (int[])Moves?.Clone(); Relearn = (int[])Relearn.Clone(); IVs = (int[])IVs?.Clone(); Contest = (int[])Contest?.Clone(); } internal virtual EncounterStatic Clone() { var result = (EncounterStatic)MemberwiseClone(); result.CloneArrays(); return result; } private const string _name = "Static Encounter"; public string Name => Version == GameVersion.Any ? _name : $"{_name} ({Version})"; } }