Add japanese blue encounter tables (unique to jp_blue)

When creating a new pk1 for the slot->pkm, get it as a pk1-japanese.
Export the gameversion when in pk1/2 format (same as VC).
This commit is contained in:
Kurt 2021-01-08 11:29:00 -08:00
parent 2deb51b365
commit 4a3a8dd090
6 changed files with 13 additions and 9 deletions

View file

@ -9,9 +9,11 @@ namespace PKHeX.Core
internal static class Encounters1 internal static class Encounters1
{ {
private static readonly EncounterArea1[] SlotsR = Get("red", "g1", RD); private static readonly EncounterArea1[] SlotsR = Get("red", "g1", RD);
private static readonly EncounterArea1[] SlotsB = Get("blue", "g1", BU); private static readonly EncounterArea1[] SlotsG = Get("blue", "g1", GN);
private static readonly EncounterArea1[] SlotsY = Get("yellow", "g1", YW); private static readonly EncounterArea1[] SlotsY = Get("yellow", "g1", YW);
internal static readonly EncounterArea1[] SlotsRBY = ArrayUtil.ConcatAll(SlotsR, SlotsB, SlotsY); private static readonly EncounterArea1[] SlotsB = Get("blue_jp", "g1", BU);
internal static readonly EncounterArea1[] SlotsRBY = ArrayUtil.ConcatAll(SlotsR, SlotsG, SlotsY);
internal static readonly EncounterArea1[] SlotsRGBY = ArrayUtil.ConcatAll(SlotsRBY, SlotsB);
private static EncounterArea1[] Get(string name, string ident, GameVersion game) => private static EncounterArea1[] Get(string name, string ident, GameVersion game) =>
EncounterArea1.GetAreas(BinLinker.Unpack(Util.GetBinaryResource($"encounter_{name}.pkl"), ident), game); EncounterArea1.GetAreas(BinLinker.Unpack(Util.GetBinaryResource($"encounter_{name}.pkl"), ident), game);

View file

@ -134,7 +134,7 @@ namespace PKHeX.Core
private static IEnumerable<EncounterArea> GetEncounterTable(PKM pkm, GameVersion game) => game switch private static IEnumerable<EncounterArea> GetEncounterTable(PKM pkm, GameVersion game) => game switch
{ {
RBY or RD or BU or GN or YW => SlotsRBY, RBY or RD or BU or GN or YW => pkm.Japanese ? SlotsRGBY : SlotsRBY,
GSC or GD or SV or C => GetEncounterTableGSC(pkm), GSC or GD or SV or C => GetEncounterTableGSC(pkm),

View file

@ -404,7 +404,7 @@ namespace PKHeX.Core
var loc = EncounterLocation; var loc = EncounterLocation;
if (!string.IsNullOrEmpty(loc)) if (!string.IsNullOrEmpty(loc))
lines.Add(string.Format(L_F0_1, "Location", loc)); lines.Add(string.Format(L_F0_1, "Location", loc));
if (pkm.VC) if (Info.Generation <= 2)
lines.Add(string.Format(L_F0_1, nameof(GameVersion), Info.Game)); lines.Add(string.Format(L_F0_1, nameof(GameVersion), Info.Game));
if (!Info.PIDParsed) if (!Info.PIDParsed)

View file

@ -30,6 +30,7 @@
<None Remove="Resources\byte\encounter_b.pkl" /> <None Remove="Resources\byte\encounter_b.pkl" />
<None Remove="Resources\byte\encounter_b2.pkl" /> <None Remove="Resources\byte\encounter_b2.pkl" />
<None Remove="Resources\byte\encounter_blue.pkl" /> <None Remove="Resources\byte\encounter_blue.pkl" />
<None Remove="Resources\byte\encounter_blue_jp.pkl" />
<None Remove="Resources\byte\encounter_crystal.pkl" /> <None Remove="Resources\byte\encounter_crystal.pkl" />
<None Remove="Resources\byte\encounter_d.pkl" /> <None Remove="Resources\byte\encounter_d.pkl" />
<None Remove="Resources\byte\encounter_e.pkl" /> <None Remove="Resources\byte\encounter_e.pkl" />
@ -880,6 +881,7 @@
<EmbeddedResource Include="Resources\byte\encounter_b.pkl" /> <EmbeddedResource Include="Resources\byte\encounter_b.pkl" />
<EmbeddedResource Include="Resources\byte\encounter_b2.pkl" /> <EmbeddedResource Include="Resources\byte\encounter_b2.pkl" />
<EmbeddedResource Include="Resources\byte\encounter_blue.pkl" /> <EmbeddedResource Include="Resources\byte\encounter_blue.pkl" />
<EmbeddedResource Include="Resources\byte\encounter_blue_jp.pkl" />
<EmbeddedResource Include="Resources\byte\encounter_crystal.pkl" /> <EmbeddedResource Include="Resources\byte\encounter_crystal.pkl" />
<EmbeddedResource Include="Resources\byte\encounter_d.pkl" /> <EmbeddedResource Include="Resources\byte\encounter_d.pkl" />
<EmbeddedResource Include="Resources\byte\encounter_e.pkl" /> <EmbeddedResource Include="Resources\byte\encounter_e.pkl" />

View file

@ -426,12 +426,12 @@ namespace PKHeX.Core
return (PKM)Activator.CreateInstance(type, new object[argCount]); return (PKM)Activator.CreateInstance(type, new object[argCount]);
} }
public static PKM GetBlank(int gen, GameVersion ver) public static PKM GetBlank(int gen, GameVersion ver) => gen switch
{ {
if (gen == 7 && GameVersion.Gen7b.Contains(ver)) 1 when ver == GameVersion.BU => new PK1(true),
return new PB7(); 7 when GameVersion.Gen7b.Contains(ver) => new PB7(),
return GetBlank(gen); _ => GetBlank(gen)
} };
public static PKM GetBlank(int gen, int ver) => GetBlank(gen, (GameVersion) ver); public static PKM GetBlank(int gen, int ver) => GetBlank(gen, (GameVersion) ver);

Binary file not shown.