private void VerifyHTMemoryNone(LegalityAnalysis data, ITrainerMemories pkm) { if (pkm.HT_Memory != 0 || pkm.HT_TextVar != 0 || pkm.HT_Intensity != 0 || pkm.HT_Feeling != 0) { data.AddLine(GetInvalid(string.Format(LMemoryCleared, L_XHT))); } }
public static MemoryVariableSet Read(ITrainerMemories pkm, int handler) { return(handler switch { 0 => new MemoryVariableSet(LegalityCheckStrings.L_XOT, pkm.OT_Memory, pkm.OT_TextVar, pkm.OT_Intensity, pkm.OT_Feeling), // OT 1 => new MemoryVariableSet(LegalityCheckStrings.L_XOT, pkm.HT_Memory, pkm.HT_TextVar, pkm.HT_Intensity, pkm.HT_Feeling), // HT _ => new MemoryVariableSet(LegalityCheckStrings.L_XOT, 0, 0, 0, 0) });
/// <summary> /// Truly code to personalize <see cref="PKM"/> /// </summary> /// <param name="pkm">Pokemon to be personalized</param> /// <param name="gameVersion">Current Game Version</param> /// <returns></returns> private static PKM PersonalizePokemon(PKM pkm, GameVersion gameVersion) { bool isLimited = isLimitedPokemon(pkm, gameVersion); if (!isLimited) { // Change the original version to game version pkm.Version = (int)gameVersion != 56 ? (int)gameVersion : (int)gameVersion; // change version => change met data if (pkm.Format >= 3) { Legalizer.SetMetValid(pkm); } } Personalize(pkm, isLimited); int format = pkm.Format; if (format == 6 || format == 7 || format == 8) { // Check if it is a pokemon that evolves to link trade if (!LinkTradeEvo.GetLinkTradeEvoPkmList.Contains(pkm.Species) && !isLimited) { pkm.ClearCurrentHandler(); if (pkm is IGeoTrack g) { // to be modified g.Geo1_Country = 0; g.Geo1_Region = 0; g.Geo2_Country = 0; g.Geo2_Region = 0; g.Geo3_Country = 0; g.Geo3_Region = 0; g.Geo4_Country = 0; g.Geo4_Region = 0; g.Geo5_Country = 0; g.Geo5_Region = 0; } ITrainerMemories trainerMemories = (ITrainerMemories)pkm; Extensions.ClearMemoriesHT(trainerMemories); } } return(pkm); }
public static void SetTradeMemory(this ITrainerMemories m, bool bank) { m.SetTradeMemoryHT(bank); }