Add error messages for trying to send an illegal mon to the PC and fixes index in double wild battles (#7982)
Co-authored-by: Hedara <hedara90@gmail.com>
This commit is contained in:
parent
b4041535cf
commit
6eaa09bf5d
@ -2425,5 +2425,7 @@ extern const u8 gText_Rename[]; // change nickname from summary screen
|
||||
|
||||
// Switch Caught Mon into Party
|
||||
extern const u8 gText_CannotSendMonToBoxHM[];
|
||||
extern const u8 gText_CannotSendMonToBoxActive[];
|
||||
extern const u8 gText_CannotSendMonToBoxPartner[];
|
||||
|
||||
#endif // GUARD_STRINGS_H
|
||||
|
||||
@ -1512,11 +1512,21 @@ static void HandleChooseMonSelection(u8 taskId, s8 *slotPtr)
|
||||
case PARTY_ACTION_SEND_MON_TO_BOX:
|
||||
{
|
||||
u8 partyId = GetPartyIdFromBattleSlot((u8)*slotPtr);
|
||||
if (partyId == 0 || ((gBattleTypeFlags & BATTLE_TYPE_DOUBLE) && partyId == 2)
|
||||
|| ((gBattleTypeFlags & BATTLE_TYPE_MULTI) && partyId >= (PARTY_SIZE / 2)))
|
||||
if (partyId == 0 || ((gBattleTypeFlags & BATTLE_TYPE_DOUBLE) && partyId == 1))
|
||||
{
|
||||
// Can't select if mon is currently on the field, or doesn't belong to you
|
||||
// Can't select if mon is currently on the field
|
||||
PlaySE(SE_FAILURE);
|
||||
DisplayPartyMenuMessage(gText_CannotSendMonToBoxActive, FALSE);
|
||||
ScheduleBgCopyTilemapToVram(2);
|
||||
gTasks[taskId].func = Task_ReturnToChooseMonAfterText;
|
||||
}
|
||||
else if ((gBattleTypeFlags & BATTLE_TYPE_MULTI) && partyId >= (PARTY_SIZE / 2))
|
||||
{
|
||||
// Can't select if mon doesn't belong to you
|
||||
PlaySE(SE_FAILURE);
|
||||
DisplayPartyMenuMessage(gText_CannotSendMonToBoxPartner, FALSE);
|
||||
ScheduleBgCopyTilemapToVram(2);
|
||||
gTasks[taskId].func = Task_ReturnToChooseMonAfterText;
|
||||
}
|
||||
else if (DoesSelectedMonKnowHM((u8 *)slotPtr))
|
||||
{
|
||||
|
||||
@ -1300,3 +1300,5 @@ const u8 gText_PM[] = _("PM");
|
||||
const u8 gText_Relearn[] = _("{START_BUTTON} RELEARN"); // future note: don't decap this, because it mimics the summary screen BG graphics which will not get decapped
|
||||
const u8 gText_Rename[] = _("RENAME");
|
||||
const u8 gText_CannotSendMonToBoxHM[] = _("Cannot send that mon to the box,\nbecause it knows a HM move.{PAUSE_UNTIL_PRESS}");
|
||||
const u8 gText_CannotSendMonToBoxActive[] = _("Cannot send an active battler\nto the box.{PAUSE_UNTIL_PRESS}");
|
||||
const u8 gText_CannotSendMonToBoxPartner[] = _("Cannot send a mon that doesn't,\nbelong to you to the box.{PAUSE_UNTIL_PRESS}");
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user