diff --git a/charmap.txt b/charmap.txt index 6bcb0703a5..a736b40f2e 100644 --- a/charmap.txt +++ b/charmap.txt @@ -360,7 +360,7 @@ B_ATK_NAME_WITH_PREFIX_MON1 = FD 0D B_ATK_PARTNER_NAME = FD 0E B_ATK_NAME_WITH_PREFIX = FD 0F B_DEF_NAME_WITH_PREFIX = FD 10 -B_EFF_NAME_WITH_PREFIX = FD 11 @ EFF = short for gEffectBank +B_EFF_NAME_WITH_PREFIX = FD 11 @ EFF = short for gEffectBattler B_ACTIVE_NAME_WITH_PREFIX = FD 12 B_SCR_ACTIVE_NAME_WITH_PREFIX = FD 13 B_CURRENT_MOVE = FD 14 @@ -373,11 +373,11 @@ B_SCR_ACTIVE_ABILITY = FD 1A B_EFF_ABILITY = FD 1B B_TRAINER1_CLASS = FD 1C B_TRAINER1_NAME = FD 1D -B_1E = FD 1E @ trainer name for a link player -B_1F = FD 1F @ trainer name for a link player -B_20 = FD 20 @ trainer name for a link player -B_21 = FD 21 @ trainer name for a link player -B_22 = FD 22 @ trainer name for a link player +B_LINK_PLAYER_NAME = FD 1E +B_LINK_PARTNER_NAME = FD 1F +B_LINK_OPPONENT1_NAME = FD 20 +B_LINK_OPPONENT2_NAME = FD 21 +B_LINK_SCR_TRAINER_NAME = FD 22 B_PLAYER_NAME = FD 23 B_TRAINER1_LOSE_TEXT = FD 24 B_TRAINER1_WIN_TEXT = FD 25 diff --git a/include/battle_message.h b/include/battle_message.h index 94f584935c..5d811fe69f 100644 --- a/include/battle_message.h +++ b/include/battle_message.h @@ -34,11 +34,11 @@ #define B_TXT_EFF_ABILITY 0x1B #define B_TXT_TRAINER1_CLASS 0x1C #define B_TXT_TRAINER1_NAME 0x1D -#define B_TXT_1E 0x1E // trainer name for a link player -#define B_TXT_1F 0x1F // trainer name for a link player -#define B_TXT_20 0x20 // trainer name for a link player -#define B_TXT_21 0x21 // trainer name for a link player -#define B_TXT_22 0x22 // trainer name for a link player +#define B_TXT_LINK_PLAYER_NAME 0x1E +#define B_TXT_LINK_PARTNER_NAME 0x1F +#define B_TXT_LINK_OPPONENT1_NAME 0x20 +#define B_TXT_LINK_OPPONENT2_NAME 0x21 +#define B_TXT_LINK_SCR_TRAINER_NAME 0x22 #define B_TXT_PLAYER_NAME 0x23 #define B_TXT_TRAINER1_LOSE_TEXT 0x24 #define B_TXT_TRAINER1_WIN_TEXT 0x25 diff --git a/include/constants/battle.h b/include/constants/battle.h index e5ca9d7ae5..34f18c7bc0 100644 --- a/include/constants/battle.h +++ b/include/constants/battle.h @@ -46,7 +46,7 @@ // Battle Type Flags #define BATTLE_TYPE_DOUBLE 0x0001 #define BATTLE_TYPE_LINK 0x0002 -#define BATTLE_TYPE_WILD 0x0004 +#define BATTLE_TYPE_IS_MASTER 0x0004 // In not-link battles, it's always set. #define BATTLE_TYPE_TRAINER 0x0008 #define BATTLE_TYPE_FIRST_BATTLE 0x0010 #define BATTLE_TYPE_20 0x0020 diff --git a/src/battle_controller_opponent.c b/src/battle_controller_opponent.c index b3179ed3d2..1cd6722603 100644 --- a/src/battle_controller_opponent.c +++ b/src/battle_controller_opponent.c @@ -1998,7 +1998,7 @@ static void OpponentHandleResetActionMoveSelection(void) static void OpponentHandleCmd55(void) { - if (gBattleTypeFlags & BATTLE_TYPE_LINK && !(gBattleTypeFlags & BATTLE_TYPE_WILD)) + if (gBattleTypeFlags & BATTLE_TYPE_LINK && !(gBattleTypeFlags & BATTLE_TYPE_IS_MASTER)) { gMain.inBattle = 0; gMain.callback1 = gPreBattleCallback1; diff --git a/src/battle_controller_safari.c b/src/battle_controller_safari.c index aab804b417..898e182949 100644 --- a/src/battle_controller_safari.c +++ b/src/battle_controller_safari.c @@ -687,7 +687,7 @@ static void SafariHandleCmd55(void) FadeOutMapMusic(5); BeginFastPaletteFade(3); SafariBufferExecCompleted(); - if ((gBattleTypeFlags & BATTLE_TYPE_LINK) && !(gBattleTypeFlags & BATTLE_TYPE_WILD)) + if ((gBattleTypeFlags & BATTLE_TYPE_LINK) && !(gBattleTypeFlags & BATTLE_TYPE_IS_MASTER)) gBattlerControllerFuncs[gActiveBattler] = sub_81595E4; } diff --git a/src/battle_controller_wally.c b/src/battle_controller_wally.c index 747aa29878..80dd6d3bb2 100644 --- a/src/battle_controller_wally.c +++ b/src/battle_controller_wally.c @@ -1560,7 +1560,7 @@ static void WallyHandleCmd55(void) BeginFastPaletteFade(3); WallyBufferExecCompleted(); - if (!(gBattleTypeFlags & BATTLE_TYPE_WILD) && gBattleTypeFlags & BATTLE_TYPE_LINK) + if (!(gBattleTypeFlags & BATTLE_TYPE_IS_MASTER) && gBattleTypeFlags & BATTLE_TYPE_LINK) gBattlerControllerFuncs[gActiveBattler] = sub_80587B0; } diff --git a/src/battle_controllers.c b/src/battle_controllers.c index 4d714ca81c..63154ae8b0 100644 --- a/src/battle_controllers.c +++ b/src/battle_controllers.c @@ -330,7 +330,7 @@ static void InitSinglePlayerBtlControllers(void) } } } - else if (gBattleTypeFlags & BATTLE_TYPE_WILD) + else if (gBattleTypeFlags & BATTLE_TYPE_IS_MASTER) { gBattlerControllerFuncs[0] = SetControllerToRecordedPlayer; gBattlerPositions[0] = B_POSITION_PLAYER_LEFT; @@ -391,7 +391,7 @@ static void InitLinkBtlControllers(void) if (!(gBattleTypeFlags & BATTLE_TYPE_DOUBLE)) { - if (gBattleTypeFlags & BATTLE_TYPE_WILD) + if (gBattleTypeFlags & BATTLE_TYPE_IS_MASTER) { gBattleMainFunc = BeginBattleIntro; @@ -416,7 +416,7 @@ static void InitLinkBtlControllers(void) } else if (!(gBattleTypeFlags & BATTLE_TYPE_MULTI) && gBattleTypeFlags & BATTLE_TYPE_DOUBLE) { - if (gBattleTypeFlags & BATTLE_TYPE_WILD) + if (gBattleTypeFlags & BATTLE_TYPE_IS_MASTER) { gBattleMainFunc = BeginBattleIntro; @@ -453,7 +453,7 @@ static void InitLinkBtlControllers(void) } else if (gBattleTypeFlags & BATTLE_TYPE_BATTLE_TOWER) { - if (gBattleTypeFlags & BATTLE_TYPE_WILD) + if (gBattleTypeFlags & BATTLE_TYPE_IS_MASTER) { gBattleMainFunc = BeginBattleIntro; @@ -501,7 +501,7 @@ static void InitLinkBtlControllers(void) { multiplayerId = GetMultiplayerId(); - if (gBattleTypeFlags & BATTLE_TYPE_WILD) + if (gBattleTypeFlags & BATTLE_TYPE_IS_MASTER) gBattleMainFunc = BeginBattleIntro; for (i = 0; i < MAX_BATTLERS_COUNT; i++) @@ -700,14 +700,14 @@ static void CreateTasksForSendRecvLinkBuffers(void) enum { LINK_BUFF_BUFFER_ID, - LINK_BUFF_ACTIVE_BANK, + LINK_BUFF_ACTIVE_BATTLER, LINK_BUFF_ATTACKER, LINK_BUFF_TARGET, LINK_BUFF_SIZE_LO, LINK_BUFF_SIZE_HI, - LINK_BUFF_ABSENT_BANK_FLAGS, - LINK_BUFF_EFFECT_BANK, - LINK_BUFF_DATA + LINK_BUFF_ABSENT_BATTLER_FLAGS, + LINK_BUFF_EFFECT_BATTLER, + LINK_BUFF_DATA, }; void PrepareBufferDataTransferLink(u8 bufferId, u16 size, u8 *data) @@ -722,13 +722,13 @@ void PrepareBufferDataTransferLink(u8 bufferId, u16 size, u8 *data) gTasks[gUnknown_02022D08].data[14] = 0; } gLinkBattleSendBuffer[gTasks[gUnknown_02022D08].data[14] + LINK_BUFF_BUFFER_ID] = bufferId; - gLinkBattleSendBuffer[gTasks[gUnknown_02022D08].data[14] + LINK_BUFF_ACTIVE_BANK] = gActiveBattler; + gLinkBattleSendBuffer[gTasks[gUnknown_02022D08].data[14] + LINK_BUFF_ACTIVE_BATTLER] = gActiveBattler; gLinkBattleSendBuffer[gTasks[gUnknown_02022D08].data[14] + LINK_BUFF_ATTACKER] = gBattlerAttacker; gLinkBattleSendBuffer[gTasks[gUnknown_02022D08].data[14] + LINK_BUFF_TARGET] = gBattlerTarget; gLinkBattleSendBuffer[gTasks[gUnknown_02022D08].data[14] + LINK_BUFF_SIZE_LO] = alignedSize; gLinkBattleSendBuffer[gTasks[gUnknown_02022D08].data[14] + LINK_BUFF_SIZE_HI] = (alignedSize & 0x0000FF00) >> 8; - gLinkBattleSendBuffer[gTasks[gUnknown_02022D08].data[14] + LINK_BUFF_ABSENT_BANK_FLAGS] = gAbsentBattlerFlags; - gLinkBattleSendBuffer[gTasks[gUnknown_02022D08].data[14] + LINK_BUFF_EFFECT_BANK] = gEffectBattler; + gLinkBattleSendBuffer[gTasks[gUnknown_02022D08].data[14] + LINK_BUFF_ABSENT_BATTLER_FLAGS] = gAbsentBattlerFlags; + gLinkBattleSendBuffer[gTasks[gUnknown_02022D08].data[14] + LINK_BUFF_EFFECT_BATTLER] = gEffectBattler; for (i = 0; i < size; i++) gLinkBattleSendBuffer[gTasks[gUnknown_02022D08].data[14] + LINK_BUFF_DATA + i] = data[i]; @@ -877,7 +877,7 @@ static void Task_HandleCopyReceivedLinkBuffersData(u8 taskId) gTasks[taskId].data[12] = 0; gTasks[taskId].data[15] = 0; } - battlerId = gLinkBattleRecvBuffer[gTasks[taskId].data[15] + LINK_BUFF_ACTIVE_BANK]; + battlerId = gLinkBattleRecvBuffer[gTasks[taskId].data[15] + LINK_BUFF_ACTIVE_BATTLER]; blockSize = gLinkBattleRecvBuffer[gTasks[taskId].data[15] + LINK_BUFF_SIZE_LO] | (gLinkBattleRecvBuffer[gTasks[taskId].data[15] + LINK_BUFF_SIZE_HI] << 8); switch (gLinkBattleRecvBuffer[gTasks[taskId].data[15] + 0]) @@ -886,19 +886,19 @@ static void Task_HandleCopyReceivedLinkBuffersData(u8 taskId) if (gBattleControllerExecFlags & gBitTable[battlerId]) return; - memcpy(gBattleBufferA[battlerId], &gLinkBattleRecvBuffer[gTasks[taskId].data[15] + 8], blockSize); + memcpy(gBattleBufferA[battlerId], &gLinkBattleRecvBuffer[gTasks[taskId].data[15] + LINK_BUFF_DATA], blockSize); sub_803F850(battlerId); - if (!(gBattleTypeFlags & BATTLE_TYPE_WILD)) + if (!(gBattleTypeFlags & BATTLE_TYPE_IS_MASTER)) { - gBattlerAttacker = gLinkBattleRecvBuffer[gTasks[taskId].data[15] + 2]; - gBattlerTarget = gLinkBattleRecvBuffer[gTasks[taskId].data[15] + 3]; - gAbsentBattlerFlags = gLinkBattleRecvBuffer[gTasks[taskId].data[15] + 6]; - gEffectBattler = gLinkBattleRecvBuffer[gTasks[taskId].data[15] + 7]; + gBattlerAttacker = gLinkBattleRecvBuffer[gTasks[taskId].data[15] + LINK_BUFF_ATTACKER]; + gBattlerTarget = gLinkBattleRecvBuffer[gTasks[taskId].data[15] + LINK_BUFF_TARGET]; + gAbsentBattlerFlags = gLinkBattleRecvBuffer[gTasks[taskId].data[15] + LINK_BUFF_ABSENT_BATTLER_FLAGS]; + gEffectBattler = gLinkBattleRecvBuffer[gTasks[taskId].data[15] + LINK_BUFF_EFFECT_BATTLER]; } break; case 1: - memcpy(gBattleBufferB[battlerId], &gLinkBattleRecvBuffer[gTasks[taskId].data[15] + 8], blockSize); + memcpy(gBattleBufferB[battlerId], &gLinkBattleRecvBuffer[gTasks[taskId].data[15] + LINK_BUFF_DATA], blockSize); break; case 2: var = gLinkBattleRecvBuffer[gTasks[taskId].data[15] + LINK_BUFF_DATA]; diff --git a/src/battle_main.c b/src/battle_main.c index 781fbeff40..74325d7bf5 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -877,7 +877,7 @@ static void sub_8036EB8(u8 arg0, u8 arg1) if (gBlockRecvBuffer[0][0] == 256) { if (arg1 == 0) - gBattleTypeFlags |= BATTLE_TYPE_WILD | BATTLE_TYPE_TRAINER; + gBattleTypeFlags |= BATTLE_TYPE_IS_MASTER | BATTLE_TYPE_TRAINER; else gBattleTypeFlags |= BATTLE_TYPE_TRAINER; var++; @@ -896,7 +896,7 @@ static void sub_8036EB8(u8 arg0, u8 arg1) if (i == arg0) { if (arg1 == 0) - gBattleTypeFlags |= BATTLE_TYPE_WILD | BATTLE_TYPE_TRAINER; + gBattleTypeFlags |= BATTLE_TYPE_IS_MASTER | BATTLE_TYPE_TRAINER; else gBattleTypeFlags |= BATTLE_TYPE_TRAINER; var++; @@ -916,7 +916,7 @@ static void sub_8036EB8(u8 arg0, u8 arg1) } if (i == arg0) - gBattleTypeFlags |= BATTLE_TYPE_WILD | BATTLE_TYPE_TRAINER; + gBattleTypeFlags |= BATTLE_TYPE_IS_MASTER | BATTLE_TYPE_TRAINER; else gBattleTypeFlags |= BATTLE_TYPE_TRAINER; } @@ -979,7 +979,7 @@ static void CB2_HandleStartBattle(void) else { if (!(gBattleTypeFlags & BATTLE_TYPE_RECORDED)) - gBattleTypeFlags |= BATTLE_TYPE_WILD; + gBattleTypeFlags |= BATTLE_TYPE_IS_MASTER; gBattleCommunication[MULTIUSE_STATE] = 15; SetAllPlayersBerryData(); } @@ -1087,7 +1087,7 @@ static void CB2_HandleStartBattle(void) if ((GetBlockReceivedStatus() & 3) == 3) { ResetBlockReceivedFlags(); - if (!(gBattleTypeFlags & BATTLE_TYPE_WILD)) + if (!(gBattleTypeFlags & BATTLE_TYPE_IS_MASTER)) memcpy(&gRecordedBattleRngSeed, gBlockRecvBuffer[enemyMultiplayerId], sizeof(gRecordedBattleRngSeed)); gBattleCommunication[MULTIUSE_STATE]++; } @@ -1181,7 +1181,7 @@ static void CB2_HandleStartMultiPartnerBattle(void) else { if (!(gBattleTypeFlags & BATTLE_TYPE_RECORDED)) - gBattleTypeFlags |= BATTLE_TYPE_WILD; + gBattleTypeFlags |= BATTLE_TYPE_IS_MASTER; gBattleCommunication[MULTIUSE_STATE] = 13; SetAllPlayersBerryData(); } @@ -1340,7 +1340,7 @@ static void CB2_HandleStartMultiPartnerBattle(void) if ((GetBlockReceivedStatus() & 3) == 3) { ResetBlockReceivedFlags(); - if (!(gBattleTypeFlags & BATTLE_TYPE_WILD)) + if (!(gBattleTypeFlags & BATTLE_TYPE_IS_MASTER)) memcpy(&gRecordedBattleRngSeed, gBlockRecvBuffer[enemyMultiplayerId], sizeof(gRecordedBattleRngSeed)); gBattleCommunication[MULTIUSE_STATE]++; } @@ -1568,7 +1568,7 @@ static void CB2_HandleStartMultiBattle(void) else { if (!(gBattleTypeFlags & BATTLE_TYPE_RECORDED)) - gBattleTypeFlags |= BATTLE_TYPE_WILD; + gBattleTypeFlags |= BATTLE_TYPE_IS_MASTER; gBattleCommunication[MULTIUSE_STATE] = 7; SetAllPlayersBerryData(); } @@ -3302,7 +3302,7 @@ static void BattleIntroGetMonsData(void) { case 0: gActiveBattler = gBattleCommunication[1]; - BtlController_EmitGetMonData(0, 0, 0); + BtlController_EmitGetMonData(0, REQUEST_ALL_BATTLE, 0); MarkBattlerForControllerExec(gActiveBattler); gBattleCommunication[MULTIUSE_STATE]++; break; @@ -4597,7 +4597,7 @@ static void sub_803CDF8(void) void SwapTurnOrder(u8 id1, u8 id2) { u32 temp; - + SWAP(gActionsByTurnOrder[id1], gActionsByTurnOrder[id2], temp); SWAP(gBattlerByTurnOrder[id1], gBattlerByTurnOrder[id2], temp); } diff --git a/src/battle_message.c b/src/battle_message.c index 78b9ac53b4..f478df4df1 100644 --- a/src/battle_message.c +++ b/src/battle_message.c @@ -334,14 +334,14 @@ static const u8 sText_GotAwaySafely[] = _("{PLAY_SE 0x0011}Got away safely!\p"); static const u8 sText_PkmnFledUsingIts[] = _("{PLAY_SE 0x0011}{B_ATK_NAME_WITH_PREFIX} fled\nusing its {B_LAST_ITEM}!\p"); static const u8 sText_PkmnFledUsing[] = _("{PLAY_SE 0x0011}{B_ATK_NAME_WITH_PREFIX} fled\nusing {B_ATK_ABILITY}!\p"); static const u8 sText_WildPkmnFled[] = _("{PLAY_SE 0x0011}Wild {B_BUFF1} fled!"); -static const u8 sText_PlayerDefeatedLinkTrainer[] = _("Player defeated\n{B_20}!"); -static const u8 sText_TwoLinkTrainersDefeated[] = _("Player beat {B_20}\nand {B_21}!"); -static const u8 sText_PlayerLostAgainstLinkTrainer[] = _("Player lost against\n{B_20}!"); -static const u8 sText_PlayerLostToTwo[] = _("Player lost to {B_20}\nand {B_21}!"); -static const u8 sText_PlayerBattledToDrawLinkTrainer[] = _("Player battled to a draw against\n{B_20}!"); -static const u8 sText_PlayerBattledToDrawVsTwo[] = _("Player battled to a draw against\n{B_20} and {B_21}!"); -static const u8 sText_WildFled[] = _("{PLAY_SE 0x0011}{B_20} fled!"); -static const u8 sText_TwoWildFled[] = _("{PLAY_SE 0x0011}{B_20} and\n{B_21} fled!"); +static const u8 sText_PlayerDefeatedLinkTrainer[] = _("Player defeated\n{B_LINK_OPPONENT1_NAME}!"); +static const u8 sText_TwoLinkTrainersDefeated[] = _("Player beat {B_LINK_OPPONENT1_NAME}\nand {B_LINK_OPPONENT2_NAME}!"); +static const u8 sText_PlayerLostAgainstLinkTrainer[] = _("Player lost against\n{B_LINK_OPPONENT1_NAME}!"); +static const u8 sText_PlayerLostToTwo[] = _("Player lost to {B_LINK_OPPONENT1_NAME}\nand {B_LINK_OPPONENT2_NAME}!"); +static const u8 sText_PlayerBattledToDrawLinkTrainer[] = _("Player battled to a draw against\n{B_LINK_OPPONENT1_NAME}!"); +static const u8 sText_PlayerBattledToDrawVsTwo[] = _("Player battled to a draw against\n{B_LINK_OPPONENT1_NAME} and {B_LINK_OPPONENT2_NAME}!"); +static const u8 sText_WildFled[] = _("{PLAY_SE 0x0011}{B_LINK_OPPONENT1_NAME} fled!"); +static const u8 sText_TwoWildFled[] = _("{PLAY_SE 0x0011}{B_LINK_OPPONENT1_NAME} and\n{B_LINK_OPPONENT2_NAME} fled!"); static const u8 sText_NoRunningFromTrainers[] = _("No! There’s no running\nfrom a TRAINER battle!\p"); static const u8 sText_CantEscape[] = _("Can’t escape!\p"); static const u8 sText_DontLeaveBirch[] = _("PROF. BIRCH: Don’t leave me like this!\p"); @@ -398,33 +398,33 @@ static const u8 sText_WildPkmnAppeared2[] = _("Wild {B_OPPONENT_MON1_NAME} appea static const u8 sText_WildPkmnAppearedPause[] = _("Wild {B_OPPONENT_MON1_NAME} appeared!{PAUSE 127}"); static const u8 sText_TwoWildPkmnAppeared[] = _("Wild {B_OPPONENT_MON1_NAME} and\n{B_OPPONENT_MON2_NAME} appeared!\p"); static const u8 sText_Trainer1WantsToBattle[] = _("{B_TRAINER1_CLASS} {B_TRAINER1_NAME}\nwould like to battle!\p"); -static const u8 sText_LinkTrainerWantsToBattle[] = _("{B_20}\nwants to battle!"); -static const u8 sText_TwoLinkTrainersWantToBattle[] = _("{B_20} and {B_21}\nwant to battle!"); +static const u8 sText_LinkTrainerWantsToBattle[] = _("{B_LINK_OPPONENT1_NAME}\nwants to battle!"); +static const u8 sText_TwoLinkTrainersWantToBattle[] = _("{B_LINK_OPPONENT1_NAME} and {B_LINK_OPPONENT2_NAME}\nwant to battle!"); static const u8 sText_Trainer1SentOutPkmn[] = _("{B_TRAINER1_CLASS} {B_TRAINER1_NAME} sent\nout {B_OPPONENT_MON1_NAME}!"); static const u8 sText_Trainer1SentOutTwoPkmn[] = _("{B_TRAINER1_CLASS} {B_TRAINER1_NAME} sent\nout {B_OPPONENT_MON1_NAME} and {B_OPPONENT_MON2_NAME}!"); static const u8 sText_Trainer1SentOutPkmn2[] = _("{B_TRAINER1_CLASS} {B_TRAINER1_NAME} sent\nout {B_BUFF1}!"); -static const u8 sText_LinkTrainerSentOutPkmn[] = _("{B_20} sent out\n{B_OPPONENT_MON1_NAME}!"); -static const u8 sText_LinkTrainerSentOutTwoPkmn[] = _("{B_20} sent out\n{B_OPPONENT_MON1_NAME} and {B_OPPONENT_MON2_NAME}!"); -static const u8 sText_TwoLinkTrainersSentOutPkmn[] = _("{B_20} sent out {B_LINK_OPPONENT_MON1_NAME}!\n{B_21} sent out {B_LINK_OPPONENT_MON2_NAME}!"); -static const u8 sText_LinkTrainerSentOutPkmn2[] = _("{B_20} sent out\n{B_BUFF1}!"); -static const u8 sText_LinkTrainerMultiSentOutPkmn[] = _("{B_22} sent out\n{B_BUFF1}!"); +static const u8 sText_LinkTrainerSentOutPkmn[] = _("{B_LINK_OPPONENT1_NAME} sent out\n{B_OPPONENT_MON1_NAME}!"); +static const u8 sText_LinkTrainerSentOutTwoPkmn[] = _("{B_LINK_OPPONENT1_NAME} sent out\n{B_OPPONENT_MON1_NAME} and {B_OPPONENT_MON2_NAME}!"); +static const u8 sText_TwoLinkTrainersSentOutPkmn[] = _("{B_LINK_OPPONENT1_NAME} sent out {B_LINK_OPPONENT_MON1_NAME}!\n{B_LINK_OPPONENT2_NAME} sent out {B_LINK_OPPONENT_MON2_NAME}!"); +static const u8 sText_LinkTrainerSentOutPkmn2[] = _("{B_LINK_OPPONENT1_NAME} sent out\n{B_BUFF1}!"); +static const u8 sText_LinkTrainerMultiSentOutPkmn[] = _("{B_LINK_SCR_TRAINER_NAME} sent out\n{B_BUFF1}!"); static const u8 sText_GoPkmn[] = _("Go! {B_PLAYER_MON1_NAME}!"); static const u8 sText_GoTwoPkmn[] = _("Go! {B_PLAYER_MON1_NAME} and\n{B_PLAYER_MON2_NAME}!"); static const u8 sText_GoPkmn2[] = _("Go! {B_BUFF1}!"); static const u8 sText_DoItPkmn[] = _("Do it! {B_BUFF1}!"); static const u8 sText_GoForItPkmn[] = _("Go for it, {B_BUFF1}!"); static const u8 sText_YourFoesWeakGetEmPkmn[] = _("Your foe’s weak!\nGet ’em, {B_BUFF1}!"); -static const u8 sText_LinkPartnerSentOutPkmnGoPkmn[] = _("{B_1F} sent out {B_LINK_PLAYER_MON2_NAME}!\nGo! {B_LINK_PLAYER_MON1_NAME}!"); +static const u8 sText_LinkPartnerSentOutPkmnGoPkmn[] = _("{B_LINK_PARTNER_NAME} sent out {B_LINK_PLAYER_MON2_NAME}!\nGo! {B_LINK_PLAYER_MON1_NAME}!"); static const u8 sText_PkmnThatsEnough[] = _("{B_BUFF1}, that’s enough!\nCome back!"); static const u8 sText_PkmnComeBack[] = _("{B_BUFF1}, come back!"); static const u8 sText_PkmnOkComeBack[] = _("{B_BUFF1}, OK!\nCome back!"); static const u8 sText_PkmnGoodComeBack[] = _("{B_BUFF1}, good!\nCome back!"); static const u8 sText_Trainer1WithdrewPkmn[] = _("{B_TRAINER1_CLASS} {B_TRAINER1_NAME}\nwithdrew {B_BUFF1}!"); -static const u8 sText_LinkTrainer1WithdrewPkmn[] = _("{B_20} withdrew\n{B_BUFF1}!"); -static const u8 sText_LinkTrainer2WithdrewPkmn[] = _("{B_22} withdrew\n{B_BUFF1}!"); +static const u8 sText_LinkTrainer1WithdrewPkmn[] = _("{B_LINK_OPPONENT1_NAME} withdrew\n{B_BUFF1}!"); +static const u8 sText_LinkTrainer2WithdrewPkmn[] = _("{B_LINK_SCR_TRAINER_NAME} withdrew\n{B_BUFF1}!"); static const u8 sText_WildPkmnPrefix[] = _("Wild "); static const u8 sText_FoePkmnPrefix[] = _("Foe "); -static const u8 sText_EmptyString8[] = _( ""); +static const u8 sText_EmptyString8[] = _(""); static const u8 sText_FoePkmnPrefix2[] = _("Foe"); static const u8 sText_AllyPkmnPrefix[] = _("Ally"); static const u8 sText_FoePkmnPrefix3[] = _("Foe"); @@ -1321,8 +1321,8 @@ static const u8 sText_PlayerLostAgainstTrainer1[] = _("Player lost against\n{B_T static const u8 sText_PlayerBattledToDrawTrainer1[] = _("Player battled to a draw against\n{B_TRAINER1_CLASS} {B_TRAINER1_NAME}!"); const u8 gText_RecordBattleToPass[] = _("Would you like to record your battle\non your FRONTIER PASS?"); const u8 gText_BattleRecordedOnPass[] = _("{B_PLAYER_NAME}’s battle result was recorded\non the FRONTIER PASS."); -static const u8 sText_LinkTrainerWantsToBattlePause[] = _("{B_20}\nwants to battle!{PAUSE 49}"); -static const u8 sText_TwoLinkTrainersWantToBattlePause[] = _("{B_20} and {B_21}\nwant to battle!{PAUSE 49}"); +static const u8 sText_LinkTrainerWantsToBattlePause[] = _("{B_LINK_OPPONENT1_NAME}\nwants to battle!{PAUSE 49}"); +static const u8 sText_TwoLinkTrainersWantToBattlePause[] = _("{B_LINK_OPPONENT1_NAME} and {B_LINK_OPPONENT2_NAME}\nwant to battle!{PAUSE 49}"); // This is four lists of moves which use a different attack string in Japanese // to the default. See the documentation for ChooseTypeOfMoveUsedString for more detail. @@ -2303,13 +2303,13 @@ u32 BattleStringExpandPlaceholders(const u8 *src, u8 *dst) u32 dstID = 0; // if they used dstID, why not use srcID as well? const u8 *toCpy = NULL; u8 text[30]; - u8 multiplayerID; + u8 multiplayerId; s32 i; if (gBattleTypeFlags & BATTLE_TYPE_x2000000) - multiplayerID = gUnknown_0203C7B4; + multiplayerId = gUnknown_0203C7B4; else - multiplayerID = GetMultiplayerId(); + multiplayerId = GetMultiplayerId(); while (*src != EOS) { @@ -2383,25 +2383,25 @@ u32 BattleStringExpandPlaceholders(const u8 *src, u8 *dst) toCpy = text; break; case B_TXT_LINK_PLAYER_MON1_NAME: // link first player poke name - GetMonData(&gPlayerParty[gBattlerPartyIndexes[gLinkPlayers[multiplayerID].id]], + GetMonData(&gPlayerParty[gBattlerPartyIndexes[gLinkPlayers[multiplayerId].id]], MON_DATA_NICKNAME, text); StringGetEnd10(text); toCpy = text; break; case B_TXT_LINK_OPPONENT_MON1_NAME: // link first opponent poke name - GetMonData(&gEnemyParty[gBattlerPartyIndexes[gLinkPlayers[multiplayerID].id ^ 1]], + GetMonData(&gEnemyParty[gBattlerPartyIndexes[gLinkPlayers[multiplayerId].id ^ 1]], MON_DATA_NICKNAME, text); StringGetEnd10(text); toCpy = text; break; case B_TXT_LINK_PLAYER_MON2_NAME: // link second player poke name - GetMonData(&gPlayerParty[gBattlerPartyIndexes[gLinkPlayers[multiplayerID].id ^ 2]], + GetMonData(&gPlayerParty[gBattlerPartyIndexes[gLinkPlayers[multiplayerId].id ^ 2]], MON_DATA_NICKNAME, text); StringGetEnd10(text); toCpy = text; break; case B_TXT_LINK_OPPONENT_MON2_NAME: // link second opponent poke name - GetMonData(&gEnemyParty[gBattlerPartyIndexes[gLinkPlayers[multiplayerID].id ^ 3]], + GetMonData(&gEnemyParty[gBattlerPartyIndexes[gLinkPlayers[multiplayerId].id ^ 3]], MON_DATA_NICKNAME, text); StringGetEnd10(text); toCpy = text; @@ -2531,7 +2531,7 @@ u32 BattleStringExpandPlaceholders(const u8 *src, u8 *dst) } else if (gTrainerBattleOpponent_A == TRAINER_OPPONENT_C00) { - toCpy = gLinkPlayers[multiplayerID ^ BIT_SIDE].name; + toCpy = gLinkPlayers[multiplayerId ^ BIT_SIDE].name; } else if (gTrainerBattleOpponent_A == TRAINER_FRONTIER_BRAIN) { @@ -2558,19 +2558,19 @@ u32 BattleStringExpandPlaceholders(const u8 *src, u8 *dst) toCpy = gTrainers[gTrainerBattleOpponent_A].trainerName; } break; - case B_TXT_1E: // link player name? - toCpy = gLinkPlayers[multiplayerID].name; + case B_TXT_LINK_PLAYER_NAME: // link player name + toCpy = gLinkPlayers[multiplayerId].name; break; - case B_TXT_1F: // link partner name? - toCpy = gLinkPlayers[GetBattlerMultiplayerId(2 ^ gLinkPlayers[multiplayerID].id)].name; + case B_TXT_LINK_PARTNER_NAME: // link partner name + toCpy = gLinkPlayers[GetBattlerMultiplayerId(BATTLE_PARTNER(gLinkPlayers[multiplayerId].id))].name; break; - case B_TXT_20: // link opponent 1 name? - toCpy = gLinkPlayers[GetBattlerMultiplayerId(1 ^ gLinkPlayers[multiplayerID].id)].name; + case B_TXT_LINK_OPPONENT1_NAME: // link opponent 1 name + toCpy = gLinkPlayers[GetBattlerMultiplayerId(BATTLE_OPPOSITE(gLinkPlayers[multiplayerId].id))].name; break; - case B_TXT_21: // link opponent 2 name? - toCpy = gLinkPlayers[GetBattlerMultiplayerId(3 ^ gLinkPlayers[multiplayerID].id)].name; + case B_TXT_LINK_OPPONENT2_NAME: // link opponent 2 name + toCpy = gLinkPlayers[GetBattlerMultiplayerId(BATTLE_PARTNER(BATTLE_OPPOSITE(gLinkPlayers[multiplayerId].id)))].name; break; - case B_TXT_22: // link scripting active name + case B_TXT_LINK_SCR_TRAINER_NAME: // link scripting active name toCpy = gLinkPlayers[GetBattlerMultiplayerId(gBattleScripting.battler)].name; break; case B_TXT_PLAYER_NAME: // player name diff --git a/src/pokemon.c b/src/pokemon.c index 78a7a55a5b..e2ce24bdb1 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -5307,7 +5307,7 @@ bool8 PokemonUseItemEffects(struct Pokemon *mon, u16 item, u8 partyIndex, u8 mov // I have to re-use this variable to match. r5 = gActiveBattler; gActiveBattler = battlerId; - BtlController_EmitGetMonData(0, 0, 0); + BtlController_EmitGetMonData(0, REQUEST_ALL_BATTLE, 0); MarkBattlerForControllerExec(gActiveBattler); gActiveBattler = r5; } diff --git a/src/recorded_battle.c b/src/recorded_battle.c index fc3b8b94a1..5a12d6114d 100644 --- a/src/recorded_battle.c +++ b/src/recorded_battle.c @@ -273,7 +273,7 @@ void sub_81851A8(u8 *arg0) return; } - if (!(gBattleTypeFlags & BATTLE_TYPE_WILD)) + if (!(gBattleTypeFlags & BATTLE_TYPE_IS_MASTER)) { for (var2 = *arg0; var2 != 0;) { @@ -360,7 +360,7 @@ u32 MoveRecordedBattleToSaveData(void) battleSave->battleFlags = (sBattleFlags & ~(BATTLE_TYPE_LINK | BATTLE_TYPE_20)); battleSave->battleFlags |= BATTLE_TYPE_x2000000; - if (sBattleFlags & BATTLE_TYPE_WILD) + if (sBattleFlags & BATTLE_TYPE_IS_MASTER) { battleSave->battleFlags |= BATTLE_TYPE_x80000000; }