diff --git a/Legality/Core.cs b/Legality/Core.cs index 34f2d7779..f43abd018 100644 --- a/Legality/Core.cs +++ b/Legality/Core.cs @@ -193,6 +193,21 @@ internal static EncounterStatic getStaticEncounter(PK6 pk6) } return null; } + internal static EncounterTrade getIngameTrade(PK6 pk6) + { + int lang = pk6.Language; + if (lang == 0) + return null; + + // Get valid pre-evolutions + IEnumerable p = getValidPreEvolutions(pk6); + if (pk6.XY) + return lang == 6 ? null : TradeGift_XY.FirstOrDefault(f => p.Any(r => r.Species == f.Species)); + if (pk6.AO) + return lang == 6 ? null : TradeGift_AO.FirstOrDefault(f => p.Any(r => r.Species == f.Species)); + + return null; + } private static int getBaseSpecies(PK6 pk6, int skipOption = 0) { @@ -339,8 +354,8 @@ private static IEnumerable getMachineMoves(int species, int formnum) new EncounterStatic { Species = 4, Level = 10, Location = 22, Gift = true }, // Charmander new EncounterStatic { Species = 7, Level = 10, Location = 22, Gift = true }, // Squirtle - new EncounterStatic { Species = 448, Level = 32, Location = 22, Ability = 1, Nature = Nature.Hasty, Gift = true }, // Lucario - new EncounterStatic { Species = 448, Level = 32, Location = 22, Ability = 1, Nature = Nature.Docile, Gift = true }, // Lapras + new EncounterStatic { Species = 448, Level = 32, Location = 60, Ability = 1, Nature = Nature.Hasty, Gender = 0, IVs = new[] {6, 25, 16, 31, 25, 19}, Gift = true, Shiny = false }, // Lucario + new EncounterStatic { Species = 131, Level = 32, Location = 62, Nature = Nature.Docile, IVs = new[] {31, 20, 20, 20, 20, 20}, Gift = true }, // Lapras new EncounterStatic { Species = 143, Level = 15, Location = 38 }, // Snorlax @@ -372,17 +387,18 @@ private static IEnumerable getMachineMoves(int species, int formnum) new EncounterStatic { Species = 498, Level = 5, Location = 204, Gift = true }, // Tepig new EncounterStatic { Species = 501, Level = 5, Location = 204, Gift = true }, // Oshawott - new EncounterStatic { Species = 25, Level = 20, Location = 186, Gender = 1, Ability = 4, Gift = true }, // Pikachu - new EncounterStatic { Species = 360, Level = 1, EggLocation = 60004, Gift = true }, // Wynaut + new EncounterStatic { Species = 25, Level = 20, Location = 186, Gender = 1, Ability = 4, Form = 1, IVs = new[] {-1, -1, -1, 31, -1, -1}, Contest = new[] {70,70,70,70,70,0}, Gift = true, Shiny = false }, // Pikachu + new EncounterStatic { Species = 25, Level = 20, Location = 186, Gender = 1, Ability = 4, Form = 3, IVs = new[] {-1, -1, -1, 31, -1, -1}, Contest = new[] {70,70,70,70,70,0}, Gift = true, Shiny = false }, // Pikachu + new EncounterStatic { Species = 360, Level = 1, EggLocation = 60004, Ability = 1, Gift = true }, // Wynaut new EncounterStatic { Species = 175, Level = 1, EggLocation = 60004, Ability = 1, Gift = true }, // Togepi - new EncounterStatic { Species = 374, Level = 1, Location = 196, Gift = true }, // Beldum + new EncounterStatic { Species = 374, Level = 1, Location = 196, Ability = 1, IVs = new[] {-1, -1, 31, -1, -1, 31}, Gift = true }, // Beldum - new EncounterStatic { Species = 351, Level = 30, Location = 240, Nature = Nature.Lax, Gift = true }, // Castform - new EncounterStatic { Species = 319, Level = 40, Location = 318, Ability = 1, Nature = Nature.Adamant, Gift = true }, // Sharpedo - new EncounterStatic { Species = 323, Level = 40, Location = 318, Ability = 1, Nature = Nature.Quiet, Gift = true }, // Camerupt + new EncounterStatic { Species = 351, Level = 30, Location = 240, Nature = Nature.Lax, Ability = 1, IVs = new[] {-1, -1, -1, -1, 31, -1}, Contest = new[] {0,100,0,0,0,0}, Gift = true }, // Castform + new EncounterStatic { Species = 319, Level = 40, Location = 318, Gender = 1, Ability = 1, Nature = Nature.Adamant, Gift = true }, // Sharpedo + new EncounterStatic { Species = 323, Level = 40, Location = 318, Gender = 1, Ability = 1, Nature = Nature.Quiet, Gift = true }, // Camerupt - new EncounterStatic { Species = 380, Level = 30, Location = 320, Version = GameVersion.AS, Gift = true }, // Latias - new EncounterStatic { Species = 381, Level = 30, Location = 320, Version = GameVersion.OR, Gift = true }, // Latios + new EncounterStatic { Species = 380, Level = 30, Location = 320, Version = GameVersion.AS, Ability = 1, Gift = true }, // Latias + new EncounterStatic { Species = 381, Level = 30, Location = 320, Version = GameVersion.OR, Ability = 1, Gift = true }, // Latios new EncounterStatic { Species = 382, Level = 45, Location = 296, Version = GameVersion.AS, Shiny = false }, // Kyogre new EncounterStatic { Species = 383, Level = 45, Location = 296, Version = GameVersion.OR, Shiny = false }, // Groudon @@ -450,5 +466,40 @@ private static EncounterStatic[] getSpecial(GameVersion Game) // else if (Game == GameVersion.AS || Game == GameVersion.OR) return Encounter_AO.Where(s => s.Version == GameVersion.Any || s.Version == Game).ToArray(); } + private static readonly string[][] TradeXY = + { + new string[0], // 0 - None + Util.getStringList("tradexy", "ja"), // 1 + Util.getStringList("tradexy", "en"), // 2 + Util.getStringList("tradexy", "fr"), // 3 + Util.getStringList("tradexy", "it"), // 4 + Util.getStringList("tradexy", "de"), // 5 + new string[0], // 6 - None + Util.getStringList("tradexy", "es"), // 7 + Util.getStringList("tradexy", "ko"), // 8 + }; + private static readonly string[][] TradeAO = + { + new string[0], // 0 - None + Util.getStringList("tradeao", "ja"), // 1 + Util.getStringList("tradeao", "en"), // 2 + Util.getStringList("tradeao", "fr"), // 3 + Util.getStringList("tradeao", "it"), // 4 + Util.getStringList("tradeao", "de"), // 5 + new string[0], // 6 - None + Util.getStringList("tradeao", "es"), // 7 + Util.getStringList("tradeao", "ko"), // 8 + }; + + #region Static Encounter/Gift Tables + private static readonly EncounterTrade[] TradeGift_XY = + { + new EncounterTrade { Species = 296, Ability = 2, Gender = 0, TID = 30724, Nature = Nature.Brave, }, + }; + private static readonly EncounterTrade[] TradeGift_AO = + { + new EncounterTrade { Species = 296, Ability = 2, Gender = 0, TID = 30724, Nature = Nature.Brave, }, + }; + #endregion } } diff --git a/Legality/Data.cs b/Legality/Data.cs index cba4e4791..0dc6ea7e9 100644 --- a/Legality/Data.cs +++ b/Legality/Data.cs @@ -150,6 +150,24 @@ public class EncounterStatic public Nature Nature = Nature.Random; public bool Gift = false; public GameVersion Version = GameVersion.Any; + public int[] IVs = {-1, -1, -1, -1, -1, -1}; + public int[] Contest = {0, 0, 0, 0, 0, 0}; + } + public class EncounterTrade + { + public int Species; + public int Level; + + public int Location = 30001; + public int Ability = 0; + public Nature Nature = Nature.Random; + public int TID; + public int SID = 0; + public int[] IVs = { -1, -1, -1, -1, -1, -1 }; + public int[] Moves; + public int Form = 0; + public bool? Shiny = false; + public int Gender = -1; } public enum Nature { diff --git a/PKHeX.csproj b/PKHeX.csproj index 3af13dab2..fcfee3c82 100644 --- a/PKHeX.csproj +++ b/PKHeX.csproj @@ -379,12 +379,26 @@ + + + + + + + + + + + + + + diff --git a/Properties/Resources.Designer.cs b/Properties/Resources.Designer.cs index de057708e..0f590d801 100644 --- a/Properties/Resources.Designer.cs +++ b/Properties/Resources.Designer.cs @@ -25699,6 +25699,286 @@ internal class Resources { } } + /// + /// Looks up a localized string similar to Makuhipsta + ///Conec + ///Coraso + ///Maik + ///Madina + ///Liana. + /// + internal static string text_tradeao_de { + get { + return ResourceManager.GetString("text_tradeao_de", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Makit + ///Skitit + ///Coroso + ///Darrell + ///Elyssa + ///Lane. + /// + internal static string text_tradeao_en { + get { + return ResourceManager.GetString("text_tradeao_en", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Makit + ///Skitit + ///Coroso + ///Evelio + ///Dalila + ///Laila. + /// + internal static string text_tradeao_es { + get { + return ResourceManager.GetString("text_tradeao_es", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Edmond + ///Minetou + ///Rosie + ///Allan + ///Dorothée + ///Marsantes. + /// + internal static string text_tradeao_fr { + get { + return ResourceManager.GetString("text_tradeao_fr", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Maku + ///Pucci + ///Corsolina + ///Marchetto + ///Ele + ///Simo. + /// + internal static string text_tradeao_it { + get { + return ResourceManager.GetString("text_tradeao_it", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to ポテマル + ///ベルベル + ///モモちゃん + ///モーリン + ///ユキポン + ///サトチン. + /// + internal static string text_tradeao_ja { + get { + return ResourceManager.GetString("text_tradeao_ja", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 감자군 + ///베르베르 + ///분홍이 + ///모린 + ///에이펀 + ///스태틴. + /// + internal static string text_tradeao_ko { + get { + return ResourceManager.GetString("text_tradeao_ko", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Karpiranha + ///Ravioli + ///Rentata + ///Stadida + ///Sharpo + ///Frops + ///Zackaroni + ///Fayana + ///Trasla + ///Pompador + ///Reichedel + ///Olli + ///Uno + ///Henrike + ///Sannah + ///Sannah + ///Sannah + ///Diantha. + /// + internal static string text_tradexy_de { + get { + return ResourceManager.GetString("text_tradexy_de", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Carpe Diem + ///Stevie + ///Quacklin’ + ///Thumper + ///Pierce + ///Froabble + ///Chester + ///Kinniekins + ///Ralts + ///Caveat + ///Elena + ///Cliff + ///Farris + ///Punky + ///Shauna + ///Shauna + ///Shauna + ///Diantha. + /// + internal static string text_tradexy_en { + get { + return ResourceManager.GetString("text_tradexy_en", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Karpirinha + ///Fortunyet + ///Sr.Puerró + ///Titanix + ///Sharpblade + ///Froakikín + ///Chespinete + ///Fennechín + ///Ralts + ///Karpman + ///Lupe + ///Mr Poireau + ///Ferrer + ///Filo + ///Xana + ///Xana + ///Xana + ///Dianta. + /// + internal static string text_tradexy_es { + get { + return ResourceManager.GetString("text_tradexy_es", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Ouïe-Ouïe + ///Décorum + ///Insp. Magret + ///Megascolide + ///Voldinou + ///Kermimi + ///M. Pointu + ///Mulder + ///Tarsal + ///Enid + ///Heleina + ///Henry + ///Andreï + ///Sophia + ///Sannah + ///Sannah + ///Sannah + ///Dianthéa. + /// + internal static string text_tradexy_fr { + get { + return ResourceManager.GetString("text_tradexy_fr", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Karkarp + ///Ottolnarg + ///Rosto + ///Rock + ///Ziffzaf + ///Froaxy + ///Chespy + ///Fennekino + ///Ralts + ///Mr.Karp + ///Helen + ///Reinhold + ///Accio + ///Punkie + ///Shana + ///Shana + ///Shana + ///Diantha. + /// + internal static string text_tradexy_it { + get { + return ResourceManager.GetString("text_tradexy_it", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to こいこい + ///アマヤル + ///マー + ///カッチ + ///キール + ///ゲコっち + ///ハリぼん + ///フォッぷ + ///ラルトス + ///カープ + ///ヘレン + ///ぐりお + ///アイン + ///パンク + ///サナ + ///サナ + ///サナ + ///カルネ. + /// + internal static string text_tradexy_ja { + get { + return ResourceManager.GetString("text_tradexy_ja", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 맞고 + ///달고나 + ///마 + ///카치 + ///절각 + ///개굴팅 + ///도치봉 + ///푸호뽀 + ///랄토스 + ///카프 + ///헬렌 + ///그리오 + ///아인 + ///펑크 + ///사나 + ///사나 + ///사나 + ///카르네. + /// + internal static string text_tradexy_ko { + get { + return ResourceManager.GetString("text_tradexy_ko", resourceCulture); + } + } + /// /// Looks up a localized string similar to ///KP-Sack S diff --git a/Properties/Resources.resx b/Properties/Resources.resx index b34e28230..1714a4194 100644 --- a/Properties/Resources.resx +++ b/Properties/Resources.resx @@ -5779,4 +5779,46 @@ ..\Resources\text\zh\text_xy_60000_zh.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8 + + ..\Resources\text\de\text_tradeao_de.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8 + + + ..\Resources\text\en\text_tradeao_en.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8 + + + ..\Resources\text\es\text_tradeao_es.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8 + + + ..\Resources\text\fr\text_tradeao_fr.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8 + + + ..\Resources\text\it\text_tradeao_it.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8 + + + ..\Resources\text\ja\text_tradeao_ja.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8 + + + ..\Resources\text\ko\text_tradeao_ko.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8 + + + ..\Resources\text\de\text_tradexy_de.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8 + + + ..\Resources\text\en\text_tradexy_en.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8 + + + ..\Resources\text\es\text_tradexy_es.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8 + + + ..\Resources\text\fr\text_tradexy_fr.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8 + + + ..\Resources\text\it\text_tradexy_it.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8 + + + ..\Resources\text\ja\text_tradexy_ja.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8 + + + ..\Resources\text\ko\text_tradexy_ko.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8 + \ No newline at end of file diff --git a/Resources/text/de/text_tradeao_de.txt b/Resources/text/de/text_tradeao_de.txt new file mode 100644 index 000000000..3a43d5c6f --- /dev/null +++ b/Resources/text/de/text_tradeao_de.txt @@ -0,0 +1,6 @@ +Makuhipsta +Conec +Coraso +Maik +Madina +Liana \ No newline at end of file diff --git a/Resources/text/de/text_tradexy_de.txt b/Resources/text/de/text_tradexy_de.txt new file mode 100644 index 000000000..71b8bd11c --- /dev/null +++ b/Resources/text/de/text_tradexy_de.txt @@ -0,0 +1,18 @@ +Karpiranha +Ravioli +Rentata +Stadida +Sharpo +Frops +Zackaroni +Fayana +Trasla +Pompador +Reichedel +Olli +Uno +Henrike +Sannah +Sannah +Sannah +Diantha \ No newline at end of file diff --git a/Resources/text/en/text_tradeao_en.txt b/Resources/text/en/text_tradeao_en.txt new file mode 100644 index 000000000..9de236844 --- /dev/null +++ b/Resources/text/en/text_tradeao_en.txt @@ -0,0 +1,6 @@ +Makit +Skitit +Coroso +Darrell +Elyssa +Lane \ No newline at end of file diff --git a/Resources/text/en/text_tradexy_en.txt b/Resources/text/en/text_tradexy_en.txt new file mode 100644 index 000000000..af347773c --- /dev/null +++ b/Resources/text/en/text_tradexy_en.txt @@ -0,0 +1,18 @@ +Carpe Diem +Stevie +Quacklin’ +Thumper +Pierce +Froabble +Chester +Kinniekins +Ralts +Caveat +Elena +Cliff +Farris +Punky +Shauna +Shauna +Shauna +Diantha \ No newline at end of file diff --git a/Resources/text/es/text_tradeao_es.txt b/Resources/text/es/text_tradeao_es.txt new file mode 100644 index 000000000..14d3a0deb --- /dev/null +++ b/Resources/text/es/text_tradeao_es.txt @@ -0,0 +1,6 @@ +Makit +Skitit +Coroso +Evelio +Dalila +Laila \ No newline at end of file diff --git a/Resources/text/es/text_tradexy_es.txt b/Resources/text/es/text_tradexy_es.txt new file mode 100644 index 000000000..4c7c2d93f --- /dev/null +++ b/Resources/text/es/text_tradexy_es.txt @@ -0,0 +1,18 @@ +Karpirinha +Fortunyet +Sr.Puerró +Titanix +Sharpblade +Froakikín +Chespinete +Fennechín +Ralts +Karpman +Lupe +Mr Poireau +Ferrer +Filo +Xana +Xana +Xana +Dianta \ No newline at end of file diff --git a/Resources/text/fr/text_tradeao_fr.txt b/Resources/text/fr/text_tradeao_fr.txt new file mode 100644 index 000000000..f20ffb9eb --- /dev/null +++ b/Resources/text/fr/text_tradeao_fr.txt @@ -0,0 +1,6 @@ +Edmond +Minetou +Rosie +Allan +Dorothée +Marsantes \ No newline at end of file diff --git a/Resources/text/fr/text_tradexy_fr.txt b/Resources/text/fr/text_tradexy_fr.txt new file mode 100644 index 000000000..373eb6d8d --- /dev/null +++ b/Resources/text/fr/text_tradexy_fr.txt @@ -0,0 +1,18 @@ +Ouïe-Ouïe +Décorum +Insp. Magret +Megascolide +Voldinou +Kermimi +M. Pointu +Mulder +Tarsal +Enid +Heleina +Henry +Andreï +Sophia +Sannah +Sannah +Sannah +Dianthéa \ No newline at end of file diff --git a/Resources/text/it/text_tradeao_it.txt b/Resources/text/it/text_tradeao_it.txt new file mode 100644 index 000000000..03d4f54d4 --- /dev/null +++ b/Resources/text/it/text_tradeao_it.txt @@ -0,0 +1,6 @@ +Maku +Pucci +Corsolina +Marchetto +Ele +Simo \ No newline at end of file diff --git a/Resources/text/it/text_tradexy_it.txt b/Resources/text/it/text_tradexy_it.txt new file mode 100644 index 000000000..c64a27a2d --- /dev/null +++ b/Resources/text/it/text_tradexy_it.txt @@ -0,0 +1,18 @@ +Karkarp +Ottolnarg +Rosto +Rock +Ziffzaf +Froaxy +Chespy +Fennekino +Ralts +Mr.Karp +Helen +Reinhold +Accio +Punkie +Shana +Shana +Shana +Diantha \ No newline at end of file diff --git a/Resources/text/ja/text_tradeao_ja.txt b/Resources/text/ja/text_tradeao_ja.txt new file mode 100644 index 000000000..c0bc4e619 --- /dev/null +++ b/Resources/text/ja/text_tradeao_ja.txt @@ -0,0 +1,6 @@ +ポテマル +ベルベル +モモちゃん +モーリン +ユキポン +サトチン \ No newline at end of file diff --git a/Resources/text/ja/text_tradexy_ja.txt b/Resources/text/ja/text_tradexy_ja.txt new file mode 100644 index 000000000..1c010e282 --- /dev/null +++ b/Resources/text/ja/text_tradexy_ja.txt @@ -0,0 +1,18 @@ +こいこい +アマヤル +マー +カッチ +キール +ゲコっち +ハリぼん +フォッぷ +ラルトス +カープ +ヘレン +ぐりお +アイン +パンク +サナ +サナ +サナ +カルネ \ No newline at end of file diff --git a/Resources/text/ko/text_tradeao_ko.txt b/Resources/text/ko/text_tradeao_ko.txt new file mode 100644 index 000000000..b5885e923 --- /dev/null +++ b/Resources/text/ko/text_tradeao_ko.txt @@ -0,0 +1,6 @@ +감자군 +베르베르 +분홍이 +모린 +에이펀 +스태틴 \ No newline at end of file diff --git a/Resources/text/ko/text_tradexy_ko.txt b/Resources/text/ko/text_tradexy_ko.txt new file mode 100644 index 000000000..92a08c1dc --- /dev/null +++ b/Resources/text/ko/text_tradexy_ko.txt @@ -0,0 +1,18 @@ +맞고 +달고나 +마 +카치 +절각 +개굴팅 +도치봉 +푸호뽀 +랄토스 +카프 +헬렌 +그리오 +아인 +펑크 +사나 +사나 +사나 +카르네 \ No newline at end of file