From b31f0428cf0069d8e70115c26cf92e49ecdb6d44 Mon Sep 17 00:00:00 2001 From: Kurt Date: Sun, 2 Feb 2020 10:21:34 -0800 Subject: [PATCH] Add raidtype docs & wishing piece indication --- .../Substructures/Gen8/RaidSpawnList8.cs | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/PKHeX.Core/Saves/Substructures/Gen8/RaidSpawnList8.cs b/PKHeX.Core/Saves/Substructures/Gen8/RaidSpawnList8.cs index becee61e6..bd81edc45 100644 --- a/PKHeX.Core/Saves/Substructures/Gen8/RaidSpawnList8.cs +++ b/PKHeX.Core/Saves/Substructures/Gen8/RaidSpawnList8.cs @@ -108,11 +108,18 @@ namespace PKHeX.Core set => DenType = 2; // set the 1th bit; the 2th bit has a similar-unknown function (?) } + [Category(Derived), Description("Wishing Piece was used for Raid encounter.")] + public bool IsWishingPiece + { + get => IsActive && ((Flags >> 0) & 1) == 1; + set => Flags = (byte)((Flags & ~1) | (value ? 1 : 0)); + } + [Category(Derived), Description("Distribution (event) details used for Raid encounter.")] public bool IsEvent { get => IsActive && ((Flags >> 1) & 1) == 1; - set => Flags = (byte)((Flags & 2) | (value ? 2 : 0)); + set => Flags = (byte)((Flags & ~2) | (value ? 2 : 0)); } public void Activate(byte star, byte rand, bool rare = false, bool isEvent = false) @@ -128,6 +135,16 @@ namespace PKHeX.Core // The games use a xoroshiro RNG to create the PKM from the stored seed. } + public enum RaidType : byte + { + None = 0, + Common = 1, + Rare = 2, + CommonWish = 3, + RareWish = 4, + Event = 5, + } + public class TypeConverterU64 : TypeConverter { public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType)