From fda84ae9921afcae2c448249cbf382a774dcc803 Mon Sep 17 00:00:00 2001 From: Michael Scire Date: Thu, 5 Jan 2017 14:45:53 -0800 Subject: [PATCH] Better WC7 Card Flags + Descriptions --- PKHeX/MysteryGifts/WC7.cs | 10 +++++++++- PKHeX/Subforms/Save Editors/SAV_Wondercard.cs | 17 +++++++++++------ 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/PKHeX/MysteryGifts/WC7.cs b/PKHeX/MysteryGifts/WC7.cs index 75ab8b462..b21bc5762 100644 --- a/PKHeX/MysteryGifts/WC7.cs +++ b/PKHeX/MysteryGifts/WC7.cs @@ -79,7 +79,15 @@ namespace PKHeX public int CardLocation { get { return Data[0x50]; } set { Data[0x50] = (byte)value; } } public int CardType { get { return Data[0x51]; } set { Data[0x51] = (byte)value; } } - public override bool GiftUsed { get { return Data[0x52] >> 1 > 0; } set { Data[0x52] = (byte)(Data[0x52] & ~2 | (value ? 2 : 0)); } } + + public byte CardFlags { get { return Data[0x52]; } set { Data[0x52] = value; } } + + public bool GiftRepeatable { get { return (CardFlags & 1) == 0; } set { CardFlags = (byte)(CardFlags & ~1 | (value ? 0 : 1)); } } + + public override bool GiftUsed { get { return (CardFlags & 2) == 2; } set { CardFlags = (byte)(CardFlags & ~2 | (value ? 2 : 0)); } } + + public bool GiftOncePerDay { get { return (CardFlags & 4) == 4; } set { CardFlags = (byte)(CardFlags & ~4 | (value ? 4 : 0)); } } + public bool MultiObtain { get { return Data[0x53] == 1; } set { Data[0x53] = (byte)(value ? 1 : 0); } } // Item Properties diff --git a/PKHeX/Subforms/Save Editors/SAV_Wondercard.cs b/PKHeX/Subforms/Save Editors/SAV_Wondercard.cs index a9cc70dab..2638005fe 100644 --- a/PKHeX/Subforms/Save Editors/SAV_Wondercard.cs +++ b/PKHeX/Subforms/Save Editors/SAV_Wondercard.cs @@ -482,10 +482,9 @@ namespace PKHeX string s = gift.getCardHeader() + Environment.NewLine; if (gift.IsItem) { - s += "Item: " + Main.GameStrings.itemlist[gift.Item] + Environment.NewLine + "Quantity: " + gift.Quantity; - return s; + s += "Item: " + Main.GameStrings.itemlist[gift.Item] + Environment.NewLine + "Quantity: " + gift.Quantity + Environment.NewLine; } - if (gift.IsPokémon) + else if (gift.IsPokémon) { PKM pk = gift.convertToPKM(Main.SAV); @@ -501,10 +500,16 @@ namespace PKHeX s += $"+ {Main.GameStrings.itemlist[addItem]}"; } } - catch { s += "Unable to create gift description."; } - return s; + catch { s += "Unable to create gift description." + Environment.NewLine; } + } + else { s += "Unknown Wonder Card Type!" + Environment.NewLine; } + if (gift is WC7) + { + var wc7 = (WC7) gift; + s += $"Repeatable: {wc7.GiftRepeatable}" + Environment.NewLine; + s += $"Collected: {wc7.GiftUsed}" + Environment.NewLine; + s += $"Once Per Day: {wc7.GiftOncePerDay}" + Environment.NewLine; } - s += "Unknown Wonder Card Type!"; return s; }