Compare commits

...

2 Commits
1.9.0 ... main

Author SHA1 Message Date
Manu
ef1c90dbea Initial handling for Flag wondercards
Some checks failed
Linux / build (Release) (push) Has been cancelled
MacOS / build (Release) (push) Has been cancelled
Windows / build (Release) (push) Has been cancelled
2025-11-08 22:54:36 +01:00
Manu
f8fb4485c0
Update README.md
Some checks failed
Linux / build (Release) (push) Has been cancelled
MacOS / build (Release) (push) Has been cancelled
Windows / build (Release) (push) Has been cancelled
2025-10-28 02:50:59 +01:00
4 changed files with 11 additions and 5 deletions

View File

@ -12,6 +12,7 @@ This allows wondercards to be redeemed through the in-game Mystery Gift menu. Th
* Brilliant Diamond and Shining Pearl wondercard files (.wb8)
* Legends Arceus wondercard files (.wa8)
* Scarlet & Violet wondercard files (.wc9)
* Legends Z-A wondercard files (.wa9)
* BCAT wondercard files, containing either multiple or single wondercards (no file format extension)
### Compatible games
@ -20,6 +21,7 @@ This allows wondercards to be redeemed through the in-game Mystery Gift menu. Th
* Pokémon Brilliant Diamond and Shining Pearl
* Pokémon Legends Arceus
* Pokémon Scarlet and Violet
* Pokémon Legends Z-A
## Disclosure
Neither I nor the Project Pokémon staff take any responsibility for possible adverse outcomes or bans resulting from the use of this tool. Use it at your own discretion.
@ -81,4 +83,4 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
along with this program. If not, see <http://www.gnu.org/licenses/>.

View File

@ -101,7 +101,7 @@ public class OtherGift
}
else if (type.GetType() == typeof(GiftType9A))
{
if ((GiftType9A)type is GiftType9A.Item)
if ((GiftType9A)type is GiftType9A.Item or GiftType9A.Flag)
str = Properties.Resources.Items.Split(new String[] { "\n" }, StringSplitOptions.None)[id];
else if ((GiftType9A)type is GiftType9A.Clothing)
{

View File

@ -13,6 +13,9 @@ public class WA9 : Wondercard
private const int TIDOffset = 0x18;
private const int SIDOffset = 0x1A;
private const int PIDOffset = 0x24;
private const int FlagStringOffset = 0x28;
private const int FlagItemOffset = 0x6C;
private const int FlagItemQuantityOffset = 0x6E;
private const int SpeciesOffset = 0x270;
private const int ShinyTypeOffset = 0x278;
private const int ChecksumOffset = 0x2C0;
@ -82,8 +85,9 @@ public class WA9 : Wondercard
}
else
{
item = BinaryPrimitives.ReadUInt16LittleEndian(Data.AsSpan(ItemOffset + (0x04 * i)));
quantity = type is GiftType9A.BP ? BinaryPrimitives.ReadUInt32LittleEndian(Data.AsSpan(ItemOffset + (0x04 * i))) :
item = type is GiftType9A.Flag ? BinaryPrimitives.ReadUInt16LittleEndian(Data.AsSpan(FlagItemOffset + (0x04 * i))) :
BinaryPrimitives.ReadUInt16LittleEndian(Data.AsSpan(ItemOffset + (0x04 * i)));
quantity = type is GiftType9A.Flag ? BinaryPrimitives.ReadUInt32LittleEndian(Data.AsSpan(FlagItemQuantityOffset + (0x04 * i))) :
BinaryPrimitives.ReadUInt16LittleEndian(Data.AsSpan(QuantityOffset + (0x04 * i)));
}

View File

@ -78,7 +78,7 @@ public enum GiftType9A : byte
None = 0,
Pokemon = 1,
Item = 2,
BP = 3,
Flag = 3,
Clothing = 4,
}