From 4deb5080d18628330523b8f561ac9a04dc673504 Mon Sep 17 00:00:00 2001 From: Kurt Date: Sat, 6 Oct 2018 18:45:15 -0700 Subject: [PATCH] Misc tweaks rearrange getmove with respect to tutors; verifycurrentmoves was getting tutor moves in levelup extract not-found hint fetch Expose gen5 block objects (so I can play with saves in linqpad) --- PKHeX.Core/Legality/Core.cs | 4 ++-- .../Encounters/Generator/EncounterFinder.cs | 22 ++++++++++--------- PKHeX.Core/Saves/SAV5.cs | 2 +- 3 files changed, 15 insertions(+), 13 deletions(-) diff --git a/PKHeX.Core/Legality/Core.cs b/PKHeX.Core/Legality/Core.cs index 9301704db..63f124ea5 100644 --- a/PKHeX.Core/Legality/Core.cs +++ b/PKHeX.Core/Legality/Core.cs @@ -1015,7 +1015,7 @@ namespace PKHeX.Core formcount = 4; for (int i = 0; i < formcount; i++) - r.AddRange(GetMoves(pkm, species, minLvLG1, minLvLG2, vs[0].Level, i, moveTutor, Version, LVL, Tutor, Machine, MoveReminder, RemoveTransferHM, Generation)); + r.AddRange(GetMoves(pkm, species, minLvLG1, minLvLG2, vs[0].Level, i, Tutor, Version, LVL, Tutor, Machine, MoveReminder, RemoveTransferHM, Generation)); if (Relearn) r.AddRange(pkm.RelearnMoves); return r.Distinct(); @@ -1047,7 +1047,7 @@ namespace PKHeX.Core var maxLevel = evo.Level; if (i != 0 && vs[i - 1].RequiresLvlUp) // evolution ++maxLevel; // allow lvlmoves from the level it evolved to the next species - return GetMoves(pkm, evo.Species, minlvlevo1, minlvlevo2, maxLevel, pkm.AltForm, moveTutor, Version, LVL, Tutor, Machine, MoveReminder, RemoveTransferHM, Generation); + return GetMoves(pkm, evo.Species, minlvlevo1, minlvlevo2, maxLevel, pkm.AltForm, Tutor, Version, LVL, moveTutor, Machine, MoveReminder, RemoveTransferHM, Generation); } private static int GetEvoMoveMinLevel1(PKM pkm, int Generation, int minLvLG1, EvoCriteria evo) diff --git a/PKHeX.Core/Legality/Encounters/Generator/EncounterFinder.cs b/PKHeX.Core/Legality/Encounters/Generator/EncounterFinder.cs index cbed4a794..0393d3548 100644 --- a/PKHeX.Core/Legality/Encounters/Generator/EncounterFinder.cs +++ b/PKHeX.Core/Legality/Encounters/Generator/EncounterFinder.cs @@ -102,21 +102,23 @@ namespace PKHeX.Core private static LegalInfo VerifyWithoutEncounter(PKM pkm, LegalInfo info) { info.EncounterMatch = new EncounterInvalid(pkm); - - string hint; // hint why an encounter was not found - if (pkm.WasGiftEgg) - hint = LEncGift; - else if (pkm.WasEventEgg) - hint = LEncGiftEggEvent; - else if (pkm.WasEvent) - hint = LEncGiftNotFound; - else - hint = LEncInvalid; + string hint = GetHintWhyNotFound(pkm); info.Parse.Add(new CheckResult(Severity.Invalid, hint, CheckIdentifier.Encounter)); info.Relearn = VerifyRelearnMoves.VerifyRelearn(pkm, info); info.Moves = VerifyCurrentMoves.VerifyMoves(pkm, info); return info; } + + private static string GetHintWhyNotFound(PKM pkm) + { + if (pkm.WasGiftEgg) + return LEncGift; + if (pkm.WasEventEgg) + return LEncGiftEggEvent; + if (pkm.WasEvent) + return LEncGiftNotFound; + return LEncInvalid; + } } } diff --git a/PKHeX.Core/Saves/SAV5.cs b/PKHeX.Core/Saves/SAV5.cs index 1c9ffe12d..b5e709421 100644 --- a/PKHeX.Core/Saves/SAV5.cs +++ b/PKHeX.Core/Saves/SAV5.cs @@ -127,7 +127,7 @@ namespace PKHeX.Core public override int MaxGameID => Legal.MaxGameID_5; // B2 // Blocks & Offsets - private readonly BlockInfoNDS[] Blocks; + public readonly BlockInfoNDS[] Blocks; protected override void SetChecksums() => Blocks.SetChecksums(Data); public override bool ChecksumsValid => Blocks.GetChecksumsValid(Data); public override string ChecksumInfo => Blocks.GetChecksumInfo(Data);