2022-08-16 04:04:30 +00:00
|
|
|
using static PKHeX.Core.RibbonIndex;
|
|
|
|
|
|
|
|
namespace PKHeX.Core;
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Parsing logic for <see cref="IRibbonSetEvent3"/>.
|
|
|
|
/// </summary>
|
|
|
|
public static class RibbonVerifierEvent3
|
|
|
|
{
|
|
|
|
public static void Parse(this IRibbonSetEvent3 r, RibbonVerifierArguments args, ref RibbonResultList list)
|
|
|
|
{
|
|
|
|
var enc = args.Encounter;
|
|
|
|
if (enc is IRibbonSetEvent3 e)
|
|
|
|
{
|
|
|
|
// The Earth Ribbon is a ribbon exclusive to Pokémon Colosseum and Pokémon XD: Gale of Darkness
|
|
|
|
// Awarded to all Pokémon on the player's team when they complete the Mt. Battle challenge without switching the team at any point.
|
|
|
|
if (e.RibbonEarth)
|
|
|
|
{
|
|
|
|
if (!r.RibbonEarth)
|
2022-08-18 06:47:15 +00:00
|
|
|
list.Add(Earth, true);
|
2022-08-16 04:04:30 +00:00
|
|
|
}
|
|
|
|
else if (r.RibbonEarth && enc.Generation != 3)
|
|
|
|
{
|
|
|
|
list.Add(Earth);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (r.RibbonNational != e.RibbonNational)
|
2022-08-18 06:47:15 +00:00
|
|
|
list.Add(National, e.RibbonNational);
|
2022-08-16 04:04:30 +00:00
|
|
|
if (r.RibbonCountry != e.RibbonCountry)
|
2022-08-18 06:47:15 +00:00
|
|
|
list.Add(Country, e.RibbonCountry);
|
2022-08-16 04:04:30 +00:00
|
|
|
if (r.RibbonChampionBattle != e.RibbonChampionBattle)
|
2022-08-18 06:47:15 +00:00
|
|
|
list.Add(ChampionBattle, e.RibbonChampionBattle);
|
2022-08-16 04:04:30 +00:00
|
|
|
if (r.RibbonChampionRegional != e.RibbonChampionRegional)
|
2022-08-18 06:47:15 +00:00
|
|
|
list.Add(ChampionRegional, e.RibbonChampionRegional);
|
2022-08-16 04:04:30 +00:00
|
|
|
if (r.RibbonChampionNational != e.RibbonChampionNational)
|
2022-08-18 06:47:15 +00:00
|
|
|
list.Add(ChampionNational, e.RibbonChampionNational);
|
2022-08-16 04:04:30 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
// The Earth Ribbon is a ribbon exclusive to Pokémon Colosseum and Pokémon XD: Gale of Darkness
|
|
|
|
// Awarded to all Pokémon on the player's team when they complete the Mt. Battle challenge without switching the team at any point.
|
|
|
|
if (r.RibbonEarth && enc.Generation != 3)
|
|
|
|
list.Add(Earth);
|
|
|
|
|
|
|
|
if (r.RibbonNational != RibbonRules.GetValidRibbonStateNational(args.Entity, enc))
|
|
|
|
list.Add(National);
|
|
|
|
if (r.RibbonCountry)
|
|
|
|
list.Add(Country);
|
|
|
|
if (r.RibbonChampionBattle)
|
|
|
|
list.Add(ChampionBattle);
|
|
|
|
if (r.RibbonChampionRegional)
|
|
|
|
list.Add(ChampionRegional);
|
|
|
|
if (r.RibbonChampionNational)
|
|
|
|
list.Add(ChampionNational);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public static void ParseEgg(this IRibbonSetEvent3 r, ref RibbonResultList list)
|
|
|
|
{
|
|
|
|
if (r.RibbonEarth)
|
|
|
|
list.Add(Earth);
|
|
|
|
if (r.RibbonNational)
|
|
|
|
list.Add(National);
|
|
|
|
if (r.RibbonCountry)
|
|
|
|
list.Add(Country);
|
|
|
|
if (r.RibbonChampionBattle)
|
|
|
|
list.Add(ChampionBattle);
|
|
|
|
if (r.RibbonChampionRegional)
|
|
|
|
list.Add(ChampionRegional);
|
|
|
|
if (r.RibbonChampionNational)
|
|
|
|
list.Add(ChampionNational);
|
|
|
|
}
|
|
|
|
}
|