mirror of
https://github.com/kwsch/PKHeX.git
synced 2026-05-09 04:24:36 -05:00
Handle CXD egg encounters
There are none. But the detection routine for gen3 can assign cxd pkm as egg if no other possible encounter is matched, thus we'll flag if the failure case occurs. add missing spacing formatting, simplify break->return for egg game retrieval
This commit is contained in:
parent
a5cfaed574
commit
99b243b4fa
|
|
@ -1351,6 +1351,10 @@ private void verifyCXD()
|
|||
break; // todo
|
||||
}
|
||||
}
|
||||
else if (pkm.WasEgg) // can't obtain eggs in CXD
|
||||
{
|
||||
AddLine(Severity.Invalid, V80, CheckIdentifier.Encounter); // invalid encounter
|
||||
}
|
||||
}
|
||||
|
||||
private void verifyAbility()
|
||||
|
|
@ -2064,7 +2068,7 @@ private void verifyOTMemory()
|
|||
|
||||
if (pkm.GenNumber < 6)
|
||||
{
|
||||
verifyOTMemoryIs(new [] {0,0,0,0}); // empty
|
||||
verifyOTMemoryIs(new [] {0, 0, 0, 0}); // empty
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -2785,22 +2789,20 @@ private GameVersion[] getBaseMovesIsEggGames()
|
|||
{
|
||||
case 1:
|
||||
case 2:
|
||||
Games = new[] { GameVersion.GS, GameVersion.C };
|
||||
break;
|
||||
return new[] { GameVersion.GS, GameVersion.C };
|
||||
case 3:
|
||||
switch ((GameVersion)pkm.Version)
|
||||
{
|
||||
case GameVersion.R:
|
||||
case GameVersion.S:
|
||||
Games = new[] { GameVersion.RS};
|
||||
break;
|
||||
return new[] { GameVersion.RS };
|
||||
case GameVersion.E:
|
||||
Games = new[] { GameVersion.E };
|
||||
break;
|
||||
return new[] { GameVersion.E };
|
||||
case GameVersion.FR:
|
||||
case GameVersion.LG:
|
||||
Games = new[] { GameVersion.FRLG };
|
||||
break;
|
||||
return new[] { GameVersion.FRLG };
|
||||
case GameVersion.CXD:
|
||||
return new[] { GameVersion.CXD }; // will yield no moves
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
|
|
@ -2808,15 +2810,12 @@ private GameVersion[] getBaseMovesIsEggGames()
|
|||
{
|
||||
case GameVersion.D:
|
||||
case GameVersion.P:
|
||||
Games = new[] { GameVersion.DP };
|
||||
break;
|
||||
return new[] { GameVersion.DP };
|
||||
case GameVersion.Pt:
|
||||
Games = new[] { GameVersion.Pt };
|
||||
break;
|
||||
return new[] { GameVersion.Pt };
|
||||
case GameVersion.HG:
|
||||
case GameVersion.SS:
|
||||
Games = new[] { GameVersion.HGSS };
|
||||
break;
|
||||
return new[] { GameVersion.HGSS };
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
|
|
@ -2824,15 +2823,12 @@ private GameVersion[] getBaseMovesIsEggGames()
|
|||
{
|
||||
case GameVersion.B:
|
||||
case GameVersion.W:
|
||||
Games = new[] { GameVersion.BW };
|
||||
break;
|
||||
return new[] { GameVersion.BW };
|
||||
case GameVersion.Pt:
|
||||
Games = new[] { GameVersion.Pt };
|
||||
break;
|
||||
return new[] { GameVersion.Pt };
|
||||
case GameVersion.B2:
|
||||
case GameVersion.W2:
|
||||
Games = new[] { GameVersion.B2W2 };
|
||||
break;
|
||||
return new[] { GameVersion.B2W2 };
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
@ -2920,7 +2916,7 @@ private CheckResult[] parseMovesWasEggPreRelearn(int[] Moves, List<int>[] validL
|
|||
bool volt = (gen > 3 || ver == GameVersion.E) && Legal.LightBall.Contains(pkm.Species);
|
||||
var SpecialMoves = volt && EventEggMoves.Length == 0 ? new[] {344} : new int[0]; // Volt Tackle for bred Pichu line
|
||||
|
||||
res = parseMoves(Moves, validLevelMoves, new int[0], validTMHM, validTutor, SpecialMoves, LvlupEggMoves, EggMoves, ExclusiveIncenseMoves,EventEggMoves, new int[0], issplitbreed);
|
||||
res = parseMoves(Moves, validLevelMoves, new int[0], validTMHM, validTutor, SpecialMoves, LvlupEggMoves, EggMoves, ExclusiveIncenseMoves, EventEggMoves, new int[0], issplitbreed);
|
||||
|
||||
if (res.All(r => r.Valid)) // moves is satisfactory
|
||||
return res;
|
||||
|
|
@ -3064,7 +3060,7 @@ private CheckResult[] parseMoves(int[] moves, List<int>[] learn, int[] relearn,
|
|||
if (gen == 4 && pkm.Format > 4)
|
||||
{
|
||||
// Copy to array the hm found or else the list will be emptied when the legal status of moves changes in the current generation
|
||||
HMLearned = moves.Where((m,i) => !(res[i]?.Valid ?? false) && Legal.HM_4_RemovePokeTransfer.Any(l => l == m)).Select((m, i) => i).ToArray();
|
||||
HMLearned = moves.Where((m, i) => !(res[i]?.Valid ?? false) && Legal.HM_4_RemovePokeTransfer.Any(l => l == m)).Select((m, i) => i).ToArray();
|
||||
// Defog and Whirlpool at the same time, also both can't be learned in future generations or else they will be valid
|
||||
KnowDefogWhirlpool = moves.Where((m, i) => (m == 250 || m == 432) && !(res[i]?.Valid ?? false)).Count() == 2;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -586,7 +586,7 @@ private static EncounterArea[] getTables2(GameVersion Version)
|
|||
var h_g = EncounterArea.getArray2_H(Resources.encounter_gold_h);
|
||||
var h_s = EncounterArea.getArray2_H(Resources.encounter_silver_h);
|
||||
|
||||
Slots = addExtraTableSlots(g, s, h_g, h_s,f);
|
||||
Slots = addExtraTableSlots(g, s, h_g, h_s, f);
|
||||
}
|
||||
if (Version == GameVersion.C || Version == GameVersion.GSC)
|
||||
{
|
||||
|
|
@ -1276,7 +1276,7 @@ internal static IEnumerable<int> getValidPostEvolutionMoves(PKM pkm, int Species
|
|||
}
|
||||
return evomoves;
|
||||
}
|
||||
internal static List<int>[] getExclusivePreEvolutionMoves(PKM pkm, int Species,DexLevel[][] evoChains, GameVersion Version)
|
||||
internal static List<int>[] getExclusivePreEvolutionMoves(PKM pkm, int Species, DexLevel[][] evoChains, GameVersion Version)
|
||||
{
|
||||
// Return moves that the pokemon could only learn throught the preevolution Species
|
||||
List<int>[] Moves = new List<int>[evoChains.Length];
|
||||
|
|
@ -1311,8 +1311,8 @@ internal static List<int>[] getBaseEggMoves(PKM pkm, GameVersion gameSource, int
|
|||
if (getSplitBreedGeneration(pkm.GenNumber).Contains(pkm.Species))
|
||||
return new[]
|
||||
{
|
||||
getBaseEggMoves(pkm, 0, gameSource,lvl).ToList(),
|
||||
getBaseEggMoves(pkm, 1, gameSource,lvl).ToList(),
|
||||
getBaseEggMoves(pkm, 0, gameSource, lvl).ToList(),
|
||||
getBaseEggMoves(pkm, 1, gameSource, lvl).ToList(),
|
||||
};
|
||||
return new[] { getBaseEggMoves(pkm, 0, gameSource, lvl).ToList(), };
|
||||
}
|
||||
|
|
@ -2788,7 +2788,7 @@ internal static DexLevel[][] getEvolutionChainsAllGens(PKM pkm, object Encounter
|
|||
//Remove previous evolutions bellow transfer level
|
||||
//For example a gen3 charizar in format 7 with current level 36 and met level 36
|
||||
//chain level for charmander is 35, is bellow met level
|
||||
GensEvoChains[gen] = GensEvoChains[gen].Where(e => e.Level >= getMinLevelGeneration(pkm,gen)).ToArray();
|
||||
GensEvoChains[gen] = GensEvoChains[gen].Where(e => e.Level >= getMinLevelGeneration(pkm, gen)).ToArray();
|
||||
|
||||
if (gen == 1 && GensEvoChains[gen].LastOrDefault()?.Species > MaxSpeciesID_1)
|
||||
// Remove generation 2 pre-evolutions
|
||||
|
|
@ -3328,7 +3328,7 @@ private static IEnumerable<int> getMoves(PKM pkm, int species, int minlvlG1, int
|
|||
r.AddRange(getMoves(pkm, species, minlvlG1, lvl, form, moveTutor, Version, LVL, specialTutors, Machine, MoveReminder, RemoveTransferHM, gen));
|
||||
return r.Distinct();
|
||||
}
|
||||
private static IEnumerable<int> getMoves(PKM pkm, int species, int minlvlG1,int lvl, int form, bool moveTutor, GameVersion Version, bool LVL, bool specialTutors, bool Machine, bool MoveReminder, bool RemoveTransferHM, int Generation)
|
||||
private static IEnumerable<int> getMoves(PKM pkm, int species, int minlvlG1, int lvl, int form, bool moveTutor, GameVersion Version, bool LVL, bool specialTutors, bool Machine, bool MoveReminder, bool RemoveTransferHM, int Generation)
|
||||
{
|
||||
List<int> r = new List<int>();
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user