mirror of
https://github.com/kwsch/PKHeX
synced 2025-03-02 14:27:14 +00:00
Like move validation, evolutions are the earliest thing we wish to traverse when determining what encounters may have originated the current Pokémon. To determine the permitted species-form-levels a Pokémon could originate with, we must devolve a Pokémon by traveling down-generation to origin. Once we have an encounter, we can then evolve it to the current species, traversing upwards from origin to the current format.
31 lines
930 B
C#
31 lines
930 B
C#
using static PKHeX.Core.RibbonIndex;
|
|
|
|
namespace PKHeX.Core;
|
|
|
|
/// <summary>
|
|
/// Parsing logic for <see cref="IRibbonSetCommon3"/>.
|
|
/// </summary>
|
|
public static class RibbonVerifierCommon3
|
|
{
|
|
public static void Parse(this IRibbonSetCommon3 r, RibbonVerifierArguments args, ref RibbonResultList list)
|
|
{
|
|
var evos = args.History;
|
|
var pk = args.Entity;
|
|
if (r.RibbonChampionG3 && !evos.HasVisitedGen3)
|
|
list.Add(ChampionG3);
|
|
if (r.RibbonArtist && !evos.HasVisitedGen3)
|
|
list.Add(Artist);
|
|
if (r.RibbonEffort && !RibbonRules.IsRibbonValidEffort(evos))
|
|
list.Add(Effort);
|
|
}
|
|
|
|
public static void ParseEgg(this IRibbonSetCommon3 r, ref RibbonResultList list)
|
|
{
|
|
if (r.RibbonChampionG3)
|
|
list.Add(ChampionG3);
|
|
if (r.RibbonArtist)
|
|
list.Add(Artist);
|
|
if (r.RibbonEffort)
|
|
list.Add(Effort);
|
|
}
|
|
}
|