Add simple alolan evo trim for HOME+ permit

Closes #4159
This commit is contained in:
Kurt
2024-01-13 21:08:45 -08:00
parent 08104179b7
commit 00c0aefe00

View File

@@ -56,11 +56,22 @@ public int Devolve(Span<EvoCriteria> result, PKM pk, EvolutionOrigin enc)
public int Evolve(Span<EvoCriteria> result, PKM pk, EvolutionOrigin enc, EvolutionHistory history)
{
if (IsUnavailableEvoChain(pk.Species, pk.Form))
result = result[..1]; // Only allow the highest (current).
if (CheckAllAdjacent(pk, enc))
return EvolveMulti(result, pk, enc, history);
return EvolveSingle(result, pk, enc, history);
}
private static bool IsUnavailableEvoChain(ushort species, byte form) => species switch
{
// Split-evolution Alolans can't be reached in any game Gen8+. Must have been via Gen7.
(int)Species.Raichu when form == 1 => true,
(int)Species.Exeggutor when form == 1 => true,
(int)Species.Marowak when form == 1 => true,
_ => false,
};
private int DevolveMulti(Span<EvoCriteria> result, PKM pk, in EvolutionOrigin enc)
{
int present = 1;