From c847ef1d71f3fd0b5956089c096d7113b224574b Mon Sep 17 00:00:00 2001 From: javierhimura Date: Sat, 22 Apr 2017 20:49:49 +0200 Subject: [PATCH] Special Eggs improvement and Generation 4 Encounter Type legal analysis (#1083) * Ignore relearn level 2-100 moves from Phione * Cave encounter types DPPt * Generation 4 EncounterType filter and validation Not every generation 4 static encounter have yet their encounter type defined, i temporally included Any to those encounters Generation 4 roaaming static encounters have been splitted in two, grass and surf * Added new legality texts * Added unreleased event DP Darkai, added check for surf in jhoto route 45, is impossible Moved unreleased DP locations to valid Platinum locations only * Improved generation 3 special egg check. Only check special egg if pokemon knows any of the special egg moves, also in that case do check for normal egg before special egg because special eggs will explicitly check for normal egg moves but normal eggs will not check special egg moves, it will improve the error output * Clean up * Fix gen 5 pokemon from issue #1011 Those pokemon have generation 4 static gift encounters and also wild encounters, the analysis was selecting the static encounter, but if there is a valid wild encounter and the static encounter does not match the pokemon ball the willd encounter should be selected instead Also move the transfer legality to check it before the static encounters and make that check to work like generation 3 transfer legality * Another fix for Issue 1011, suppress temporally OT and pokemon name analysis for generations 3 to 5 instead of format 3 to 5, there is no data stored yet to make those analysis * Do not make wild encounters prevail static encounter if the pokemon was an egg * Changed type of WildEncounter variable to EncounterSlot[] * Fix Jhoto Route 45 to avoid return error with fishing encounters --- PKHeX/Legality/Analysis.cs | 3 +- PKHeX/Legality/Checks.cs | 136 ++++++-- PKHeX/Legality/Core.cs | 145 ++++++++- PKHeX/Legality/LegalityCheckStrings.cs | 6 +- PKHeX/Legality/Structures/EncounterSlot.cs | 1 + PKHeX/Legality/Structures/EncounterStatic.cs | 7 +- PKHeX/Legality/Structures/EncounterType.cs | 18 ++ PKHeX/Legality/Tables4.cs | 302 ++++++++++++------ PKHeX/PKHeX.Core.csproj | 1 + .../text/en/LegalityCheckStrings_en.txt | 7 +- .../text/ko/LegalityCheckStrings_ko.txt | 7 +- .../text/zh/LegalityCheckStrings_zh.txt | 7 +- 12 files changed, 488 insertions(+), 152 deletions(-) create mode 100644 PKHeX/Legality/Structures/EncounterType.cs diff --git a/PKHeX/Legality/Analysis.cs b/PKHeX/Legality/Analysis.cs index c026b3201..4e96c138d 100644 --- a/PKHeX/Legality/Analysis.cs +++ b/PKHeX/Legality/Analysis.cs @@ -221,7 +221,8 @@ namespace PKHeX.Core verifyMisc(); verifyGender(); verifyItem(); - + if (pkm.Format >= 4) + verifyEncounterType(); if (pkm.Format >= 6) { History = verifyHistory(); diff --git a/PKHeX/Legality/Checks.cs b/PKHeX/Legality/Checks.cs index b072c4d68..37246d5a4 100644 --- a/PKHeX/Legality/Checks.cs +++ b/PKHeX/Legality/Checks.cs @@ -354,7 +354,7 @@ namespace PKHeX.Core } return; } - else if (3 <= pkm.Format && pkm.Format <= 5) + else if (3 <= pkm.GenNumber && pkm.GenNumber <= 5) { // Suppressing temporarily return; @@ -697,6 +697,18 @@ namespace PKHeX.Core { EncounterSlot[] enc = (EncounterSlot[])EncounterMatch; + // Check for Unreleased Encounters / Collisions + switch (pkm.GenNumber) + { + case 4: + if(pkm.HasOriginalMetLocation && pkm.Met_Location == 193 && enc.All( t => t.Type == SlotType.Surf)) + { + // Pokemon surfing in Jhoto Route 45 + return new CheckResult(Severity.Invalid, V384, CheckIdentifier.Encounter); + } + break; + } + if (enc.Any(slot => slot.Normal)) return enc.All(slot => slot.Pressure) ? new CheckResult(Severity.Valid, V67, CheckIdentifier.Encounter) @@ -733,8 +745,12 @@ namespace PKHeX.Core case 4: if (pkm.Species == 493 && s.Location == 086) // Azure Flute Arceus return new CheckResult(Severity.Invalid, V352, CheckIdentifier.Encounter); + if (pkm.Species == 491 && s.Location == 079 && !pkm.Pt) // DP Darkrai + return new CheckResult(Severity.Invalid, V383, CheckIdentifier.Encounter); if (pkm.Species == 492 && s.Location == 063 && !pkm.Pt) // DP Shaymin return new CheckResult(Severity.Invalid, V354, CheckIdentifier.Encounter); + if (s.Location == 193 && s.TypeEncounter == Core.EncounterType.Surfing_Fishing) // Roaming pokemon surfin in Jhoto Route 45 + return new CheckResult(Severity.Invalid, V384, CheckIdentifier.Encounter); break; case 7: if (s.EggLocation == 60002 && vRelearn.All(rl => rl.Valid)) @@ -795,6 +811,34 @@ namespace PKHeX.Core return result; } + private void verifyEncounterType() + { + EncounterType Type = Core.EncounterType.None; + // Encounter type data is only stored for gen 4 encounters + // Gen 6 -> 7 transfer delete encounter type data + // All eggs have encounter type none, even if they are from static encounters + if (pkm.Format < 7 && pkm.Gen4 && !pkm.WasEgg) + { + if (EncounterMatch as EncounterSlot[] != null) + // If there is more than one slot, the get wild encounter have filter for the pkm type encounter like safari/sports ball + Type = (EncounterMatch as EncounterSlot[]).First().TypeEncounter; + if (EncounterMatch as EncounterStatic != null) + Type = (EncounterMatch as EncounterStatic).TypeEncounter; + } + if (Type == Core.EncounterType.Any) + { + // Temp analysis until all generation 4 static encounters have defined their encounter type values + AddLine(Severity.NotImplemented, V382, CheckIdentifier.Encounter); + return; + } + if (Type != (EncounterType)pkm.EncounterType) + { + AddLine(Severity.Invalid, V381, CheckIdentifier.Encounter); + return; + } + AddLine(Severity.Valid, V380, CheckIdentifier.Encounter); + } + private CheckResult verifyEncounter() { // Special considerations have to be applied when encounter info is lost on transfer. @@ -929,7 +973,34 @@ namespace PKHeX.Core private CheckResult verifyEncounterG4Transfer() { CheckResult Gen4Result = null; - + CheckResult Gen4WildResult = null; + EncounterSlot[] WildEncounter = null; + + // Transfer Legality + int loc = pkm.Met_Location; + if (loc != 30001) // PokéTransfer + { + // Crown + switch (pkm.Species) + { + case 251: // Celebi + if (loc == 30010 || loc == 30011) // unused || used + return Gen4Result; + AddLine(Severity.Invalid, V351, CheckIdentifier.Encounter); + break; + case 243: // Raikou + case 244: // Entei + case 245: // Suicune + if (loc == 30012 || loc == 30013) // unused || used + return Gen4Result; + AddLine(Severity.Invalid, V351, CheckIdentifier.Encounter); + break; + default: + AddLine(Severity.Invalid, V61, CheckIdentifier.Encounter); + break; + } + } + bool wasEvent = pkm.WasEvent || pkm.WasEventEgg; if (wasEvent) { @@ -938,11 +1009,19 @@ namespace PKHeX.Core Gen4Result = result; } + if (Gen4Result == null && null != (EncounterMatch = Legal.getValidWildEncounters(pkm))) + { + Gen4WildResult = verifyEncounterWild(); + WildEncounter = (EncounterSlot[])EncounterMatch; + } + if (Gen4Result == null && null != (EncounterStaticMatch = Legal.getValidStaticEncounter(pkm))) { EncounterMatch = EncounterStaticMatch.First(); var result = verifyEncounterStatic(); - if (result != null) + // A pokemon could match a static encounter and a wild encounter at the same time, by default static encounter have preferences + // But if the pokemon does not match the static encounter ball and there is a valid wild encounter skip static encounter + if (result != null && (pkm.WasEgg || Gen4WildResult == null || EncounterStaticMatch.Any(sttic => !sttic.Gift || pkm.Ball == sttic.Ball))) return result; EncounterStaticMatch = null; @@ -952,8 +1031,11 @@ namespace PKHeX.Core if (pkm.WasEgg) // Invalid transfer is already checked in encounter egg return verifyEncounterEgg(); - if (Gen4Result == null && null != (EncounterMatch = Legal.getValidWildEncounters(pkm))) - Gen4Result = verifyEncounterWild(); + if (Gen4Result == null && Gen4WildResult != null) + { + Gen4Result = Gen4WildResult; + EncounterMatch = WildEncounter; + } if (Gen4Result == null && null != (EncounterMatch = Legal.getValidIngameTrade(pkm))) Gen4Result = verifyEncounterTrade(); @@ -963,31 +1045,7 @@ namespace PKHeX.Core ? new CheckResult(Severity.Invalid, V78, CheckIdentifier.Encounter) : new CheckResult(Severity.Invalid, V80, CheckIdentifier.Encounter); - // Transfer Legality - - // PokéTransfer - int loc = pkm.Met_Location; - if (loc == 30001) - return Gen4Result; - - // Crown - switch (pkm.Species) - { - case 251: // Celebi - if (loc == 30010 || loc == 30011) // unused || used - return Gen4Result; - return new CheckResult(Severity.Invalid, V351, CheckIdentifier.Encounter); - - case 243: // Raikou - case 244: // Entei - case 245: // Suicune - if (loc == 30012 || loc == 30013) // unused || used - return Gen4Result; - return new CheckResult(Severity.Invalid, V351, CheckIdentifier.Encounter); - } - - // No Match - return new CheckResult(Severity.Invalid, V61, CheckIdentifier.Encounter); + return Gen4Result; } private CheckResult verifyVCEncounter(int baseSpecies) { @@ -2406,13 +2464,21 @@ namespace PKHeX.Core encounters.Add(EncounterMatch); else if (null != (EncounterMatch as IMoveset)?.Moves) encounters.Add(EncounterMatch); - + if (!pkm.IsEgg) + { + // Add player hatched egg before special egg, this will allow to show correct legality erros if the pokemon have normal egg moves and event egg moves + encounters.Add(null); //Can not distinguish event egg and normal egg after hatching, and not in the EncounterStaticMatch - encounters.AddRange(Legal.getG3SpecialEggEncounter(pkm)); - - // add player hatched egg except if there is a gen 3 gift egg or event egg encounter adn the pokemon is inside an egg - if (!encounters.Any() || !pkm.IsEgg) + var specialeggs = Legal.getG3SpecialEggEncounter(pkm); + foreach (var specialegg in specialeggs) + { + if (specialegg.Moves.Any(m => m != 0 && pkm.Moves.Contains(m))) + encounters.Add(specialegg); + } + } + else if (!encounters.Any()) + // add player hatched egg except if there is a gen 3 gift egg or event egg encounter adn the pokemon is inside an egg encounters.Add(null); return encounters; diff --git a/PKHeX/Legality/Core.cs b/PKHeX/Legality/Core.cs index dc903ee8b..c83efda90 100644 --- a/PKHeX/Legality/Core.cs +++ b/PKHeX/Legality/Core.cs @@ -301,6 +301,108 @@ namespace PKHeX.Core { ReduceAreasSize(ref Areas); } + private static EncounterType GetEncounterTypeBySlotDPPt( SlotType Type, EncounterType GrassType) + { + switch (Type) + { + case SlotType.Pokeradar: + case SlotType.Grass: return GrassType; + case SlotType.Surf: + case SlotType.Old_Rod: + case SlotType.Good_Rod: + case SlotType.Super_Rod: return EncounterType.Surfing_Fishing; + case SlotType.Grass_Safari: + case SlotType.Surf_Safari: + case SlotType.Old_Rod_Safari: + case SlotType.Good_Rod_Safari: + case SlotType.Super_Rod_Safari: return EncounterType.MarshSafari; + case SlotType.HoneyTree: return EncounterType.None; + } + return EncounterType.None; + } + private static EncounterType GetEncounterTypeBySlotHGSS(SlotType Type, EncounterType GrassType) + { + switch (Type) + { + // HGSS Safari encounters have normal water/grass encounter type, not safari encounter type + case SlotType.Grass: + case SlotType.Grass_Safari: return GrassType; + case SlotType.Surf: + case SlotType.Old_Rod: + case SlotType.Good_Rod: + case SlotType.Super_Rod: + case SlotType.Surf_Safari: + case SlotType.Old_Rod_Safari: + case SlotType.Good_Rod_Safari: + case SlotType.Super_Rod_Safari: return EncounterType.Surfing_Fishing; + case SlotType.Rock_Smash: + case SlotType.Rock_Smash_Safari: return EncounterType.RockSmash; + case SlotType.Headbutt: return EncounterType.None; + } + return EncounterType.None; + } + private static void MarkDPPtEncounterTypeSlots_Route209(ref EncounterArea[] Areas) + { + // Route 209 have two different encounter type for grass encounters + // The first area with location 24 is the proper Route 209 with tall grass encounters + // The other areas with the same location in the raw file is the lost tower, all encounters inside the tower are buildiing encounter + bool FirstArea = true; + foreach (EncounterArea Area in Areas.Where(x => x.Location == 24)) + { + var GrassType = FirstArea ? EncounterType.TallGrass : EncounterType.Building_EnigmaStone; + if (FirstArea) + FirstArea = false; + foreach (EncounterSlot Slot in Area.Slots) + { + Slot.TypeEncounter = GetEncounterTypeBySlotDPPt(Slot.Type, GrassType); + } + } + } + private static void MarkHGSSEncounterTypeSlots_RuinsofAlph(ref EncounterArea[] Areas) + { + // Ruins of Alph have two different encounter type for grass encounters + // The first area with location 209 is the outside area of the ruins with tall grass encounters + // The other areas with the same location in the raw file is the inside of the ruins, all encounters inside are cave encounters + bool FirstArea = true; + foreach (EncounterArea Area in Areas.Where(x => x.Location == 209)) + { + var GrassType = FirstArea ? EncounterType.TallGrass : EncounterType.Cave_HallOfOrigin; + if (FirstArea) + FirstArea = false; + foreach (EncounterSlot Slot in Area.Slots) + { + Slot.TypeEncounter = GetEncounterTypeBySlotHGSS(Slot.Type, GrassType); + } + } + } + private static void MarkDPPtEncounterTypeSlots(ref EncounterArea[] Areas) + { + foreach(EncounterArea Area in Areas) + { + if (Area.Location == 24) + continue; + var GrassType = (Area.Location == 70) ? EncounterType.Building_EnigmaStone :// Old Chateau + DPPt_CaveLocations.Contains(Area.Location) ? EncounterType.Cave_HallOfOrigin : + EncounterType.TallGrass; + foreach (EncounterSlot Slot in Area.Slots) + { + Slot.TypeEncounter = GetEncounterTypeBySlotDPPt(Slot.Type, GrassType); + } + } + } + private static void MarkHGSSEncounterTypeSlots(ref EncounterArea[] Areas) + { + foreach (EncounterArea Area in Areas) + { + if (Area.Location == 209) + continue; + var GrassType = HGSS_CaveLocations.Contains(Area.Location) ? EncounterType.Cave_HallOfOrigin: EncounterType.TallGrass; + foreach (EncounterSlot Slot in Area.Slots) + { + Slot.TypeEncounter = GetEncounterTypeBySlotHGSS(Slot.Type, GrassType); + } + } + } private static void MarkBWSwarmSlots(ref EncounterArea[] Areas) { foreach (EncounterSlot s in Areas.SelectMany(area => area.Slots)) @@ -545,6 +647,12 @@ namespace PKHeX.Core MarkG4AltFormSlots(ref Pt_Slots, 422, 1, Shellos_EastSeaLocation_Pt); MarkG4AltFormSlots(ref Pt_Slots, 423, 1, Gastrodon_EastSeaLocation_Pt); + MarkDPPtEncounterTypeSlots_Route209(ref D_Slots); + MarkDPPtEncounterTypeSlots_Route209(ref P_Slots); + MarkDPPtEncounterTypeSlots_Route209(ref Pt_Slots); + MarkHGSSEncounterTypeSlots_RuinsofAlph(ref HG_Slots); + MarkHGSSEncounterTypeSlots_RuinsofAlph(ref SS_Slots); + MarkG4Slots(ref D_Slots); MarkG4Slots(ref P_Slots); MarkG4Slots(ref Pt_Slots); @@ -563,6 +671,12 @@ namespace PKHeX.Core SlotsHG = addExtraTableSlots(HG_Slots, HG_Headbutt_Slots, SlotsHGSSAlt); SlotsSS = addExtraTableSlots(SS_Slots, SS_Headbutt_Slots, SlotsHGSSAlt); + MarkDPPtEncounterTypeSlots(ref D_Slots); + MarkDPPtEncounterTypeSlots(ref P_Slots); + MarkDPPtEncounterTypeSlots(ref Pt_Slots); + MarkHGSSEncounterTypeSlots(ref HG_Slots); + MarkHGSSEncounterTypeSlots(ref SS_Slots); + Evolves4 = new EvolutionTree(new[] { Resources.evos_g4 }, GameVersion.DP, PersonalTable.DP, MaxSpeciesID_4); // Update Personal Entries with Tutor Data @@ -923,7 +1037,8 @@ namespace PKHeX.Core form = 0; r.AddRange(getEggMoves(pkm, species, form)); - r.AddRange(getRelearnLVLMoves(pkm, species, 100, pkm.AltForm)); + if(pkm.Species != 489) + r.AddRange(getRelearnLVLMoves(pkm, species, 100, pkm.AltForm)); return r.Distinct(); } internal static List[] getShedinjaEvolveMoves(PKM pkm, int lvl = -1, int generation = 0) @@ -967,11 +1082,17 @@ namespace PKHeX.Core { case GameVersion.GS: if (pkm.InhabitedGeneration(2)) - return LevelUpGS[species].getMoves(lvl); + if (pkm.Format == 1) + return LevelUpGS[species].getMoves(lvl).Where(m => m <= MaxMoveID_1).ToArray(); + else + return LevelUpGS[species].getMoves(lvl); break; case GameVersion.C: if (pkm.InhabitedGeneration(2)) - return LevelUpC[species].getMoves(lvl); + if (pkm.Format == 1) + return LevelUpC[species].getMoves(lvl).Where(m => m <= MaxMoveID_1).ToArray(); + else + return LevelUpC[species].getMoves(lvl); break; case GameVersion.R: @@ -1172,7 +1293,15 @@ namespace PKHeX.Core : s.Where(slot => slot.Type != SlotType.BugContest).ToList(); if (s_BugContest.Any()) // sport ball only in BCC and non sport balls only outside BCC - return s_BugContest.ToArray(); + s = s_BugContest.ToList(); + + // If there is only one valid encounter defer encountertype check to verify encounter type + if (s.Count <= 1 || pkm.Format == 7) + return s.Any() ? s.ToArray() : null; + + var s_EncounterTypes = s.Where(slot => slot.TypeEncounter == (EncounterType)pkm.EncounterType).ToList(); + if (s_EncounterTypes.Any()) + return s_EncounterTypes.ToArray(); return s.Any() ? s.ToArray() : null; } @@ -1189,6 +1318,14 @@ namespace PKHeX.Core return null; // Back Check against pkm var enc = getMatchingStaticEncounters(pkm, poss, lvl).ToList(); + + // If there is only one valid encounter defer encountertype check to verify encounter type + if(enc.Count > 1 && pkm.Gen4 && pkm.Format < 7) + { + var s_EncounterTypes = enc.Where(stc => stc.TypeEncounter == EncounterType.Any || stc.TypeEncounter == (EncounterType)pkm.EncounterType); + if (s_EncounterTypes.Any()) + return s_EncounterTypes.ToList(); + } return enc.Any() ? enc : null; } private static IEnumerable getMatchingStaticEncounters(PKM pkm, IEnumerable poss, int lvl) diff --git a/PKHeX/Legality/LegalityCheckStrings.cs b/PKHeX/Legality/LegalityCheckStrings.cs index e06e2192b..2295af7cd 100644 --- a/PKHeX/Legality/LegalityCheckStrings.cs +++ b/PKHeX/Legality/LegalityCheckStrings.cs @@ -61,7 +61,8 @@ namespace PKHeX.Core public static string V361 { get; set; } = "Default move."; public static string V362 { get; set; } = "Default move in generation {0}."; public static string V372 { get; set; } = "{0} Berry"; - + public static string V380 { get; set; } = "Encounter Type match encounter."; + public static string V382 { get; set; } = "Encounter Type not implemented for pokemon encounter."; #endregion #region Legality Check Result Strings @@ -350,6 +351,8 @@ namespace PKHeX.Core public static string V352 {get; set;} = "Arceus from Hall of Origin. Unreleased event."; public static string V353 {get; set;} = "Non japanese Mew from Faraway Island. Unreleased event."; public static string V354 {get; set;} = "Non Platinum Shaymin from Flower Paradise. Unreleased event."; + public static string V383 {get; set;} = "Non Platinum Darkrai from Newmoon Island.Unreleased event."; + public static string V384 {get; set;} = "Johto Route 45 surfing encounter. Unreachable Water tiles."; public static string V357 {get; set;} = "Only one Ninjask move allowed."; public static string V358 {get; set;} = "Inherited move learned by Level-up. Incompatible with event egg moves."; public static string V359 {get; set;} = "Unable to match a gift egg encounter from origin game."; @@ -369,6 +372,7 @@ namespace PKHeX.Core public static string V377 {get; set;} = "Egg Move. Not expected in a gift egg."; public static string V378 {get; set;} = "Inherited move learned by Level-up. Not expected in a gift egg."; public static string V379 {get; set;} = "{0} Inherited Move. Incompatible with {1} inherited moves."; + public static string V381 {get; set;} = "Encounter Type does not match encounter."; #endregion } diff --git a/PKHeX/Legality/Structures/EncounterSlot.cs b/PKHeX/Legality/Structures/EncounterSlot.cs index d2a388d73..2617101d1 100644 --- a/PKHeX/Legality/Structures/EncounterSlot.cs +++ b/PKHeX/Legality/Structures/EncounterSlot.cs @@ -7,6 +7,7 @@ public int LevelMin { get; set; } public int LevelMax { get; set; } public SlotType Type = SlotType.Any; + public EncounterType TypeEncounter = EncounterType.None; public bool AllowDexNav; public bool Pressure; public bool DexNav; diff --git a/PKHeX/Legality/Structures/EncounterStatic.cs b/PKHeX/Legality/Structures/EncounterStatic.cs index bde65ebd8..63a101703 100644 --- a/PKHeX/Legality/Structures/EncounterStatic.cs +++ b/PKHeX/Legality/Structures/EncounterStatic.cs @@ -10,6 +10,7 @@ public int LevelMax { get { return Level; } } public int Generation { get; set; } = -1; public int Location; + public EncounterType TypeEncounter = EncounterType.Any; public int Ability; public int Form; public bool? Shiny; // false = never, true = always, null = possible @@ -68,7 +69,8 @@ SkipFormCheck = SkipFormCheck, NSparkle = NSparkle, Roaming = Roaming, - EggCycles = EggCycles + EggCycles = EggCycles, + TypeEncounter = TypeEncounter }; } @@ -107,7 +109,8 @@ SkipFormCheck = SkipFormCheck, NSparkle = NSparkle, Roaming = Roaming, - EggCycles = EggCycles + EggCycles = EggCycles, + TypeEncounter = TypeEncounter }; } diff --git a/PKHeX/Legality/Structures/EncounterType.cs b/PKHeX/Legality/Structures/EncounterType.cs new file mode 100644 index 000000000..b2cc13c25 --- /dev/null +++ b/PKHeX/Legality/Structures/EncounterType.cs @@ -0,0 +1,18 @@ +namespace PKHeX.Core +{ + public enum EncounterType + { + Any = -1, + None = 0, + RockSmash = 1, + TallGrass = 2, + DialgaPalkia = 4, + Cave_HallOfOrigin = 5, + Surfing_Fishing = 7, + Building_EnigmaStone = 9, + MarshSafari = 10, + Starter_Fossil_Gift_DP = 12, + DistortionWorld_Pt = 23, + Starter_Fossil_Gift_Pt_DPTrio = 24, + } +} diff --git a/PKHeX/Legality/Tables4.cs b/PKHeX/Legality/Tables4.cs index badf0db78..01b8967d4 100644 --- a/PKHeX/Legality/Tables4.cs +++ b/PKHeX/Legality/Tables4.cs @@ -172,6 +172,8 @@ namespace PKHeX.Core 005, // Safari Ball 016, // Cherish Ball 147, // Mosaic Mail + 499, // Sport Ball + 500, // Park Ball }; internal static readonly bool[] ReleasedHeldItems_4 = Enumerable.Range(0, MaxItemID_4_HGSS+1).Select(i => HeldItems_HGSS.Contains((ushort)i) && !UnreleasedItems_4.Contains(i)).ToArray(); internal static readonly int[] CrownBeasts = {251, 243, 244, 245}; @@ -200,8 +202,49 @@ namespace PKHeX.Core new[] { 147, 148, 149, 230, 329, 330, 334, 371, 372, 373, 380, 381, 384, 443, 444, 445, 483, 484, 487 } }; + #region Encounter Types + internal static readonly int[] DPPt_CaveLocations = + { + 46, // Oreburgh Mine + 50, // Mt. Coronet + 53, // Solaceon Ruins + 54, // Sinnoh Victory Road + 57, // Ravaged Path + 59, // Oreburgh Gate + 62, // Turnback Cave + 64, // Snowpoint Temple + 65, // Wayward Cave + 66, // Ruin Maniac Cave + 69, // Iron Island + 84, // Stark Mountain + }; + internal static readonly int[] HGSS_CaveLocations = + { + 197, // DIGLETT's Cave + 198, // Mt. Moon + 199, // Cerulean Cave + 200, // Rock Tunnel + 201, // Power Plant + 203, // Seafoam Islands + 204, // Sprout Tower + 205, // Bell Tower + 206, // Burned Tower + 209, // Ruins of Alph + 210, // Union Cave + 211, // SLOWPOKE Well + 216, // Mt. Mortar + 217, // Ice Path + 218, // Whirl Islands + 219, // Mt. Silver Cave + 220, // Dark Cave + 221, // Kanto Victory Road + 223, // Tohjo Falls + 228, // Cliff Cave + 234, // Cliff Edge Gate + }; + #endregion #region Pokéwalker Encounter - // all pkm are in Poke Ball and have a met location of "PokeWalker" + // all pkm are in Poke Ball and have a met location of "PokeWalker" internal static readonly EncounterStatic[] Encounter_PokeWalker = { // Some pkm has a pre-level move, an egg move or even a special move, it might be also available via HM/TM/Tutor @@ -374,152 +417,193 @@ namespace PKHeX.Core }; #endregion #region Static Encounter/Gift Tables - internal static readonly int[] Roaming_MetLocation_DPPt = + internal static readonly int[] Roaming_MetLocation_DPPt_Grass = { - // Route 201-222 can be encountered in either grass or water + // Routes 201-218, 221-222 can be encountered in grass 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, - 36, 37, + 26, 27, 28, 29, 30, 31, 32, 33, 36, 37, 47, // Valley Windworks 49, // Fuego Ironworks }; - internal static readonly EncounterStatic[] Encounter_DPPt_Roam = + internal static readonly int[] Roaming_MetLocation_DPPt_Surf = { - new EncounterStatic { Species = 481, Level = 50, Roaming = true }, //Mesprit - new EncounterStatic { Species = 488, Level = 50, Roaming = true }, //Cresselia - new EncounterStatic { Species = 144, Level = 60, Version = GameVersion.Pt, Roaming = true }, //Articuno - new EncounterStatic { Species = 145, Level = 60, Version = GameVersion.Pt, Roaming = true }, //Zapdos - new EncounterStatic { Species = 146, Level = 60, Version = GameVersion.Pt, Roaming = true }, //Moltres + // Routes 203-205, 208-210, 212-214, 218-222 can be encountered in water + 18, 19, 20, 23, 24, 25, 27, 28, 29, 33, + 34, 35, 36, 37, + 47, // Valley Windworks + 49, // Fuego Ironworks + }; + internal static readonly EncounterStatic[] Encounter_DPPt_Roam_Grass = + { + new EncounterStatic { Species = 481, Level = 50, Roaming = true, TypeEncounter = EncounterType.TallGrass }, //Mesprit + new EncounterStatic { Species = 488, Level = 50, Roaming = true, TypeEncounter = EncounterType.TallGrass }, //Cresselia + new EncounterStatic { Species = 144, Level = 60, Version = GameVersion.Pt, Roaming = true, TypeEncounter = EncounterType.TallGrass }, //Articuno + new EncounterStatic { Species = 145, Level = 60, Version = GameVersion.Pt, Roaming = true, TypeEncounter = EncounterType.TallGrass }, //Zapdos + new EncounterStatic { Species = 146, Level = 60, Version = GameVersion.Pt, Roaming = true, TypeEncounter = EncounterType.TallGrass }, //Moltres + }; + internal static readonly EncounterStatic[] Encounter_DPPt_Roam_Surf = + { + new EncounterStatic { Species = 481, Level = 50, Roaming = true, TypeEncounter = EncounterType.Surfing_Fishing }, //Mesprit + new EncounterStatic { Species = 488, Level = 50, Roaming = true, TypeEncounter = EncounterType.Surfing_Fishing }, //Cresselia + new EncounterStatic { Species = 144, Level = 60, Version = GameVersion.Pt, Roaming = true, TypeEncounter = EncounterType.Surfing_Fishing }, //Articuno + new EncounterStatic { Species = 145, Level = 60, Version = GameVersion.Pt, Roaming = true, TypeEncounter = EncounterType.Surfing_Fishing }, //Zapdos + new EncounterStatic { Species = 146, Level = 60, Version = GameVersion.Pt, Roaming = true, TypeEncounter = EncounterType.Surfing_Fishing }, //Moltres }; - internal static readonly EncounterStatic[] Encounter_DPPt_Regular = { //Starters - new EncounterStatic { Gift = true, Species = 387, Level = 5, Location = 076, Version = GameVersion.DP,}, // Turtwig @ Lake Verity - new EncounterStatic { Gift = true, Species = 390, Level = 5, Location = 076, Version = GameVersion.DP,}, // Chimchar - new EncounterStatic { Gift = true, Species = 393, Level = 5, Location = 076, Version = GameVersion.DP,}, // Piplup - new EncounterStatic { Gift = true, Species = 387, Level = 5, Location = 016, Version = GameVersion.Pt,}, // Turtwig @ Route 201 - new EncounterStatic { Gift = true, Species = 390, Level = 5, Location = 016, Version = GameVersion.Pt,}, // Chimchar - new EncounterStatic { Gift = true, Species = 393, Level = 5, Location = 016, Version = GameVersion.Pt,}, // Piplup + new EncounterStatic { Gift = true, Species = 387, Level = 5, Location = 076, TypeEncounter = EncounterType.Starter_Fossil_Gift_DP, Version = GameVersion.DP,}, // Turtwig @ Lake Verity + new EncounterStatic { Gift = true, Species = 390, Level = 5, Location = 076, TypeEncounter = EncounterType.Starter_Fossil_Gift_DP, Version = GameVersion.DP,}, // Chimchar + new EncounterStatic { Gift = true, Species = 393, Level = 5, Location = 076, TypeEncounter = EncounterType.Starter_Fossil_Gift_DP, Version = GameVersion.DP,}, // Piplup + new EncounterStatic { Gift = true, Species = 387, Level = 5, Location = 016, TypeEncounter = EncounterType.Starter_Fossil_Gift_Pt_DPTrio, Version = GameVersion.Pt,}, // Turtwig @ Route 201 + new EncounterStatic { Gift = true, Species = 390, Level = 5, Location = 016, TypeEncounter = EncounterType.Starter_Fossil_Gift_Pt_DPTrio, Version = GameVersion.Pt,}, // Chimchar + new EncounterStatic { Gift = true, Species = 393, Level = 5, Location = 016, TypeEncounter = EncounterType.Starter_Fossil_Gift_Pt_DPTrio, Version = GameVersion.Pt,}, // Piplup //Fossil @ Mining Museum - new EncounterStatic { Gift = true, Species = 138, Level = 20, Location = 094, }, // Omanyte - new EncounterStatic { Gift = true, Species = 140, Level = 20, Location = 094, }, // Kabuto - new EncounterStatic { Gift = true, Species = 142, Level = 20, Location = 094, }, // Aerodactyl - new EncounterStatic { Gift = true, Species = 345, Level = 20, Location = 094, }, // Lileep - new EncounterStatic { Gift = true, Species = 347, Level = 20, Location = 094, }, // Anorith - new EncounterStatic { Gift = true, Species = 408, Level = 20, Location = 094, }, // Cranidos - new EncounterStatic { Gift = true, Species = 410, Level = 20, Location = 094, }, // Shieldon + new EncounterStatic { Gift = true, Species = 138, Level = 20, Location = 094, TypeEncounter = EncounterType.Starter_Fossil_Gift_DP, }, // Omanyte + new EncounterStatic { Gift = true, Species = 140, Level = 20, Location = 094, TypeEncounter = EncounterType.Starter_Fossil_Gift_DP, }, // Kabuto + new EncounterStatic { Gift = true, Species = 142, Level = 20, Location = 094, TypeEncounter = EncounterType.Starter_Fossil_Gift_DP, }, // Aerodactyl + new EncounterStatic { Gift = true, Species = 345, Level = 20, Location = 094, TypeEncounter = EncounterType.Starter_Fossil_Gift_DP, }, // Lileep + new EncounterStatic { Gift = true, Species = 347, Level = 20, Location = 094, TypeEncounter = EncounterType.Starter_Fossil_Gift_DP, }, // Anorith + new EncounterStatic { Gift = true, Species = 408, Level = 20, Location = 094, TypeEncounter = EncounterType.Starter_Fossil_Gift_DP, }, // Cranidos + new EncounterStatic { Gift = true, Species = 410, Level = 20, Location = 094, TypeEncounter = EncounterType.Starter_Fossil_Gift_DP, }, // Shieldon //Gift - new EncounterStatic { Gift = true, Species = 133, Level = 05, Location = 010, Version = GameVersion.DP,}, //Eevee @ Hearthome City - new EncounterStatic { Gift = true, Species = 133, Level = 20, Location = 010, Version = GameVersion.Pt,}, //Eevee @ Hearthome City - new EncounterStatic { Gift = true, Species = 137, Level = 25, Location = 012, Version = GameVersion.Pt,}, //Porygon @ Veilstone City - new EncounterStatic { Gift = true, Species = 175, Level = 01, EggLocation = 2011, Version = GameVersion.Pt,}, //Togepi Egg from Cynthia - new EncounterStatic { Gift = true, Species = 440, Level = 01, EggLocation = 2009, Version = GameVersion.DP,}, //Happiny Egg from Traveling Man - new EncounterStatic { Gift = true, Species = 447, Level = 01, EggLocation = 2010,}, //Riolu Egg from Riley + new EncounterStatic { Gift = true, Species = 133, Level = 05, Location = 010, Version = GameVersion.DP, TypeEncounter = EncounterType.Starter_Fossil_Gift_DP, }, //Eevee @ Hearthome City + new EncounterStatic { Gift = true, Species = 133, Level = 20, Location = 010, Version = GameVersion.Pt, TypeEncounter = EncounterType.Starter_Fossil_Gift_Pt_DPTrio, }, //Eevee @ Hearthome City + new EncounterStatic { Gift = true, Species = 137, Level = 25, Location = 012, Version = GameVersion.Pt, TypeEncounter = EncounterType.Starter_Fossil_Gift_Pt_DPTrio, }, //Porygon @ Veilstone City + new EncounterStatic { Gift = true, Species = 175, Level = 01, EggLocation = 2011, TypeEncounter = EncounterType.None, Version = GameVersion.Pt,}, //Togepi Egg from Cynthia + new EncounterStatic { Gift = true, Species = 440, Level = 01, EggLocation = 2009, TypeEncounter = EncounterType.None, Version = GameVersion.DP,}, //Happiny Egg from Traveling Man + new EncounterStatic { Gift = true, Species = 447, Level = 01, EggLocation = 2010, TypeEncounter = EncounterType.None, }, //Riolu Egg from Riley //Stationary - new EncounterStatic { Species = 425, Level = 22, Location = 47, Version = GameVersion.DP, },// Drifloon @ Valley Windworks - new EncounterStatic { Species = 425, Level = 15, Location = 47, Version = GameVersion.Pt, },// Drifloon @ Valley Windworks - new EncounterStatic { Species = 479, Level = 15, Location = 70, Version = GameVersion.DP, },// Rotom @ Old Chateau - new EncounterStatic { Species = 479, Level = 20, Location = 70, Version = GameVersion.Pt, },// Rotom @ Old Chateau - new EncounterStatic { Species = 442, Level = 25, Location = 24, }, // Spiritomb @ Route 209 + new EncounterStatic { Species = 425, Level = 22, Location = 47, Version = GameVersion.DP, TypeEncounter = EncounterType.TallGrass, },// Drifloon @ Valley Windworks + new EncounterStatic { Species = 425, Level = 15, Location = 47, Version = GameVersion.Pt, TypeEncounter = EncounterType.TallGrass, },// Drifloon @ Valley Windworks + new EncounterStatic { Species = 479, Level = 15, Location = 70, Version = GameVersion.DP, TypeEncounter = EncounterType.Building_EnigmaStone, },// Rotom @ Old Chateau + new EncounterStatic { Species = 479, Level = 20, Location = 70, Version = GameVersion.Pt, TypeEncounter = EncounterType.Building_EnigmaStone, },// Rotom @ Old Chateau + new EncounterStatic { Species = 442, Level = 25, Location = 24, TypeEncounter = EncounterType.Building_EnigmaStone, }, // Spiritomb @ Route 209 //Stationary Lengerdary - new EncounterStatic { Species = 377, Level = 30, Location = 125, Version = GameVersion.Pt,}, //Regirock @ Rock Peak Ruins - new EncounterStatic { Species = 378, Level = 30, Location = 124, Version = GameVersion.Pt,}, //Regice @ Iceberg Ruins - new EncounterStatic { Species = 379, Level = 30, Location = 123, Version = GameVersion.Pt,}, //Registeel @ Iron Ruins - new EncounterStatic { Species = 480, Level = 50, Location = 089,}, //Uxie @ Acuity Cavern - new EncounterStatic { Species = 482, Level = 50, Location = 088,}, //Azelf @ Valor Cavern - new EncounterStatic { Species = 483, Level = 47, Location = 051, Version = GameVersion.D,}, //Dialga @ Spear Pillar + new EncounterStatic { Species = 377, Level = 30, Location = 125, Version = GameVersion.Pt, TypeEncounter = EncounterType.Cave_HallOfOrigin, }, //Regirock @ Rock Peak Ruins + new EncounterStatic { Species = 378, Level = 30, Location = 124, Version = GameVersion.Pt, TypeEncounter = EncounterType.Cave_HallOfOrigin, }, //Regice @ Iceberg Ruins + new EncounterStatic { Species = 379, Level = 30, Location = 123, Version = GameVersion.Pt, TypeEncounter = EncounterType.Cave_HallOfOrigin, }, //Registeel @ Iron Ruins + new EncounterStatic { Species = 480, Level = 50, Location = 089, TypeEncounter = EncounterType.Cave_HallOfOrigin, }, //Uxie @ Acuity Cavern + new EncounterStatic { Species = 482, Level = 50, Location = 088, TypeEncounter = EncounterType.Cave_HallOfOrigin, }, //Azelf @ Valor Cavern + new EncounterStatic { Species = 483, Level = 47, Location = 051, Version = GameVersion.D, TypeEncounter = EncounterType.DialgaPalkia, }, //Dialga @ Spear Pillar new EncounterStatic { Species = 483, Level = 70, Location = 051, Version = GameVersion.Pt,}, //Dialga @ Spear Pillar - new EncounterStatic { Species = 484, Level = 47, Location = 051, Version = GameVersion.P,}, //Palkia @ Spear Pillar + new EncounterStatic { Species = 484, Level = 47, Location = 051, Version = GameVersion.P, TypeEncounter = EncounterType.DialgaPalkia, }, //Palkia @ Spear Pillar new EncounterStatic { Species = 484, Level = 70, Location = 051, Version = GameVersion.Pt,}, //Palkia @ Spear Pillar - new EncounterStatic { Species = 485, Level = 70, Location = 084, Version = GameVersion.DP,}, //Heatran @ Stark Mountain - new EncounterStatic { Species = 485, Level = 50, Location = 084, Version = GameVersion.Pt,}, //Heatran @ Stark Mountain + new EncounterStatic { Species = 485, Level = 70, Location = 084, Version = GameVersion.DP, TypeEncounter = EncounterType.Cave_HallOfOrigin, }, //Heatran @ Stark Mountain + new EncounterStatic { Species = 485, Level = 50, Location = 084, Version = GameVersion.Pt, TypeEncounter = EncounterType.Cave_HallOfOrigin, }, //Heatran @ Stark Mountain new EncounterStatic { Species = 486, Level = 70, Location = 064, Version = GameVersion.DP,}, //Regigigas @ Snowpoint Temple new EncounterStatic { Species = 486, Level = 01, Location = 064, Version = GameVersion.Pt,}, //Regigigas @ Snowpoint Temple - new EncounterStatic { Species = 487, Level = 70, Location = 062, Version = GameVersion.DP, Form = 0, }, //Giratina @ Turnback Cave - new EncounterStatic { Species = 487, Level = 47, Location = 117, Version = GameVersion.Pt, Form = 1, }, //Giratina @ Distortion World - new EncounterStatic { Species = 487, Level = 47, Location = 062, Version = GameVersion.Pt, Form = 0, }, //Giratina @ Turnback Cave + new EncounterStatic { Species = 487, Level = 70, Location = 062, Version = GameVersion.DP, Form = 0, TypeEncounter = EncounterType.Cave_HallOfOrigin, }, //Giratina @ Turnback Cave + new EncounterStatic { Species = 487, Level = 47, Location = 117, Version = GameVersion.Pt, Form = 1, TypeEncounter = EncounterType.Cave_HallOfOrigin, }, //Giratina @ Distortion World + new EncounterStatic { Species = 487, Level = 47, Location = 062, Version = GameVersion.Pt, Form = 0, TypeEncounter = EncounterType.Cave_HallOfOrigin, }, //Giratina @ Turnback Cave //Event new EncounterStatic { Species = 491, Level = 40, Location = 079, Version = GameVersion.DP,}, //Darkrai @ Newmoon Island new EncounterStatic { Species = 491, Level = 50, Location = 079, Version = GameVersion.Pt,}, //Darkrai @ Newmoon Island new EncounterStatic { Species = 492, Form = 0, Level = 30, Location = 063, Fateful = true,}, //Shaymin @ Flower Paradise (Unreleased in Diamond and Pearl) new EncounterStatic { Species = 493, Form = 0, Level = 80, Location = 086,}, //Arceus @ Hall of Origin (Unreleased) }; - internal static readonly EncounterStatic[] Encounter_DPPt = Encounter_DPPt_Roam.SelectMany(e => e.Clone(Roaming_MetLocation_DPPt)).Concat(Encounter_DPPt_Regular).ToArray(); + internal static readonly EncounterStatic[] Encounter_DPPt = Encounter_DPPt_Roam_Grass.SelectMany(e => e.Clone(Roaming_MetLocation_DPPt_Grass)).Concat(Encounter_DPPt_Roam_Surf.SelectMany(e => e.Clone(Roaming_MetLocation_DPPt_Surf))).Concat(Encounter_DPPt_Regular).ToArray(); - internal static readonly int[] Roaming_MetLocation_HGSS_Johto = + // Grass 29-39, 42-46, 47, 48 + // Surf 30-32 34-35, 40-45, 47 + // Route 45 innacesible surf + internal static readonly int[] Roaming_MetLocation_HGSS_Johto_Grass = { - // Route 29-48 can be encountered in either grass or water + // Routes 29-48 can be encountered in grass + // Won't go to routes 40,41,47,48 177,178,179,180,181,182,183,184,185,186, - 187, 190,191,192,193,194, // Won't go to route 40,41,47,48 + 187, 190,191,192,193,194, }; - internal static readonly EncounterStatic[] Encounter_HGSS_JohtoRoam = + internal static readonly int[] Roaming_MetLocation_HGSS_Johto_Surf = { - new EncounterStatic { Species = 243, Level = 40, Roaming = true }, // Raikou - new EncounterStatic { Species = 244, Level = 40, Roaming = true }, // Entei + // Routes 30-32,34-35,40-45 and 47 can be encountered in water + // Won't go to routes 40,41,47,48 + 178,179,180,182,183,190,191,192,193 }; - internal static readonly int[] Roaming_MetLocation_HGSS_Kanto = + internal static readonly EncounterStatic[] Encounter_HGSS_JohtoRoam_Grass = { - // Route 01-28 can be encountered in either grass or water + new EncounterStatic { Species = 243, Level = 40, Roaming = true, TypeEncounter = EncounterType.TallGrass, }, // Raikou + new EncounterStatic { Species = 244, Level = 40, Roaming = true, TypeEncounter = EncounterType.TallGrass, }, // Entei + }; + internal static readonly EncounterStatic[] Encounter_HGSS_JohtoRoam_Surf = + { + new EncounterStatic { Species = 243, Level = 40, Roaming = true, TypeEncounter = EncounterType.Surfing_Fishing, }, // Raikou + new EncounterStatic { Species = 244, Level = 40, Roaming = true, TypeEncounter = EncounterType.Surfing_Fishing, }, // Entei + }; + internal static readonly int[] Roaming_MetLocation_HGSS_Kanto_Grass = + { + // Route 01-18,21,22,24,26 and 28 can be encountered in grass + // Won't go to route 23 25 27 149,150,151,152,153,154,155,156,157,158, - 159,160,161,162,163,164,165,166,167,168, - 169,170, 172, 174, 176, // Won't go to route 23 25 27 + 159,160,161,162,163,164,165,166, + 169,170, 172, 174, 176, }; - internal static readonly EncounterStatic[] Encounter_HGSS_KantoRoam = + internal static readonly int[] Roaming_MetLocation_HGSS_Kanto_Surf = { - new EncounterStatic { Species = 380, Level = 35, Version = GameVersion.HG, Roaming = true }, //Latias - new EncounterStatic { Species = 381, Level = 35, Version = GameVersion.SS, Roaming = true }, //Latios + // Route 4,6,9,10,12,13,19-22,24,26 and 28 can be encountered in water + // Won't go to route 23 25 27 + 152,154,157,158,160,161,167,168,169,170, + 172,174,176, + }; + internal static readonly EncounterStatic[] Encounter_HGSS_KantoRoam_Grass = + { + new EncounterStatic { Species = 380, Level = 35, Version = GameVersion.HG, Roaming = true, TypeEncounter = EncounterType.TallGrass, }, //Latias + new EncounterStatic { Species = 381, Level = 35, Version = GameVersion.SS, Roaming = true, TypeEncounter = EncounterType.TallGrass, }, //Latios + }; + internal static readonly EncounterStatic[] Encounter_HGSS_KantoRoam_Surf = + { + new EncounterStatic { Species = 380, Level = 35, Version = GameVersion.HG, Roaming = true, TypeEncounter = EncounterType.Surfing_Fishing, }, //Latias + new EncounterStatic { Species = 381, Level = 35, Version = GameVersion.SS, Roaming = true, TypeEncounter = EncounterType.Surfing_Fishing, }, //Latios }; internal static readonly EncounterStatic[] Encounter_HGSS_Regular = { //Starters - new EncounterStatic { Gift = true, Species = 001, Level = 05, Location = 138, }, // Bulbasaur @ Pallet Town - new EncounterStatic { Gift = true, Species = 004, Level = 05, Location = 138, }, // Charmander - new EncounterStatic { Gift = true, Species = 007, Level = 05, Location = 138, }, // Squirtle - new EncounterStatic { Gift = true, Species = 152, Level = 05, Location = 126, }, // Chikorita @ New Bark Town - new EncounterStatic { Gift = true, Species = 155, Level = 05, Location = 126, }, // Cyndaquil - new EncounterStatic { Gift = true, Species = 158, Level = 05, Location = 126, }, // Totodile - new EncounterStatic { Gift = true, Species = 252, Level = 05, Location = 148, }, // Treecko @ Saffron City - new EncounterStatic { Gift = true, Species = 255, Level = 05, Location = 148, }, // Torchic - new EncounterStatic { Gift = true, Species = 258, Level = 05, Location = 148, }, // Mudkip + new EncounterStatic { Gift = true, Species = 001, Level = 05, Location = 138, TypeEncounter = EncounterType.Starter_Fossil_Gift_DP, }, // Bulbasaur @ Pallet Town + new EncounterStatic { Gift = true, Species = 004, Level = 05, Location = 138, TypeEncounter = EncounterType.Starter_Fossil_Gift_DP, }, // Charmander + new EncounterStatic { Gift = true, Species = 007, Level = 05, Location = 138, TypeEncounter = EncounterType.Starter_Fossil_Gift_DP, }, // Squirtle + new EncounterStatic { Gift = true, Species = 152, Level = 05, Location = 126, TypeEncounter = EncounterType.Starter_Fossil_Gift_DP, }, // Chikorita @ New Bark Town + new EncounterStatic { Gift = true, Species = 155, Level = 05, Location = 126, TypeEncounter = EncounterType.Starter_Fossil_Gift_DP, }, // Cyndaquil + new EncounterStatic { Gift = true, Species = 158, Level = 05, Location = 126, TypeEncounter = EncounterType.Starter_Fossil_Gift_DP, }, // Totodile + new EncounterStatic { Gift = true, Species = 252, Level = 05, Location = 148, TypeEncounter = EncounterType.Starter_Fossil_Gift_DP, }, // Treecko @ Saffron City + new EncounterStatic { Gift = true, Species = 255, Level = 05, Location = 148, TypeEncounter = EncounterType.Starter_Fossil_Gift_DP, }, // Torchic + new EncounterStatic { Gift = true, Species = 258, Level = 05, Location = 148, TypeEncounter = EncounterType.Starter_Fossil_Gift_DP, }, // Mudkip //Fossil @ Pewter City - new EncounterStatic { Gift = true, Species = 138, Level = 20, Location = 140, }, // Omanyte - new EncounterStatic { Gift = true, Species = 140, Level = 20, Location = 140, }, // Kabuto - new EncounterStatic { Gift = true, Species = 142, Level = 20, Location = 140, }, // Aerodactyl - new EncounterStatic { Gift = true, Species = 345, Level = 20, Location = 140, }, // Lileep - new EncounterStatic { Gift = true, Species = 347, Level = 20, Location = 140, }, // Anorith - new EncounterStatic { Gift = true, Species = 408, Level = 20, Location = 140, }, // Cranidos - new EncounterStatic { Gift = true, Species = 410, Level = 20, Location = 140, }, // Shieldon + new EncounterStatic { Gift = true, Species = 138, Level = 20, Location = 140, TypeEncounter = EncounterType.Starter_Fossil_Gift_DP, }, // Omanyte + new EncounterStatic { Gift = true, Species = 140, Level = 20, Location = 140, TypeEncounter = EncounterType.Starter_Fossil_Gift_DP, }, // Kabuto + new EncounterStatic { Gift = true, Species = 142, Level = 20, Location = 140, TypeEncounter = EncounterType.Starter_Fossil_Gift_DP, }, // Aerodactyl + new EncounterStatic { Gift = true, Species = 345, Level = 20, Location = 140, TypeEncounter = EncounterType.Starter_Fossil_Gift_DP, }, // Lileep + new EncounterStatic { Gift = true, Species = 347, Level = 20, Location = 140, TypeEncounter = EncounterType.Starter_Fossil_Gift_DP, }, // Anorith + new EncounterStatic { Gift = true, Species = 408, Level = 20, Location = 140, TypeEncounter = EncounterType.Starter_Fossil_Gift_DP, }, // Cranidos + new EncounterStatic { Gift = true, Species = 410, Level = 20, Location = 140, TypeEncounter = EncounterType.Starter_Fossil_Gift_DP, }, // Shieldon //Gift - new EncounterStatic { Gift = true, Species = 133, Level = 05, Location = 131, }, // Eevee @ Goldenrod City + new EncounterStatic { Gift = true, Species = 133, Level = 05, Location = 131, TypeEncounter = EncounterType.Starter_Fossil_Gift_Pt_DPTrio, }, // Eevee @ Goldenrod City new EncounterStatic { Gift = true, Species = 147, Level = 15, Location = 222, Moves = new[] {245}, }, // Dratini @ Dragon's Den (ExtremeSpeed) - new EncounterStatic { Gift = true, Species = 236, Level = 10, Location = 216, }, // Tyrogue @ Mt. Mortar - new EncounterStatic { Gift = true, Species = 175, Level = 01, EggLocation = 2013, Moves = new[] {326},}, // Togepi Egg from Mr. Pokemon (Extrasensory as Egg move) - new EncounterStatic { Gift = true, Species = 179, Level = 01, EggLocation = 2014,}, // Mareep Egg from Primo - new EncounterStatic { Gift = true, Species = 194, Level = 01, EggLocation = 2014,}, // Wooper Egg from Primo - new EncounterStatic { Gift = true, Species = 218, Level = 01, EggLocation = 2014,}, // Slugma Egg from Primo + new EncounterStatic { Gift = true, Species = 236, Level = 10, Location = 216, TypeEncounter = EncounterType.Starter_Fossil_Gift_DP, }, // Tyrogue @ Mt. Mortar + new EncounterStatic { Gift = true, Species = 175, Level = 01, EggLocation = 2013, TypeEncounter = EncounterType.None, Moves = new[] {326},}, // Togepi Egg from Mr. Pokemon (Extrasensory as Egg move) + new EncounterStatic { Gift = true, Species = 179, Level = 01, EggLocation = 2014, TypeEncounter = EncounterType.None, }, // Mareep Egg from Primo + new EncounterStatic { Gift = true, Species = 194, Level = 01, EggLocation = 2014, TypeEncounter = EncounterType.None, }, // Wooper Egg from Primo + new EncounterStatic { Gift = true, Species = 218, Level = 01, EggLocation = 2014, TypeEncounter = EncounterType.None, }, // Slugma Egg from Primo // Celadon City Game Corner - new EncounterStatic { Gift = true, Species = 122, Level = 15, Location = 144 }, // Mr. Mime - new EncounterStatic { Gift = true, Species = 133, Level = 15, Location = 144 }, // Eevee - new EncounterStatic { Gift = true, Species = 137, Level = 15, Location = 144 }, // Porygon + new EncounterStatic { Gift = true, Species = 122, Level = 15, Location = 144, TypeEncounter = EncounterType.Starter_Fossil_Gift_Pt_DPTrio, }, // Mr. Mime + new EncounterStatic { Gift = true, Species = 133, Level = 15, Location = 144, TypeEncounter = EncounterType.Starter_Fossil_Gift_Pt_DPTrio }, // Eevee + new EncounterStatic { Gift = true, Species = 137, Level = 15, Location = 144, TypeEncounter = EncounterType.Starter_Fossil_Gift_Pt_DPTrio }, // Porygon // Goldenrod City Game Corner - new EncounterStatic { Gift = true, Species = 063, Level = 15, Location = 131 }, // Abra - new EncounterStatic { Gift = true, Species = 023, Level = 15, Location = 131, Version = GameVersion.HG }, // Ekans - new EncounterStatic { Gift = true, Species = 027, Level = 15, Location = 131, Version = GameVersion.SS }, // Sandshrew - new EncounterStatic { Gift = true, Species = 147, Level = 15, Location = 131 }, // Dratini + new EncounterStatic { Gift = true, Species = 063, Level = 15, Location = 131, TypeEncounter = EncounterType.Starter_Fossil_Gift_Pt_DPTrio }, // Abra + new EncounterStatic { Gift = true, Species = 023, Level = 15, Location = 131, Version = GameVersion.HG, TypeEncounter = EncounterType.Starter_Fossil_Gift_Pt_DPTrio }, // Ekans + new EncounterStatic { Gift = true, Species = 027, Level = 15, Location = 131, Version = GameVersion.SS, TypeEncounter = EncounterType.Starter_Fossil_Gift_Pt_DPTrio }, // Sandshrew + new EncounterStatic { Gift = true, Species = 147, Level = 15, Location = 131, TypeEncounter = EncounterType.Starter_Fossil_Gift_Pt_DPTrio }, // Dratini // Team Rocket HQ Trap Floor - // new EncounterStatic { Species = 101, Level = 23, Location = 213, }, // Electrode Overlaps stationary - new EncounterStatic { Species = 100, Level = 23, Location = 213, }, // Voltorb - new EncounterStatic { Species = 074, Level = 23, Location = 213, }, // Geodude - new EncounterStatic { Species = 109, Level = 23, Location = 213, }, // Koffing + new EncounterStatic { Species = 100, Level = 23, Location = 213, TypeEncounter = EncounterType.Building_EnigmaStone, }, // Voltorb + new EncounterStatic { Species = 074, Level = 21, Location = 213, TypeEncounter = EncounterType.Building_EnigmaStone, }, // Geodude + new EncounterStatic { Species = 109, Level = 21, Location = 213, TypeEncounter = EncounterType.Building_EnigmaStone, }, // Koffing //Stationary - new EncounterStatic { Species = 130, Level = 30, Location = 135, Shiny = true }, //Gyarados @ Lake of Rage - new EncounterStatic { Species = 131, Level = 20, Location = 210, }, //Lapras @ Union Cave Friday Only - new EncounterStatic { Species = 101, Level = 23, Location = 213, }, //Electrode @ Team Rocket HQ + new EncounterStatic { Species = 130, Level = 30, Location = 135, TypeEncounter = EncounterType.Surfing_Fishing, Shiny = true }, //Gyarados @ Lake of Rage + new EncounterStatic { Species = 131, Level = 20, Location = 210, TypeEncounter = EncounterType.Cave_HallOfOrigin, }, //Lapras @ Union Cave Friday Only + new EncounterStatic { Species = 101, Level = 23, Location = 213, TypeEncounter = EncounterType.Building_EnigmaStone, }, //Electrode @ Team Rocket HQ new EncounterStatic { Species = 143, Level = 50, Location = 159, }, //Snorlax @ Route 11 new EncounterStatic { Species = 143, Level = 50, Location = 160, }, //Snorlax @ Route 12 - new EncounterStatic { Species = 185, Level = 20, Location = 184, }, //Sudowoodo @ Route 36 + new EncounterStatic { Species = 185, Level = 20, Location = 184, TypeEncounter = EncounterType.None, }, //Sudowoodo @ Route 36 new EncounterStatic { Species = 172, Level = 30, Location = 214, Gender = 1, Form = 1, Moves = new[]{344,270,207,220} }, //Spiky-eared Pichu @ Ilex forest //Stationary Lengerdary new EncounterStatic { Species = 144, Level = 50, Location = 203, }, //Articuno @ Seafoam Islands @@ -530,8 +614,8 @@ namespace PKHeX.Core new EncounterStatic { Species = 245, Level = 40, Location = 206, }, //Suicune @ Burned Tower new EncounterStatic { Species = 249, Level = 45, Location = 218, Version = GameVersion.SS, }, //Lugia @ Whirl Islands new EncounterStatic { Species = 249, Level = 70, Location = 218, Version = GameVersion.HG, }, //Lugia @ Whirl Islands - new EncounterStatic { Species = 250, Level = 45, Location = 205, Version = GameVersion.HG, }, //Ho-Oh @ Bell Tower - new EncounterStatic { Species = 250, Level = 70, Location = 205, Version = GameVersion.SS, }, //Ho-Oh @ Bell Tower + new EncounterStatic { Species = 250, Level = 45, Location = 205, Version = GameVersion.HG, TypeEncounter = EncounterType.Building_EnigmaStone, }, //Ho-Oh @ Bell Tower + new EncounterStatic { Species = 250, Level = 70, Location = 205, Version = GameVersion.SS, TypeEncounter = EncounterType.Building_EnigmaStone, }, //Ho-Oh @ Bell Tower new EncounterStatic { Species = 380, Level = 40, Location = 140, Version = GameVersion.SS, }, //Latias @ Pewter City new EncounterStatic { Species = 381, Level = 40, Location = 140, Version = GameVersion.HG, }, //Latios @ Pewter City new EncounterStatic { Species = 382, Level = 50, Location = 232, Version = GameVersion.HG, }, //Kyogre @ Embedded Tower @@ -541,8 +625,10 @@ namespace PKHeX.Core new EncounterStatic { Species = 484, Level = 01, Location = 231, Gift = true }, //Palkia @ Sinjoh Ruins new EncounterStatic { Species = 487, Level = 01, Location = 231, Gift = true, Form = 1}, //Giratina @ Sinjoh Ruins }; - internal static readonly EncounterStatic[] Encounter_HGSS = Encounter_HGSS_KantoRoam.SelectMany(e => e.Clone(Roaming_MetLocation_HGSS_Kanto)).Concat( - Encounter_HGSS_JohtoRoam.SelectMany(e => e.Clone(Roaming_MetLocation_HGSS_Johto))).Concat( + internal static readonly EncounterStatic[] Encounter_HGSS = Encounter_HGSS_KantoRoam_Grass.SelectMany(e => e.Clone(Roaming_MetLocation_HGSS_Kanto_Grass)).Concat( + Encounter_HGSS_KantoRoam_Surf.SelectMany(e => e.Clone(Roaming_MetLocation_HGSS_Kanto_Surf))).Concat( + Encounter_HGSS_JohtoRoam_Grass.SelectMany(e => e.Clone(Roaming_MetLocation_HGSS_Johto_Grass))).Concat( + Encounter_HGSS_JohtoRoam_Surf.SelectMany(e => e.Clone(Roaming_MetLocation_HGSS_Johto_Surf))).Concat( Encounter_HGSS_Regular).ToArray(); #endregion #region Trade Tables @@ -1115,16 +1201,20 @@ namespace PKHeX.Core internal static readonly int[] ValidMet_DP = { + // 063: Flower Paradise unreleased DP event + // 079: Newmoon Island unreleased DP event + // 085: Seabreak Path unreleased DP event + // 086: Hall of Origin unreleased event 001, 002, 003, 004, 005, 006, 007, 008, 009, 010, 011, 012, 013, 014, 015, 016, 017, 018, 019, 020, 021, 022, 023, 024, 025, 026, 027, 028, 029, 030, 031, 032, 033, 034, 035, 036, 037, 038, 039, 040, 041, 042, 043, 044, 045, 046, 047, 048, 049, 050, 051, 052, 053, 054, 055, 056, 057, 058, 059, 060, - 061, 062, 063, 064, 065, 066, 067, 068, 069, 070, 071, 072, 073, 074, 075, 076, 077, 078, 079, 080, - 081, 082, 083, 084, 085, 087, 088, 089, 090, 091, 092, 093, 094, 095, 096, 097, 098, 099, 100, //086: Hall of Origin unreleased event + 061, 062, 064, 065, 066, 067, 068, 069, 070, 071, 072, 073, 074, 075, 076, 077, 078, 080, + 081, 082, 083, 084, 087, 088, 089, 090, 091, 092, 093, 094, 095, 096, 097, 098, 099, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, }; internal static readonly int[] ValidMet_Pt = ValidMet_DP.Concat(new[] { - 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, + 63, 79 , 85, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, }).ToArray(); internal static readonly int[] ValidMet_HGSS = { diff --git a/PKHeX/PKHeX.Core.csproj b/PKHeX/PKHeX.Core.csproj index ef18c538c..46ae8ed6e 100644 --- a/PKHeX/PKHeX.Core.csproj +++ b/PKHeX/PKHeX.Core.csproj @@ -158,6 +158,7 @@ + diff --git a/PKHeX/Resources/text/en/LegalityCheckStrings_en.txt b/PKHeX/Resources/text/en/LegalityCheckStrings_en.txt index 12b6a38e2..69420a033 100644 --- a/PKHeX/Resources/text/en/LegalityCheckStrings_en.txt +++ b/PKHeX/Resources/text/en/LegalityCheckStrings_en.txt @@ -33,6 +33,8 @@ V356 = Learned by evolving Nincada into Ninjask in generation {0}. V361 = Default move. V362 = Default move in generation {0}. V372 = {0} Berry +V380 = Encounter Type match encounter. +V382 = Encounter Type not implemented for pokemon encounter. V203 = Genderless Pokémon should not have a gender. V201 = Encryption Constant is not set. V204 = Held item is unreleased. @@ -291,6 +293,8 @@ V351 = Invalid Met Location, expected Transporter or Crown. V352 = Arceus from Hall of Origin. Unreleased event. V353 = Non japanese Mew from Faraway Island. Unreleased event. V354 = Non Platinum Shaymin from Flower Paradise. Unreleased event. +V383 = Non Platinum Darkrai from Newmoon Island. Unreleased event. +V384 = Johto Route 45 surfing encounter. Unreachable Water tiles. V357 = Only one Ninjask move allowed. V358 = Inherited move learned by Level-up. Incompatible with event egg moves. V359 = Unable to match a gift egg encounter from origin game. @@ -309,4 +313,5 @@ V375 = {0} Egg Move. Incompatible with {1} egg moves. V376 = {0} Exclusive Move. Incompatible with {1} egg moves. V377 = Egg Move. Not expected in a gift egg. V378 = Inherited move learned by Level-up. Not expected in a gift egg. -V379 = {0} Inherited Move. Incompatible with {1} inherited moves. \ No newline at end of file +V379 = {0} Inherited Move. Incompatible with {1} inherited moves. +V381 = Encounter Type does not match encounter. \ No newline at end of file diff --git a/PKHeX/Resources/text/ko/LegalityCheckStrings_ko.txt b/PKHeX/Resources/text/ko/LegalityCheckStrings_ko.txt index 2243ce26a..d425f7fe2 100644 --- a/PKHeX/Resources/text/ko/LegalityCheckStrings_ko.txt +++ b/PKHeX/Resources/text/ko/LegalityCheckStrings_ko.txt @@ -33,6 +33,8 @@ V356 = {0}세대에서 토중몬에서 아이스크로 진화하면서 배운 V361 = 기본 기술입니다. V362 = {0}세대 기본 기술입니다. V372 = {0}열매 +V380 = Encounter Type match encounter. +V382 = Encounter Type not implemented for pokemon encounter. V203 = 무성 포켓몬은 성별을 가질 수 없습니다. V201 = 암호화 상수가 설정되어 있지 않습니다. V204 = 지닌 물건이 배포되지 않은 물건입니다. @@ -290,6 +292,8 @@ V351 = 만난 장소가 잘못되었습니다. 포케시프터 또는 크라운 V352 = 아르세우스는 시작의 방에서 포획할 수 없습니다. 배포되지 않은 이벤트입니다. V353 = 일본산이 아닌 뮤는 머나먼 고도에서 포획할 수 없습니다. 배포되지 않은 이벤트입니다. V354 = Pt가 아닌 버전에서는 꽃의 낙원에서 쉐이미를 잡을 수 없습니다. 배포되지 않은 이벤트입니다. +V383 = Non Platinum Darkrai from Newmoon Island. Unreleased event. +V384 = Johto Route 45 surfing encounter. Unreachable Water tiles. V357 = 하나의 아이스크 기술만 가질 수 있습니다. V358 = 유전받은 레벨업 기술입니다. 이벤트 자력기와 함께 존재할 수 없습니다. V359 = 만난 게임의 선물받은 알 인카운터와 일치하지 않습니다. @@ -308,4 +312,5 @@ V375 = {0} 자력기입니다. {1} 자력기와 함께 존재할 수 없습니 V376 = {0} 전용 기술입니다. {1} 자력기와 함께 존재할 수 없습니다. V377 = 자력기입니다. 이벤트 알에서 예상된 기술이 아닙니다. V378 = 유전받은 레벨업 기술입니다. 이벤트 알에서 예상된 기술이 아닙니다. -V379 = 유전받은 {0} 기술입니다. 유전받은 {1} 기술과 함께 존재할 수 없습니다. \ No newline at end of file +V379 = 유전받은 {0} 기술입니다. 유전받은 {1} 기술과 함께 존재할 수 없습니다. +V381 = Encounter Type does not match encounter. \ No newline at end of file diff --git a/PKHeX/Resources/text/zh/LegalityCheckStrings_zh.txt b/PKHeX/Resources/text/zh/LegalityCheckStrings_zh.txt index b5013cb8f..3facab0fc 100644 --- a/PKHeX/Resources/text/zh/LegalityCheckStrings_zh.txt +++ b/PKHeX/Resources/text/zh/LegalityCheckStrings_zh.txt @@ -33,6 +33,8 @@ V356 = 通过土居忍士在第{0}世代进化为铁面忍者习得。 V361 = 默认招式。 V362 = 在第{0}世代的默认招式。 V372 = {0}树果 +V380 = Encounter Type match encounter. +V382 = Encounter Type not implemented for pokemon encounter. V203 = 无性别宝可梦不能有性别。 V201 = 未设置加密常数。 V204 = 持有物未解禁。 @@ -290,6 +292,8 @@ V351 = 不合法遇见地点,应该为传送或王冠。 V352 = 来自初始之间的阿尔宙斯,未发布的配信。 V353 = 非日版来自边境的小岛的梦幻,未发布的配信。 V354 = 非白金版来自花之乐园的谢米,未发布的配信。 +V383 = Non Platinum Darkrai from Newmoon Island. Unreleased event. +V384 = Johto Route 45 surfing encounter. Unreachable Water tiles. V357 = 只能拥有一个铁面忍者的招式。 V358 = 遗传升级招式。与配信蛋招式冲突。 V359 = 无法在来源版本中匹配到相应的礼物蛋。 @@ -308,4 +312,5 @@ V375 = {0}遗传招式。与遗传招式{1}不共存。 V376 = {0}专属招式。与遗传招式{1}不共存。 V377 = 遗传招式。礼物蛋不应有。 V378 = 遗传升级招式。礼物蛋不应有。 -V379 = {0}的遗传招式。与遗传的招式{1}不共存。 \ No newline at end of file +V379 = {0}的遗传招式。与遗传的招式{1}不共存。 +V381 = Encounter Type does not match encounter. \ No newline at end of file