/// <summary> /// Checks if the <see cref="MysteryGift"/> data is compatible with the <see cref="SaveFile"/>. Sets appropriate data to the save file in order to receive the gift. /// </summary> /// <param name="g">Gift data to potentially insert to the save file.</param> /// <param name="SAV">Save file receiving the gift data.</param> /// <param name="message">Error message if incompatible.</param> /// <returns>True if compatible, false if incompatible.</returns> public static bool IsCardCompatible(this MysteryGift g, SaveFile SAV, out string message) { if (g.Format != SAV.Generation) { message = MsgMysteryGiftSlotSpecialReject; return(false); } if (!SAV.CanRecieveGift(g)) { message = MsgMysteryGiftTypeDetails; return(false); } if (g is WC6 && g.CardID == 2048 && g.ItemID == 726) // Eon Ticket (OR/AS) { if (!(SAV is SAV6AO)) { message = MsgMysteryGiftSlotSpecialReject; return(false); } } message = null; return(true); }
/// <summary> /// Checks if the <see cref="MysteryGift"/> data is compatible with the <see cref="SaveFile"/>. Sets appropriate data to the save file in order to receive the gift. /// </summary> /// <param name="g">Gift data to potentially insert to the save file.</param> /// <param name="SAV">Save file receiving the gift data.</param> /// <param name="message">Error message if incompatible.</param> /// <returns>True if compatible, false if incompatible.</returns> public static bool IsCardCompatible(this MysteryGift g, SaveFile SAV, out string message) { if (g.Format != SAV.Generation) { message = MsgMysteryGiftSlotSpecialReject; return(false); } if (!SAV.CanRecieveGift(g)) { message = MsgMysteryGiftTypeDetails; return(false); } if (g is WC6 && g.CardID == 2048 && g.ItemID == 726) // Eon Ticket (OR/AS) { if (!SAV.ORAS) { message = MsgMysteryGiftSlotSpecialReject; return(false); } // Set the special recieved data BitConverter.GetBytes(WC6.EonTicketConst).CopyTo(SAV.Data, ((SAV6)SAV).EonTicket); } message = null; return(true); }