mirror of
https://github.com/kwsch/PKHeX.git
synced 2026-10-02 13:37:10 -05:00
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user