remove alias'd properties

This commit is contained in:
Kurt 2018-07-25 19:43:02 -07:00
parent 91f39d74db
commit f0fc4b0693
5 changed files with 15 additions and 21 deletions

View file

@ -33,12 +33,6 @@ namespace PKHeX.Core
public static string EReaderBerryDisplayName => string.Format(V372, Util.ToTitleCase(EReaderBerryName.ToLower()));
public static ITrainerInfo ActiveTrainer = new SimpleTrainerInfo {OT = string.Empty, Game = (int)GameVersion.Any, Language = -1};
public static int SavegameLanguage => ActiveTrainer.Language;
private static string Savegame_OT => ActiveTrainer.OT;
private static int Savegame_TID => ActiveTrainer.TID;
private static int Savegame_SID => ActiveTrainer.SID;
private static int Savegame_Gender => ActiveTrainer.Gender;
private static GameVersion Savegame_Version => (GameVersion)ActiveTrainer.Game;
// Gen 1
internal static readonly Learnset[] LevelUpRB = Learnset1.GetArray(Util.GetBinaryResource("lvlmove_rb.pkl"), MaxSpeciesID_1);
@ -1222,9 +1216,9 @@ namespace PKHeX.Core
return false;
if (pk1.TradebackStatus == TradebackType.WasTradeback)
return true;
if (Savegame_Version == GameVersion.Any)
if (ActiveTrainer.Game == (int)GameVersion.Any)
return false;
var IsYellow = Savegame_Version == GameVersion.YW;
var IsYellow = ActiveTrainer.Game == (int)GameVersion.YW;
if (pk1.TradebackStatus == TradebackType.Gen1_NotTradeback)
{
// If catch rate is Abra catch rate it wont trigger as invalid trade without evolution, it could be traded as Abra
@ -1246,17 +1240,17 @@ namespace PKHeX.Core
return false;
}
internal static bool IsOutsider(PKM pkm)
internal static bool IsNotFromActiveTrainer(PKM pkm)
{
if (Savegame_Version == GameVersion.Any)
if (ActiveTrainer.Game == (int)GameVersion.Any)
return false;
var Outsider = Savegame_TID != pkm.TID || Savegame_OT != pkm.OT_Name;
var Outsider = ActiveTrainer.TID != pkm.TID || ActiveTrainer.OT != pkm.OT_Name;
if (pkm.Format <= 2)
return Outsider;
Outsider |= Savegame_SID != pkm.SID;
if (pkm.Format == 3) // Generation 3 does not check ot geneder nor pokemon version
Outsider |= ActiveTrainer.SID != pkm.SID;
if (pkm.Format == 3) // Generation 3 does not check ot gender nor pokemon version
return Outsider;
Outsider |= Savegame_Gender != pkm.OT_Gender || Savegame_Version != (GameVersion)pkm.Version;
Outsider |= ActiveTrainer.Gender != pkm.OT_Gender || ActiveTrainer.Game != pkm.Version;
return Outsider;
}

View file

@ -32,9 +32,9 @@ namespace PKHeX.Core
var matchJP = Legal.EReaderBerriesNames_JP.Contains(Legal.EReaderBerryName);
if (!matchJP && !matchUSA) // Does not match any released E-Reader berry
data.AddLine(GetInvalid(V369));
else if (matchJP && !Legal.SavegameJapanese && Legal.SavegameLanguage >= 0) // E-Reader is region locked
else if (matchJP && !Legal.SavegameJapanese && Legal.ActiveTrainer.Language >= 0) // E-Reader is region locked
data.AddLine(GetInvalid(V370));
else if (matchUSA && Legal.SavegameJapanese && Legal.SavegameLanguage >= 0) // E-Reader is region locked
else if (matchUSA && Legal.SavegameJapanese && Legal.ActiveTrainer.Language >= 0) // E-Reader is region locked
data.AddLine(GetInvalid(V371));
}
}

View file

@ -60,12 +60,12 @@ namespace PKHeX.Core
/// <returns></returns>
public static bool IsValidG4Korean(int currentLanguage)
{
bool savKOR = Legal.SavegameLanguage == (int) LanguageID.Korean;
bool savKOR = Legal.ActiveTrainer.Language == (int) LanguageID.Korean;
bool pkmKOR = currentLanguage == (int) LanguageID.Korean;
if (savKOR == pkmKOR)
return true;
return Legal.SavegameLanguage < 0; // check not overriden by Legality settings
return Legal.ActiveTrainer.Language < 0; // check not overriden by Legality settings
}
}
}

View file

@ -76,7 +76,7 @@ namespace PKHeX.Core
private void VerifyG1TradeEvo(LegalityAnalysis data)
{
var pkm = data.pkm;
var mustevolve = pkm.TradebackStatus == TradebackType.WasTradeback || (pkm.Format == 1 && Legal.IsOutsider(pkm)) || Legal.IsTradedKadabraG1(pkm);
var mustevolve = pkm.TradebackStatus == TradebackType.WasTradeback || (pkm.Format == 1 && Legal.IsNotFromActiveTrainer(pkm)) || Legal.IsTradedKadabraG1(pkm);
if (!mustevolve)
return;
// Pokemon have been traded but it is not evolved, trade evos are sequential dex numbers

View file

@ -217,7 +217,7 @@ namespace PKHeX.Core
{
lang = DetectTradeLanguageG4SurgePikachu(pkm, lang);
// flag korean magikarp on gen4 saves since the pkm.Language is German
if (pkm.Format == 4 && lang == (int)LanguageID.Korean && Legal.SavegameLanguage != (int)LanguageID.Korean && Legal.SavegameLanguage >= 0)
if (pkm.Format == 4 && lang == (int)LanguageID.Korean && Legal.ActiveTrainer.Language != (int)LanguageID.Korean && Legal.ActiveTrainer.Language >= 0)
data.AddLine(GetInvalid(string.Format(V610, V611, V612), CheckIdentifier.Language));
}
VerifyTradeTable(data, Encounters4.TradeHGSS, Encounters4.TradeGift_HGSS, lang);
@ -229,7 +229,7 @@ namespace PKHeX.Core
{
lang = DetectTradeLanguageG4MeisterMagikarp(pkm, lang);
// flag korean magikarp on gen4 saves since the pkm.Language is German
if (pkm.Format == 4 && lang == (int)LanguageID.Korean && Legal.SavegameLanguage != (int)LanguageID.Korean && Legal.SavegameLanguage >= 0)
if (pkm.Format == 4 && lang == (int)LanguageID.Korean && Legal.ActiveTrainer.Language != (int)LanguageID.Korean && Legal.ActiveTrainer.Language >= 0)
data.AddLine(GetInvalid(string.Format(V610, V611, V612), CheckIdentifier.Language));
}
else if (!pkm.Pt && lang == 1) // DP English origin are Japanese lang