2018-05-19 04:35:57 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
|
|
|
|
namespace PKHeX.Core
|
|
|
|
|
{
|
2019-09-23 23:56:47 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Repository of localized game strings for a given <see cref="LanguageID"/>.
|
|
|
|
|
/// </summary>
|
2019-10-04 02:09:02 +00:00
|
|
|
|
public sealed class GameStrings : IBasicStrings
|
2018-05-19 04:35:57 +00:00
|
|
|
|
{
|
|
|
|
|
// PKM Info
|
|
|
|
|
public readonly string[] specieslist, movelist, itemlist, abilitylist, types, natures, forms,
|
2021-08-24 06:06:51 +00:00
|
|
|
|
memories, genloc, feeling, intensity,
|
|
|
|
|
trainingbags, trainingstage, characteristics,
|
2021-07-04 06:25:09 +00:00
|
|
|
|
groundtiletypes, balllist, gamelist, pokeblocks, ribbons;
|
2018-05-19 04:35:57 +00:00
|
|
|
|
|
|
|
|
|
private readonly string[] g4items, g3coloitems, g3xditems, g3items, g2items, g1items;
|
|
|
|
|
|
|
|
|
|
// Met Locations
|
|
|
|
|
public readonly string[] metGSC_00000, metRSEFRLG_00000, metCXD_00000;
|
|
|
|
|
public readonly string[] metHGSS_00000, metHGSS_02000, metHGSS_03000;
|
|
|
|
|
public readonly string[] metBW2_00000, metBW2_30000, metBW2_40000, metBW2_60000;
|
|
|
|
|
public readonly string[] metXY_00000, metXY_30000, metXY_40000, metXY_60000;
|
|
|
|
|
public readonly string[] metSM_00000, metSM_30000, metSM_40000, metSM_60000;
|
2018-11-12 06:49:17 +00:00
|
|
|
|
public readonly string[] metGG_00000, metGG_30000, metGG_40000, metGG_60000;
|
2019-09-23 23:56:47 +00:00
|
|
|
|
public readonly string[] metSWSH_00000, metSWSH_30000, metSWSH_40000, metSWSH_60000;
|
2018-05-19 04:35:57 +00:00
|
|
|
|
|
|
|
|
|
// Misc
|
2020-08-01 16:20:13 +00:00
|
|
|
|
public readonly string[] wallpapernames, puffs, walkercourses;
|
2020-09-13 21:55:50 +00:00
|
|
|
|
public readonly string[] uggoods, ugspheres, ugtraps, ugtreasures;
|
2018-05-19 04:35:57 +00:00
|
|
|
|
private readonly string lang;
|
2019-06-22 17:50:32 +00:00
|
|
|
|
private readonly int LanguageIndex;
|
2018-05-19 04:35:57 +00:00
|
|
|
|
|
2018-09-02 02:55:08 +00:00
|
|
|
|
public string EggName { get; }
|
2018-06-30 16:59:48 +00:00
|
|
|
|
public IReadOnlyList<string> Species => specieslist;
|
|
|
|
|
public IReadOnlyList<string> Item => itemlist;
|
|
|
|
|
public IReadOnlyList<string> Move => movelist;
|
|
|
|
|
public IReadOnlyList<string> Ability => abilitylist;
|
|
|
|
|
public IReadOnlyList<string> Types => types;
|
|
|
|
|
public IReadOnlyList<string> Natures => natures;
|
2018-05-19 04:35:57 +00:00
|
|
|
|
|
2019-06-22 17:50:32 +00:00
|
|
|
|
private string[] Get(string ident) => GameLanguage.GetStrings(ident, lang);
|
2018-08-03 03:11:42 +00:00
|
|
|
|
private const string NPC = "NPC";
|
2018-05-19 04:35:57 +00:00
|
|
|
|
|
2020-11-02 21:11:51 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Item IDs that correspond to the <see cref="Ball"/> value.
|
|
|
|
|
/// </summary>
|
2021-06-03 19:04:19 +00:00
|
|
|
|
private static readonly ushort[] Items_Ball =
|
2020-11-02 21:11:51 +00:00
|
|
|
|
{
|
|
|
|
|
000, 001, 002, 003, 004, 005, 006, 007, 008, 009, 010, 011, 012,
|
|
|
|
|
013, 014, 015, 016, 492, 493, 494, 495, 496, 497, 498, 499, 576,
|
2021-08-20 20:49:20 +00:00
|
|
|
|
851,
|
2020-11-02 21:11:51 +00:00
|
|
|
|
};
|
|
|
|
|
|
2018-05-19 04:35:57 +00:00
|
|
|
|
public GameStrings(string l)
|
|
|
|
|
{
|
|
|
|
|
lang = l;
|
2019-06-22 17:50:32 +00:00
|
|
|
|
LanguageIndex = GameLanguage.GetLanguageIndex(l);
|
2018-05-19 04:35:57 +00:00
|
|
|
|
ribbons = Get("ribbons");
|
2021-06-03 19:04:19 +00:00
|
|
|
|
|
2018-05-19 04:35:57 +00:00
|
|
|
|
// Past Generation strings
|
|
|
|
|
g3items = Get("ItemsG3");
|
2021-06-03 19:04:19 +00:00
|
|
|
|
g3coloitems = GetG3CXD(g3items, "ItemsG3Colosseum");
|
|
|
|
|
g3xditems = GetG3CXD(g3items, "ItemsG3XD");
|
|
|
|
|
|
2018-05-19 04:35:57 +00:00
|
|
|
|
g2items = Get("ItemsG2");
|
|
|
|
|
g1items = Get("ItemsG1");
|
|
|
|
|
metRSEFRLG_00000 = Get("rsefrlg_00000");
|
|
|
|
|
metGSC_00000 = Get("gsc_00000");
|
|
|
|
|
|
|
|
|
|
metCXD_00000 = Get("cxd_00000");
|
2020-12-28 18:22:13 +00:00
|
|
|
|
SanitizeMetStringsCXD(metCXD_00000);
|
2018-05-19 04:35:57 +00:00
|
|
|
|
|
|
|
|
|
// Current Generation strings
|
|
|
|
|
natures = Util.GetNaturesList(l);
|
|
|
|
|
types = Get("types");
|
|
|
|
|
abilitylist = Get("abilities");
|
|
|
|
|
|
|
|
|
|
movelist = Get("moves");
|
|
|
|
|
string[] ps = { "P", "S" }; // Distinguish Physical/Special
|
|
|
|
|
for (int i = 622; i < 658; i++)
|
|
|
|
|
movelist[i] += $" ({ps[i % 2]})";
|
|
|
|
|
|
|
|
|
|
itemlist = Get("items");
|
|
|
|
|
characteristics = Get("character");
|
|
|
|
|
specieslist = Get("species");
|
|
|
|
|
wallpapernames = Get("wallpaper");
|
2021-07-04 06:25:09 +00:00
|
|
|
|
groundtiletypes = Get("groundtile");
|
2018-05-19 04:35:57 +00:00
|
|
|
|
gamelist = Get("games");
|
|
|
|
|
|
2020-11-02 21:11:51 +00:00
|
|
|
|
balllist = new string[Items_Ball.Length];
|
2018-05-19 04:35:57 +00:00
|
|
|
|
for (int i = 0; i < balllist.Length; i++)
|
2020-11-02 21:11:51 +00:00
|
|
|
|
balllist[i] = itemlist[Items_Ball[i]];
|
2018-05-19 04:35:57 +00:00
|
|
|
|
|
|
|
|
|
pokeblocks = Get("pokeblock");
|
|
|
|
|
forms = Get("forms");
|
|
|
|
|
memories = Get("memories");
|
2021-08-24 06:06:51 +00:00
|
|
|
|
feeling = Get("feeling");
|
|
|
|
|
intensity = Get("intensity");
|
2018-05-19 04:35:57 +00:00
|
|
|
|
genloc = Get("genloc");
|
|
|
|
|
trainingbags = Get("trainingbag");
|
|
|
|
|
trainingstage = Get("supertraining");
|
|
|
|
|
puffs = Get("puff");
|
|
|
|
|
|
2020-08-01 16:20:13 +00:00
|
|
|
|
walkercourses = Get("hgss_walkercourses");
|
|
|
|
|
|
2020-09-13 21:55:50 +00:00
|
|
|
|
uggoods = Get("dppt_uggoods");
|
|
|
|
|
ugspheres = Get("dppt_ugspheres");
|
|
|
|
|
ugtraps = Get("dppt_ugtraps");
|
|
|
|
|
ugtreasures = Get("dppt_ugtreasures");
|
|
|
|
|
|
2018-09-02 02:55:08 +00:00
|
|
|
|
EggName = specieslist[0];
|
2018-05-19 04:35:57 +00:00
|
|
|
|
metHGSS_00000 = Get("hgss_00000");
|
|
|
|
|
metHGSS_02000 = Get("hgss_02000");
|
|
|
|
|
metHGSS_03000 = Get("hgss_03000");
|
|
|
|
|
metBW2_00000 = Get("bw2_00000");
|
|
|
|
|
metBW2_30000 = Get("bw2_30000");
|
|
|
|
|
metBW2_40000 = Get("bw2_40000");
|
|
|
|
|
metBW2_60000 = Get("bw2_60000");
|
|
|
|
|
metXY_00000 = Get("xy_00000");
|
|
|
|
|
metXY_30000 = Get("xy_30000");
|
|
|
|
|
metXY_40000 = Get("xy_40000");
|
|
|
|
|
metXY_60000 = Get("xy_60000");
|
|
|
|
|
metSM_00000 = Get("sm_00000");
|
|
|
|
|
metSM_30000 = Get("sm_30000");
|
|
|
|
|
metSM_40000 = Get("sm_40000");
|
|
|
|
|
metSM_60000 = Get("sm_60000");
|
|
|
|
|
|
2018-11-12 06:49:17 +00:00
|
|
|
|
metGG_00000 = Get("gg_00000");
|
|
|
|
|
metGG_30000 = metSM_30000;
|
|
|
|
|
metGG_40000 = Get("gg_40000");
|
|
|
|
|
metGG_60000 = metSM_60000;
|
|
|
|
|
|
2019-11-16 01:34:18 +00:00
|
|
|
|
metSWSH_00000 = Get("swsh_00000");
|
|
|
|
|
metSWSH_30000 = Get("swsh_30000");
|
|
|
|
|
metSWSH_40000 = Get("swsh_40000");
|
|
|
|
|
metSWSH_60000 = Get("swsh_60000");
|
2019-09-23 23:56:47 +00:00
|
|
|
|
|
2018-05-19 04:35:57 +00:00
|
|
|
|
Sanitize();
|
|
|
|
|
|
|
|
|
|
g4items = (string[])itemlist.Clone();
|
|
|
|
|
Get("mail4").CopyTo(g4items, 137);
|
|
|
|
|
}
|
|
|
|
|
|
2021-06-03 19:04:19 +00:00
|
|
|
|
private string[] GetG3CXD(string[] arr, string fileName)
|
|
|
|
|
{
|
|
|
|
|
string[] item500 = Get(fileName);
|
|
|
|
|
var result = new string[500 + item500.Length];
|
|
|
|
|
for (int i = arr.Length; i < result.Length; i++)
|
|
|
|
|
result[i] = $"UNUSED {i}";
|
|
|
|
|
arr.CopyTo(result, 0);
|
|
|
|
|
item500.CopyTo(result, 500);
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
2020-12-28 18:22:13 +00:00
|
|
|
|
private static void SanitizeMetStringsCXD(string[] cxd)
|
2018-08-03 03:11:42 +00:00
|
|
|
|
{
|
2020-12-28 18:22:13 +00:00
|
|
|
|
// Less than 10% of met location values are unique.
|
|
|
|
|
// Just mark them with the ID if they aren't empty.
|
|
|
|
|
for (int i = 0; i < 227; i++)
|
2018-08-03 03:11:42 +00:00
|
|
|
|
{
|
2020-12-28 18:22:13 +00:00
|
|
|
|
var str = cxd[i];
|
|
|
|
|
if (str.Length != 0)
|
|
|
|
|
cxd[i] = $"{str} [{i:000}]";
|
2018-08-03 03:11:42 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2018-05-19 04:35:57 +00:00
|
|
|
|
private void Sanitize()
|
|
|
|
|
{
|
|
|
|
|
SanitizeItemNames();
|
|
|
|
|
SanitizeMetLocations();
|
|
|
|
|
|
2020-10-24 18:11:05 +00:00
|
|
|
|
// De-duplicate the Calyrex ability names
|
|
|
|
|
abilitylist[(int)Core.Ability.AsOneI] += $" ({specieslist[(int)Core.Species.Glastrier]})";
|
|
|
|
|
abilitylist[(int)Core.Ability.AsOneG] += $" ({specieslist[(int)Core.Species.Spectrier]})";
|
|
|
|
|
|
2018-05-19 04:35:57 +00:00
|
|
|
|
// Replace the Egg Name with ---; egg name already stored to eggname
|
|
|
|
|
specieslist[0] = "---";
|
|
|
|
|
// Fix (None) tags
|
|
|
|
|
var none = $"({itemlist[0]})";
|
|
|
|
|
abilitylist[0] = itemlist[0] = movelist[0] = metXY_00000[0] = metBW2_00000[0] = metHGSS_00000[0] = metCXD_00000[0] = puffs[0] = none;
|
|
|
|
|
}
|
2018-08-03 03:11:42 +00:00
|
|
|
|
|
2018-05-19 04:35:57 +00:00
|
|
|
|
private void SanitizeItemNames()
|
|
|
|
|
{
|
|
|
|
|
// Fix Item Names (Duplicate entries)
|
|
|
|
|
var HM06 = itemlist[425];
|
2021-05-14 22:30:55 +00:00
|
|
|
|
var HM0 = HM06[..^1]; // language ambiguous!
|
2018-05-19 04:35:57 +00:00
|
|
|
|
itemlist[426] = $"{HM0}7 (G4)";
|
|
|
|
|
itemlist[427] = $"{HM0}8 (G4)";
|
|
|
|
|
itemlist[456] += " (HG/SS)"; // S.S. Ticket
|
|
|
|
|
itemlist[736] += " (OR/AS)"; // S.S. Ticket
|
|
|
|
|
itemlist[463] += " (DPPt)"; // Storage Key
|
|
|
|
|
itemlist[734] += " (OR/AS)"; // Storage Key
|
2018-09-13 04:27:25 +00:00
|
|
|
|
itemlist[476] += " (HG/SS)"; // Basement Key
|
|
|
|
|
itemlist[723] += " (OR/AS)"; // Basement Key
|
2018-05-19 04:35:57 +00:00
|
|
|
|
itemlist[621] += " (M)"; // Xtransceiver
|
|
|
|
|
itemlist[626] += " (F)"; // Xtransceiver
|
|
|
|
|
itemlist[629] += " (2)"; // DNA Splicers
|
|
|
|
|
itemlist[637] += " (2)"; // Dropped Item
|
|
|
|
|
itemlist[707] += " (2)"; // Travel Trunk
|
|
|
|
|
itemlist[713] += " (2)"; // Alt Bike
|
|
|
|
|
itemlist[714] += " (2)"; // Holo Caster
|
|
|
|
|
itemlist[729] += " (1)"; // Meteorite
|
|
|
|
|
itemlist[740] += " (2)"; // Contest Costume
|
|
|
|
|
itemlist[751] += " (2)"; // Meteorite
|
|
|
|
|
itemlist[771] += " (3)"; // Meteorite
|
|
|
|
|
itemlist[772] += " (4)"; // Meteorite
|
|
|
|
|
itemlist[842] += " (SM)"; // Fishing Rod
|
|
|
|
|
itemlist[945] += " (2)"; // Used Solarizer
|
|
|
|
|
itemlist[946] += " (2)"; // Used Lunarizer
|
Differentiate past gen moves with same names
Not sure if there'll be ones for other languages, hopefully not.
dupe checker:
var langs = new string[] {"en", "ja", "ko", "es", "it", "de", "fr",
"zh"};
foreach (var l in langs)
{
var names = new GameStrings(l).itemlist;
var dupe = names
.Select((z, i) => new {Index = i, Value = z})
.GroupBy(z => z.Value)
.Where(z => z.Key != "???")
.Where(z => z.Key != "???")
.Where(z => z.Key != "(?)")
.Where(z => z.Count() >= 2)
.ToArray();
if (dupe.Length == 0)
continue;
l.Dump();
dupe.Dump();
}
2018-11-16 23:15:42 +00:00
|
|
|
|
|
|
|
|
|
itemlist[873] += " (GP/GE)"; // S.S. Ticket
|
|
|
|
|
itemlist[459] += " (HG/SS)"; // Parcel
|
|
|
|
|
itemlist[467] += " (Pt)"; // Secret Key
|
|
|
|
|
itemlist[475] += " (HG/SS)"; // Card Key
|
|
|
|
|
itemlist[894] += " (GP)"; // Leaf Letter
|
|
|
|
|
itemlist[895] += " (GE)"; // Leaf Letter
|
|
|
|
|
|
|
|
|
|
// some languages have same names for other items!
|
|
|
|
|
itemlist[878] += " (GP/GE)"; // Lift Key (Elevator Key=700)
|
|
|
|
|
itemlist[479] += " (HG/SS)"; // Lost Item (Dropped Item=636)
|
2018-05-19 04:35:57 +00:00
|
|
|
|
|
|
|
|
|
// Append Z-Crystal flagging
|
|
|
|
|
foreach (var i in Legal.Pouch_ZCrystal_USUM)
|
|
|
|
|
itemlist[i] += " [Z]";
|
2018-06-06 00:02:19 +00:00
|
|
|
|
|
2019-11-16 01:34:18 +00:00
|
|
|
|
itemlist[0121] += " (1)"; // Pokémon Box Link
|
|
|
|
|
itemlist[1075] += " (2)"; // Pokémon Box Link
|
|
|
|
|
|
|
|
|
|
itemlist[1080] += " (SW/SH)"; // Fishing Rod
|
|
|
|
|
|
|
|
|
|
itemlist[1081] += " (1)"; // Rotom Bike
|
|
|
|
|
itemlist[1266] += " (2)"; // Rotom Bike
|
2020-06-19 23:51:15 +00:00
|
|
|
|
itemlist[1585] += " (3)"; // Rotom Bike
|
|
|
|
|
itemlist[1586] += " (4)"; // Rotom Bike
|
2019-11-16 01:34:18 +00:00
|
|
|
|
|
2020-10-24 18:11:05 +00:00
|
|
|
|
itemlist[1590] += " (1)"; // Reins of Unity
|
|
|
|
|
itemlist[1591] += " (2)"; // Reins of Unity
|
|
|
|
|
itemlist[1607] += " (3)"; // Reins of Unity
|
|
|
|
|
|
2018-06-06 00:02:19 +00:00
|
|
|
|
for (int i = 12; i <= 29; i++) // Differentiate DNA Samples
|
|
|
|
|
g3coloitems[500 + i] += $" ({i - 11:00})";
|
2018-12-20 23:23:57 +00:00
|
|
|
|
// differentiate G3 Card Key from Colo
|
|
|
|
|
g3coloitems[500 + 10] += " (COLO)";
|
2018-05-19 04:35:57 +00:00
|
|
|
|
}
|
2018-08-03 03:11:42 +00:00
|
|
|
|
|
2018-05-19 04:35:57 +00:00
|
|
|
|
private void SanitizeMetLocations()
|
|
|
|
|
{
|
|
|
|
|
// Fix up some of the Location strings to make them more descriptive
|
2019-07-09 05:05:59 +00:00
|
|
|
|
SanitizeMetG4HGSS();
|
2018-05-19 04:35:57 +00:00
|
|
|
|
SanitizeMetG5BW();
|
|
|
|
|
SanitizeMetG6XY();
|
|
|
|
|
SanitizeMetG7SM();
|
2019-11-16 01:34:18 +00:00
|
|
|
|
SanitizeMetG8SWSH();
|
2019-07-09 05:05:59 +00:00
|
|
|
|
|
2020-12-25 20:30:26 +00:00
|
|
|
|
if (lang is "es" or "it")
|
2019-07-09 05:05:59 +00:00
|
|
|
|
{
|
|
|
|
|
// Campeonato Mundial duplicates
|
|
|
|
|
for (int i = 27; i < 34; i++)
|
|
|
|
|
metXY_40000[i] += " (-)";
|
|
|
|
|
|
|
|
|
|
// Evento de Videojuegos -- first as duplicate
|
|
|
|
|
metXY_40000[34] += " (-)";
|
|
|
|
|
metSM_40000[37] += " (-)";
|
|
|
|
|
metGG_40000[26] += " (-)";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (lang == "ko")
|
|
|
|
|
{
|
|
|
|
|
// Pokémon Ranger duplicate (should be Ranger Union)
|
|
|
|
|
metBW2_40000[70] += " (-)";
|
|
|
|
|
}
|
2018-05-19 04:35:57 +00:00
|
|
|
|
}
|
2018-08-03 03:11:42 +00:00
|
|
|
|
|
2019-07-09 05:05:59 +00:00
|
|
|
|
private void SanitizeMetG4HGSS()
|
2018-05-19 04:35:57 +00:00
|
|
|
|
{
|
2019-07-09 05:05:59 +00:00
|
|
|
|
metHGSS_00000[054] += " (DP/Pt)"; // Victory Road
|
|
|
|
|
metHGSS_00000[221] += " (HG/SS)"; // Victory Road
|
|
|
|
|
|
|
|
|
|
// German language duplicate; handle for all since it can be confused.
|
|
|
|
|
metHGSS_00000[104] += " (DP/Pt)"; // Vista Lighthouse
|
|
|
|
|
metHGSS_00000[212] += " (HG/SS)"; // Lighthouse
|
|
|
|
|
|
2018-05-19 04:35:57 +00:00
|
|
|
|
metHGSS_02000[1] += $" ({NPC})"; // Anything from an NPC
|
2018-09-02 02:55:08 +00:00
|
|
|
|
metHGSS_02000[2] += $" ({EggName})"; // Egg From Link Trade
|
2019-07-09 05:05:59 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void SanitizeMetG5BW()
|
|
|
|
|
{
|
2018-05-19 04:35:57 +00:00
|
|
|
|
metBW2_00000[36] = $"{metBW2_00000[84]}/{metBW2_00000[36]}"; // Cold Storage in BW = PWT in BW2
|
2020-08-27 02:50:48 +00:00
|
|
|
|
metBW2_00000[40] += " (B/W)"; // Victory Road in BW
|
|
|
|
|
metBW2_00000[134] += " (B2/W2)"; // Victory Road in B2W2
|
2018-05-19 04:35:57 +00:00
|
|
|
|
// BW2 Entries from 76 to 105 are for Entralink in BW
|
|
|
|
|
for (int i = 76; i < 106; i++)
|
|
|
|
|
metBW2_00000[i] += "●";
|
|
|
|
|
|
|
|
|
|
// Collision between 40002 (legal) and 00002 (illegal) "Faraway place"
|
|
|
|
|
if (metBW2_00000[2] == metBW2_40000[2 - 1])
|
|
|
|
|
metBW2_00000[2] += " (2)";
|
|
|
|
|
|
2019-07-09 05:05:59 +00:00
|
|
|
|
for (int i = 96; i < 108; i++)
|
|
|
|
|
metBW2_40000[i] += $" ({i - 96})";
|
|
|
|
|
|
2018-05-19 04:35:57 +00:00
|
|
|
|
// Localize the Poketransfer to the language (30001)
|
2019-06-22 17:50:32 +00:00
|
|
|
|
metBW2_30000[1 - 1] = GameLanguage.GetTransporterName(LanguageIndex);
|
2018-05-19 04:35:57 +00:00
|
|
|
|
metBW2_30000[2 - 1] += $" ({NPC})"; // Anything from an NPC
|
2018-09-02 02:55:08 +00:00
|
|
|
|
metBW2_30000[3 - 1] += $" ({EggName})"; // Link Trade (Egg)
|
2018-05-19 04:35:57 +00:00
|
|
|
|
|
|
|
|
|
// Zorua/Zoroark events
|
|
|
|
|
metBW2_30000[10 - 1] = $"{specieslist[251]} ({specieslist[570]} 1)"; // Celebi's Zorua Event
|
|
|
|
|
metBW2_30000[11 - 1] = $"{specieslist[251]} ({specieslist[570]} 2)"; // Celebi's Zorua Event
|
|
|
|
|
metBW2_30000[12 - 1] = $"{specieslist[571]} (1)"; // Zoroark
|
|
|
|
|
metBW2_30000[13 - 1] = $"{specieslist[571]} (2)"; // Zoroark
|
|
|
|
|
|
2018-09-02 02:55:08 +00:00
|
|
|
|
metBW2_60000[3 - 1] += $" ({EggName})"; // Egg Treasure Hunter/Breeder, whatever...
|
2018-05-19 04:35:57 +00:00
|
|
|
|
}
|
2018-08-03 03:11:42 +00:00
|
|
|
|
|
2018-05-19 04:35:57 +00:00
|
|
|
|
private void SanitizeMetG6XY()
|
|
|
|
|
{
|
|
|
|
|
metXY_00000[104] += " (X/Y)"; // Victory Road
|
|
|
|
|
metXY_00000[106] += " (X/Y)"; // Pokémon League
|
|
|
|
|
metXY_00000[202] += " (OR/AS)"; // Pokémon League
|
|
|
|
|
metXY_00000[298] += " (OR/AS)"; // Victory Road
|
|
|
|
|
metXY_30000[0] += $" ({NPC})"; // Anything from an NPC
|
2018-09-02 02:55:08 +00:00
|
|
|
|
metXY_30000[1] += $" ({EggName})"; // Egg From Link Trade
|
2019-07-09 05:05:59 +00:00
|
|
|
|
|
|
|
|
|
for (int i = 62; i < 69; i++)
|
|
|
|
|
metXY_40000[i] += $" ({i - 61})";
|
2018-05-19 04:35:57 +00:00
|
|
|
|
}
|
2018-08-03 03:11:42 +00:00
|
|
|
|
|
2018-05-19 04:35:57 +00:00
|
|
|
|
private void SanitizeMetG7SM()
|
|
|
|
|
{
|
|
|
|
|
// Sun/Moon duplicates -- elaborate!
|
2021-01-09 03:26:20 +00:00
|
|
|
|
for (int i = 6; i < metSM_00000.Length; i += 2)
|
2018-05-19 04:35:57 +00:00
|
|
|
|
{
|
2021-01-09 03:26:20 +00:00
|
|
|
|
if (i is >= 194 and < 198)
|
|
|
|
|
continue; // Skip Island Names (unused)
|
2018-05-19 04:35:57 +00:00
|
|
|
|
var nextLoc = metSM_00000[i + 1];
|
2021-01-09 03:26:20 +00:00
|
|
|
|
if (nextLoc.Length == 0)
|
|
|
|
|
continue;
|
|
|
|
|
metSM_00000[i + 1] = string.Empty;
|
|
|
|
|
metSM_00000[i] += $" ({nextLoc})";
|
2018-05-19 04:35:57 +00:00
|
|
|
|
}
|
2021-01-09 03:26:20 +00:00
|
|
|
|
metSM_00000[32] += " (2)";
|
|
|
|
|
metSM_00000[102] += " (2)";
|
2018-05-19 04:35:57 +00:00
|
|
|
|
|
|
|
|
|
metSM_30000[0] += $" ({NPC})"; // Anything from an NPC
|
2018-09-02 02:55:08 +00:00
|
|
|
|
metSM_30000[1] += $" ({EggName})"; // Egg From Link Trade
|
2018-05-19 04:35:57 +00:00
|
|
|
|
for (int i = 2; i <= 5; i++) // distinguish first set of regions (unused) from second (used)
|
|
|
|
|
metSM_30000[i] += " (-)";
|
2019-07-09 05:05:59 +00:00
|
|
|
|
|
|
|
|
|
for (int i = 58; i < 65; i++) // distinguish Event year duplicates
|
|
|
|
|
metSM_40000[i] += " (-)";
|
|
|
|
|
|
|
|
|
|
for (int i = 47; i < 54; i++) // distinguish Event year duplicates
|
|
|
|
|
metGG_40000[i] += " (-)";
|
2018-05-19 04:35:57 +00:00
|
|
|
|
}
|
|
|
|
|
|
2019-11-16 01:34:18 +00:00
|
|
|
|
private void SanitizeMetG8SWSH()
|
|
|
|
|
{
|
2021-01-09 03:26:20 +00:00
|
|
|
|
// SW/SH duplicates -- elaborate!
|
|
|
|
|
for (int i = 88; i < metSWSH_00000.Length; i += 2)
|
2019-11-16 01:34:18 +00:00
|
|
|
|
{
|
|
|
|
|
var nextLoc = metSWSH_00000[i + 1];
|
2021-01-09 03:26:20 +00:00
|
|
|
|
if (nextLoc.Length == 0)
|
|
|
|
|
continue;
|
|
|
|
|
metSWSH_00000[i + 1] = string.Empty;
|
|
|
|
|
metSWSH_00000[i] += $" ({nextLoc})";
|
2019-11-16 01:34:18 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
metSWSH_30000[0] += $" ({NPC})"; // Anything from an NPC
|
|
|
|
|
metSWSH_30000[1] += $" ({EggName})"; // Egg From Link Trade
|
|
|
|
|
for (int i = 2; i <= 5; i++) // distinguish first set of regions (unused) from second (used)
|
|
|
|
|
metSWSH_30000[i] += " (-)";
|
|
|
|
|
metSWSH_30000[18] += " (?)"; // Kanto for the third time
|
|
|
|
|
|
|
|
|
|
for (int i = 54; i < 60; i++) // distinguish Event year duplicates
|
|
|
|
|
metSWSH_40000[i] += " (-)";
|
|
|
|
|
metSWSH_40000[29] += " (-)"; // a Video game Event (in spanish etc) -- duplicate with line 39
|
|
|
|
|
metSWSH_40000[52] += " (-)"; // a Pokémon event -- duplicate with line 37
|
2020-03-14 21:22:45 +00:00
|
|
|
|
|
2020-03-16 19:05:33 +00:00
|
|
|
|
metSWSH_40000[80] += " (-)"; // Pokémon GO -- duplicate with 30000's entry
|
|
|
|
|
metSWSH_40000[85] += " (-)"; // Pokémon HOME -- duplicate with 30000's entry
|
|
|
|
|
// metSWSH_30000[11] += " (-)"; // Pokémon GO -- duplicate with 40000's entry
|
|
|
|
|
// metSWSH_30000[17] += " (-)"; // Pokémon HOME -- duplicate with 40000's entry
|
2019-11-16 01:34:18 +00:00
|
|
|
|
}
|
|
|
|
|
|
2021-05-07 06:26:38 +00:00
|
|
|
|
public string[] GetItemStrings(int generation, GameVersion game = GameVersion.Any) => generation switch
|
2018-05-19 04:35:57 +00:00
|
|
|
|
{
|
2021-05-07 06:26:38 +00:00
|
|
|
|
0 => Array.Empty<string>(),
|
|
|
|
|
1 => g1items,
|
|
|
|
|
2 => g2items,
|
|
|
|
|
3 => GetItemStrings3(game),
|
|
|
|
|
4 => g4items, // mail names changed 4->5
|
2021-08-20 20:49:20 +00:00
|
|
|
|
_ => itemlist,
|
2021-05-07 06:26:38 +00:00
|
|
|
|
};
|
2018-08-03 03:11:42 +00:00
|
|
|
|
|
2018-05-19 04:35:57 +00:00
|
|
|
|
private string[] GetItemStrings3(GameVersion game)
|
|
|
|
|
{
|
|
|
|
|
switch (game)
|
|
|
|
|
{
|
|
|
|
|
case GameVersion.COLO:
|
|
|
|
|
return g3coloitems;
|
|
|
|
|
case GameVersion.XD:
|
|
|
|
|
return g3xditems;
|
|
|
|
|
default:
|
2020-07-19 03:51:55 +00:00
|
|
|
|
if (EReaderBerrySettings.IsEnigma)
|
2018-05-19 04:35:57 +00:00
|
|
|
|
return g3items;
|
|
|
|
|
|
2020-06-17 02:46:22 +00:00
|
|
|
|
var g3ItemsWithEBerry = (string[])g3items.Clone();
|
2020-07-19 03:51:55 +00:00
|
|
|
|
g3ItemsWithEBerry[175] = EReaderBerrySettings.DisplayName;
|
2020-06-17 02:46:22 +00:00
|
|
|
|
return g3ItemsWithEBerry;
|
2018-05-19 04:35:57 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2019-06-22 17:50:32 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the location name for the specified parameters.
|
|
|
|
|
/// </summary>
|
2020-06-17 02:46:22 +00:00
|
|
|
|
/// <param name="isEggLocation">Location is from the <see cref="PKM.Egg_Location"/></param>
|
|
|
|
|
/// <param name="location">Location value</param>
|
2019-06-22 17:50:32 +00:00
|
|
|
|
/// <param name="format">Current <see cref="PKM.Format"/></param>
|
2020-12-11 04:42:30 +00:00
|
|
|
|
/// <param name="generation"><see cref="PKM.Generation"/> of origin</param>
|
2020-08-07 01:24:20 +00:00
|
|
|
|
/// <param name="version">Current GameVersion (only applicable for <see cref="GameVersion.Gen7b"/> differentiation)</param>
|
2021-01-08 21:59:18 +00:00
|
|
|
|
/// <returns>Location name. May be an empty string if no location name is known for that location value.</returns>
|
2020-06-17 02:46:22 +00:00
|
|
|
|
public string GetLocationName(bool isEggLocation, int location, int format, int generation, GameVersion version)
|
2018-06-30 16:59:48 +00:00
|
|
|
|
{
|
2019-06-22 17:50:32 +00:00
|
|
|
|
int gen = -1;
|
|
|
|
|
int bankID = 0;
|
2018-06-30 16:59:48 +00:00
|
|
|
|
|
2021-01-08 21:59:18 +00:00
|
|
|
|
if (format == 1)
|
|
|
|
|
{
|
|
|
|
|
if (location == 0)
|
|
|
|
|
return string.Empty;
|
|
|
|
|
format = 3; // Legality binaries have Location IDs that were manually remapped to Gen3 location IDs.
|
|
|
|
|
}
|
|
|
|
|
|
2019-06-22 17:50:32 +00:00
|
|
|
|
if (format == 2)
|
2018-05-19 04:35:57 +00:00
|
|
|
|
{
|
2019-06-22 17:50:32 +00:00
|
|
|
|
gen = 2;
|
2018-05-19 04:35:57 +00:00
|
|
|
|
}
|
2019-06-22 17:50:32 +00:00
|
|
|
|
else if (format == 3)
|
2018-05-19 04:35:57 +00:00
|
|
|
|
{
|
2019-06-22 17:50:32 +00:00
|
|
|
|
gen = 3;
|
2018-05-19 04:35:57 +00:00
|
|
|
|
}
|
2020-06-17 02:46:22 +00:00
|
|
|
|
else if (generation == 4 && (isEggLocation || format == 4)) // 4
|
2018-05-19 04:35:57 +00:00
|
|
|
|
{
|
2019-06-22 17:50:32 +00:00
|
|
|
|
const int size = 1000;
|
2020-06-17 02:46:22 +00:00
|
|
|
|
bankID = location / size;
|
2019-06-22 17:50:32 +00:00
|
|
|
|
gen = 4;
|
2020-06-17 02:46:22 +00:00
|
|
|
|
location %= size;
|
2018-05-19 04:35:57 +00:00
|
|
|
|
}
|
2019-06-22 17:50:32 +00:00
|
|
|
|
else // 5-7+
|
2018-05-19 04:35:57 +00:00
|
|
|
|
{
|
2019-06-22 17:50:32 +00:00
|
|
|
|
const int size = 10000;
|
2020-06-17 02:46:22 +00:00
|
|
|
|
bankID = location / size;
|
2019-06-22 17:50:32 +00:00
|
|
|
|
|
|
|
|
|
int g = generation;
|
|
|
|
|
if (g >= 5)
|
|
|
|
|
gen = g;
|
|
|
|
|
else if (format >= 5)
|
|
|
|
|
gen = format;
|
|
|
|
|
|
2020-06-17 02:46:22 +00:00
|
|
|
|
location %= size;
|
2019-06-22 17:50:32 +00:00
|
|
|
|
if (bankID >= 3) // 30000 and onwards don't use 0th index, shift down 1
|
2020-06-17 02:46:22 +00:00
|
|
|
|
location--;
|
2018-05-19 04:35:57 +00:00
|
|
|
|
}
|
2018-05-19 15:30:36 +00:00
|
|
|
|
|
2021-01-08 21:59:18 +00:00
|
|
|
|
var bank = GetLocationNames(gen, version, bankID);
|
2021-01-09 03:26:20 +00:00
|
|
|
|
if ((uint)location >= bank.Count)
|
2019-06-22 17:50:32 +00:00
|
|
|
|
return string.Empty;
|
2020-06-17 02:46:22 +00:00
|
|
|
|
return bank[location];
|
2018-05-19 04:35:57 +00:00
|
|
|
|
}
|
2018-08-03 03:11:42 +00:00
|
|
|
|
|
2019-02-15 08:50:23 +00:00
|
|
|
|
/// <summary>
|
2019-06-22 17:50:32 +00:00
|
|
|
|
/// Gets the location names array for a specified generation.
|
2019-02-15 08:50:23 +00:00
|
|
|
|
/// </summary>
|
2019-06-22 17:50:32 +00:00
|
|
|
|
/// <param name="gen">Generation to get location names for.</param>
|
|
|
|
|
/// <param name="version">Version of origin</param>
|
2021-01-08 21:59:18 +00:00
|
|
|
|
/// <param name="bankID">BankID used to choose the text bank.</param>
|
2019-06-22 17:50:32 +00:00
|
|
|
|
/// <returns>List of location names.</returns>
|
2021-01-08 21:59:18 +00:00
|
|
|
|
public IReadOnlyList<string> GetLocationNames(int gen, GameVersion version, int bankID = 0) => gen switch
|
2018-05-19 04:35:57 +00:00
|
|
|
|
{
|
2021-01-02 01:08:49 +00:00
|
|
|
|
2 => metGSC_00000,
|
|
|
|
|
3 => GameVersion.CXD.Contains(version) ? metCXD_00000 : metRSEFRLG_00000,
|
|
|
|
|
4 => GetLocationNames4(bankID),
|
|
|
|
|
5 => GetLocationNames5(bankID),
|
|
|
|
|
6 => GetLocationNames6(bankID),
|
|
|
|
|
7 => GameVersion.Gen7b.Contains(version) ? GetLocationNames7GG(bankID) : GetLocationNames7(bankID),
|
|
|
|
|
8 => GetLocationNames8(bankID),
|
2021-08-20 20:49:20 +00:00
|
|
|
|
_ => Array.Empty<string>(),
|
2021-01-02 01:08:49 +00:00
|
|
|
|
};
|
2019-02-15 08:50:23 +00:00
|
|
|
|
|
2021-01-02 01:08:49 +00:00
|
|
|
|
private IReadOnlyList<string> GetLocationNames4(int bankID) => bankID switch
|
2019-02-15 08:50:23 +00:00
|
|
|
|
{
|
2021-01-02 01:08:49 +00:00
|
|
|
|
0 => metHGSS_00000,
|
|
|
|
|
2 => metHGSS_02000,
|
|
|
|
|
3 => metHGSS_03000,
|
2021-08-20 20:49:20 +00:00
|
|
|
|
_ => Array.Empty<string>(),
|
2021-01-02 01:08:49 +00:00
|
|
|
|
};
|
2018-05-19 04:35:57 +00:00
|
|
|
|
|
2021-01-02 01:08:49 +00:00
|
|
|
|
public IReadOnlyList<string> GetLocationNames5(int bankID) => bankID switch
|
2019-06-22 17:50:32 +00:00
|
|
|
|
{
|
2021-01-02 01:08:49 +00:00
|
|
|
|
0 => metBW2_00000,
|
|
|
|
|
3 => metBW2_30000,
|
|
|
|
|
4 => metBW2_40000,
|
|
|
|
|
6 => metBW2_60000,
|
2021-08-20 20:49:20 +00:00
|
|
|
|
_ => Array.Empty<string>(),
|
2021-01-02 01:08:49 +00:00
|
|
|
|
};
|
2018-05-19 04:35:57 +00:00
|
|
|
|
|
2021-01-02 01:08:49 +00:00
|
|
|
|
public IReadOnlyList<string> GetLocationNames6(int bankID) => bankID switch
|
2019-06-22 17:50:32 +00:00
|
|
|
|
{
|
2021-01-02 01:08:49 +00:00
|
|
|
|
0 => metXY_00000,
|
|
|
|
|
3 => metXY_30000,
|
|
|
|
|
4 => metXY_40000,
|
|
|
|
|
6 => metXY_60000,
|
2021-08-20 20:49:20 +00:00
|
|
|
|
_ => Array.Empty<string>(),
|
2021-01-02 01:08:49 +00:00
|
|
|
|
};
|
2018-07-07 00:37:07 +00:00
|
|
|
|
|
2021-01-02 01:08:49 +00:00
|
|
|
|
public IReadOnlyList<string> GetLocationNames7(int bankID) => bankID switch
|
2018-07-07 00:37:07 +00:00
|
|
|
|
{
|
2021-01-02 01:08:49 +00:00
|
|
|
|
0 => metSM_00000,
|
|
|
|
|
3 => metSM_30000,
|
|
|
|
|
4 => metSM_40000,
|
|
|
|
|
6 => metSM_60000,
|
2021-08-20 20:49:20 +00:00
|
|
|
|
_ => Array.Empty<string>(),
|
2021-01-02 01:08:49 +00:00
|
|
|
|
};
|
2018-07-07 00:37:07 +00:00
|
|
|
|
|
2021-01-02 01:08:49 +00:00
|
|
|
|
public IReadOnlyList<string> GetLocationNames7GG(int bankID) => bankID switch
|
2018-07-07 00:37:07 +00:00
|
|
|
|
{
|
2021-01-02 01:08:49 +00:00
|
|
|
|
0 => metGG_00000,
|
|
|
|
|
3 => metGG_30000,
|
|
|
|
|
4 => metGG_40000,
|
|
|
|
|
6 => metGG_60000,
|
2021-08-20 20:49:20 +00:00
|
|
|
|
_ => Array.Empty<string>(),
|
2021-01-02 01:08:49 +00:00
|
|
|
|
};
|
2019-09-23 23:56:47 +00:00
|
|
|
|
|
2021-01-02 01:08:49 +00:00
|
|
|
|
public IReadOnlyList<string> GetLocationNames8(int bankID) => bankID switch
|
2019-09-23 23:56:47 +00:00
|
|
|
|
{
|
2021-01-02 01:08:49 +00:00
|
|
|
|
0 => metSWSH_00000,
|
|
|
|
|
3 => metSWSH_30000,
|
|
|
|
|
4 => metSWSH_40000,
|
|
|
|
|
6 => metSWSH_60000,
|
2021-08-20 20:49:20 +00:00
|
|
|
|
_ => Array.Empty<string>(),
|
2021-01-02 01:08:49 +00:00
|
|
|
|
};
|
2018-05-19 04:35:57 +00:00
|
|
|
|
}
|
2020-03-16 19:05:33 +00:00
|
|
|
|
}
|