mirror of
https://github.com/kwsch/PKHeX
synced 2024-11-24 04:53:08 +00:00
handle hgss volty pikachu trade lang swap
en<->fr not sure what FR has for the pikachu language (is it EN? if so the code here works fine); if not, the OT should be checked for lang detection.
This commit is contained in:
parent
daa49a23a2
commit
1e0bf7b6ea
1 changed files with 7 additions and 2 deletions
|
@ -355,7 +355,12 @@ namespace PKHeX.Core
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (pkm.HGSS)
|
if (pkm.HGSS)
|
||||||
VerifyTradeTable(Encounters4.TradeHGSS, Encounters4.TradeGift_HGSS);
|
{
|
||||||
|
int lang = pkm.Language;
|
||||||
|
if (EncounterMatch.Species == 25 && (lang == 2 || lang == 3)) // EN & FR
|
||||||
|
lang ^= 1; // toggle for Volty
|
||||||
|
VerifyTradeTable(Encounters4.TradeHGSS, Encounters4.TradeGift_HGSS, lang);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (EncounterMatch.Species == 129) // Magikarp
|
if (EncounterMatch.Species == 129) // Magikarp
|
||||||
|
@ -403,7 +408,7 @@ namespace PKHeX.Core
|
||||||
private void VerifyTradeTable(string[][] ots, EncounterTrade[] table) => VerifyTradeTable(ots, table, pkm.Language);
|
private void VerifyTradeTable(string[][] ots, EncounterTrade[] table) => VerifyTradeTable(ots, table, pkm.Language);
|
||||||
private void VerifyTradeTable(string[][] ots, EncounterTrade[] table, int language)
|
private void VerifyTradeTable(string[][] ots, EncounterTrade[] table, int language)
|
||||||
{
|
{
|
||||||
var validOT = language >= ots.Length ? ots[0] : ots[pkm.Language];
|
var validOT = language >= ots.Length ? ots[0] : ots[language];
|
||||||
var index = Array.IndexOf(table, EncounterMatch);
|
var index = Array.IndexOf(table, EncounterMatch);
|
||||||
VerifyTradeOTNick(validOT, index);
|
VerifyTradeOTNick(validOT, index);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue