/// <summary> /// Handle Egg encounters (for example PGF events that were distributed as eggs) /// </summary> /// <param name="pk">pkm distributed as an egg</param> /// <param name="enc">encounter detail</param> /// <param name="tr">save file</param> private static void HandleEggEncounters(this PKM pk, IEncounterable enc, ITrainerInfo tr) { if (!pk.IsEgg) { return; // should be checked before, but condition added for future usecases } // Handle egg encounters. Set them as traded and force hatch them before proceeding pk.ForceHatchPKM(); if (enc is MysteryGift mg && mg.IsEgg) { pk.Language = (int)LanguageID.English; pk.SetTrainerData(tr); } pk.Egg_Location = Locations.TradedEggLocation(pk.GenNumber); }