0 Show Species That You're Switching For in the Party Menu
voloved edited this page 2023-02-06 08:52:45 -05:00

By devolov

Goal: Show the Pokemon you'd be switching your Pokemon into.

Was:

pokeemerald_modern-1

Now:

pokeemerald_modern-0

------------------------------- src/party_menu.c -------------------------------
index 3840ca57d..70225f4fc 100755
@@ -2488,12 +2488,18 @@ void DisplayPartyMenuStdMessage(u32 stringId)
         }
 
         if (stringId == PARTY_MSG_CHOOSE_MON)
         {
+            u8 enemyNextMonID = *(gBattleStruct->monToSwitchIntoId + B_SIDE_OPPONENT);
+            u16 species = GetMonData(&gEnemyParty[enemyNextMonID], MON_DATA_SPECIES);
             if (sPartyMenuInternal->chooseHalf)
                 stringId = PARTY_MSG_CHOOSE_MON_AND_CONFIRM;
             else if (!ShouldUseChooseMonText())
                 stringId = PARTY_MSG_CHOOSE_MON_OR_CANCEL;

+           else if (gMain.inBattle){
+               // Checks if the opponent is sending out a new pokemon.
+               if (species >= NUM_SPECIES ||  species == SPECIES_NONE){
+                   species = gBattleMons[B_SIDE_OPPONENT].species;
+                   // Now tries to check if there's any opposing pokemon on the field
+                   if (species >= NUM_SPECIES ||  species == SPECIES_NONE || gBattleTypeFlags & BATTLE_TYPE_DOUBLE)
+                       stringId = PARTY_MSG_CHOOSE_MON_2;  // No species on the other side, show the default text.
+               }
+               if (stringId == PARTY_MSG_CHOOSE_MON)
+                   StringCopy(gStringVar2, gSpeciesNames[species]);
+           }
+           else
+               stringId = PARTY_MSG_CHOOSE_MON_2;
         }
         DrawStdFrameWithCustomTileAndPalette(*windowPtr, FALSE, 0x4F, 0xD);
         StringExpandPlaceholders(gStringVar4, sActionStringTable[stringId]);
         AddTextPrinterParameterized(*windowPtr, FONT_NORMAL, gStringVar4, 0, 1, 0, 0);

-------------------------------- src/strings.c --------------------------------
index 64e10598f..f2373d500 100644
@@ -428,9 +428,9 @@ const u8 gText_PkmnSnappedOutOfConfusion[] = _("{STR_VAR_1} snapped out of its\n
 const u8 gText_PkmnGotOverInfatuation[] = _("{STR_VAR_1} got over its\ninfatuation.{PAUSE_UNTIL_PRESS}");
 const u8 gText_ThrowAwayItem[] = _("Throw away this\n{STR_VAR_1}?");
 const u8 gText_ItemThrownAway[] = _("The {STR_VAR_1}\nwas thrown away.{PAUSE_UNTIL_PRESS}");
 const u8 gText_TeachWhichPokemon2[] = _("Teach which POKéMON?"); // Unused
-const u8 gText_ChoosePokemon[] = _("Choose a POKéMON.");
+const u8 gText_ChoosePokemon[] = _("Choose POKéMON for {STR_VAR_2}.");
 const u8 gText_MoveToWhere[] = _("Move to where?");
 const u8 gText_TeachWhichPokemon[] = _("Teach which POKéMON?");
 const u8 gText_UseOnWhichPokemon[] = _("Use on which POKéMON?");
 const u8 gText_GiveToWhichPokemon[] = _("Give to which POKéMON?");