Adds support for placing Pokémon in the PC with the B button (#3329)

Adds support for placing Pokémon in the PC with the B button
This commit is contained in:
ghoulslash 2023-09-24 21:35:16 -04:00 committed by GitHub
commit 0b9f12efe4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 0 deletions

View File

@ -7,6 +7,9 @@
// Other settings // Other settings
#define OW_POISON_DAMAGE GEN_LATEST // In Gen4, Pokémon no longer faint from Poison in the overworld. In Gen5+, they no longer take damage at all. #define OW_POISON_DAMAGE GEN_LATEST // In Gen4, Pokémon no longer faint from Poison in the overworld. In Gen5+, they no longer take damage at all.
// PC settings
#define OW_PC_PRESS_B GEN_LATEST // In Gen4, pressing B when holding a Pokémon is equivalent to placing it. In Gen3, it gives the "You're holding a Pokémon!" error.
// Overworld flags // Overworld flags
// To use the following features in scripting, replace the 0s with the flag ID you're assigning it to. // To use the following features in scripting, replace the 0s with the flag ID you're assigning it to.
// Eg: Replace with FLAG_UNUSED_0x264 so you can use that flag to toggle the feature. // Eg: Replace with FLAG_UNUSED_0x264 so you can use that flag to toggle the feature.

View File

@ -3685,9 +3685,14 @@ static void Task_OnBPressed(u8 taskId)
case 0: case 0:
if (IsMonBeingMoved()) if (IsMonBeingMoved())
{ {
#if OW_PC_PRESS_B < GEN_4
PlaySE(SE_FAILURE); PlaySE(SE_FAILURE);
PrintMessage(MSG_HOLDING_POKE); PrintMessage(MSG_HOLDING_POKE);
sStorage->state = 1; sStorage->state = 1;
#else
PlaySE(SE_SELECT);
SetPokeStorageTask(Task_PlaceMon);
#endif
} }
else if (IsMovingItem()) else if (IsMovingItem())
{ {