Better WC7 Card Flags + Descriptions

This commit is contained in:
Michael Scire 2017-01-05 14:45:53 -08:00
parent 89622862b2
commit fda84ae992
2 changed files with 20 additions and 7 deletions

View file

@ -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

View file

@ -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;
}