From 7552caaadc3b5ec64bc4ea8c6927d6d452238730 Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Sat, 7 Oct 2017 19:59:41 +0200 Subject: [PATCH] placeholders for battle strings are done --- asm/battle_message.s | 1954 -------------------------------------- asm/battle_setup.s | 12 +- asm/battle_tower.s | 12 +- asm/rom6.s | 2 +- charmap.txt | 6 +- include/battle_2.h | 2 +- include/battle_message.h | 106 +-- include/global.h | 37 +- src/battle_2.c | 2 +- src/battle_message.c | 745 ++++++++++++++- 10 files changed, 783 insertions(+), 2095 deletions(-) diff --git a/asm/battle_message.s b/asm/battle_message.s index 9afa6e399..d78167a26 100644 --- a/asm/battle_message.s +++ b/asm/battle_message.s @@ -5,1960 +5,6 @@ .text - thumb_func_start BattleStringExpandPlaceholdersToDisplayedString -BattleStringExpandPlaceholdersToDisplayedString: @ 814E6F0 - push {lr} - ldr r1, =gDisplayedStringBattle - bl BattleStringExpandPlaceholders - pop {r1} - bx r1 - .pool - thumb_func_end BattleStringExpandPlaceholdersToDisplayedString - - thumb_func_start AppendStatusString -AppendStatusString: @ 814E700 - push {r4,r5,lr} - sub sp, 0x8 - adds r4, r0, 0 - ldr r1, =gUnknown_085CD422 - mov r0, sp - movs r2, 0x8 - bl memcpy - mov r2, sp - movs r3, 0 - b _0814E728 - .pool -_0814E71C: - strb r1, [r2] - adds r4, 0x1 - adds r2, 0x1 - adds r3, 0x1 - cmp r3, 0x7 - bhi _0814E730 -_0814E728: - ldrb r1, [r4] - adds r0, r1, 0 - cmp r0, 0xFF - bne _0814E71C -_0814E730: - ldr r5, [sp] - ldr r4, [sp, 0x4] - movs r3, 0 - ldr r2, =gStatusConditionStringsTable -_0814E738: - ldr r1, [r2] - ldr r0, [r1] - cmp r5, r0 - bne _0814E750 - ldr r0, [r1, 0x4] - cmp r4, r0 - bne _0814E750 - ldr r0, [r2, 0x4] - b _0814E75A - .pool -_0814E750: - adds r2, 0x8 - adds r3, 0x1 - cmp r3, 0x6 - bls _0814E738 - movs r0, 0 -_0814E75A: - add sp, 0x8 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end AppendStatusString - - thumb_func_start BattleStringExpandPlaceholders - BattleStringExpandPlaceholders: @ 814E764 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x20 - mov r9, r0 - mov r8, r1 - movs r6, 0 - movs r4, 0 - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 18 - ands r0, r1 - cmp r0, 0 - beq _0814E794 - ldr r0, =gUnknown_0203C7B4 - ldrb r7, [r0] - b _0814E79C - .pool -_0814E794: - bl GetMultiplayerId - lsls r0, 24 - lsrs r7, r0, 24 -_0814E79C: - mov r0, r9 - ldrb r1, [r0] - bl _0814F620 -_0814E7A4: - cmp r1, 0xFD - beq _0814E7AC - bl _0814F610 -_0814E7AC: - movs r1, 0x1 - add r9, r1 - mov r2, r9 - ldrb r0, [r2] - cmp r0, 0x34 - bls _0814E7BC - bl _0814F5C0 -_0814E7BC: - lsls r0, 2 - ldr r1, =_0814E7CC - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0814E7CC: - .4byte _0814E8A0 - .4byte _0814E8CE - .4byte _0814E90A - .4byte _0814E914 - .4byte _0814E920 - .4byte _0814E92C - .4byte _0814E960 - .4byte _0814E994 - .4byte _0814E9C8 - .4byte _0814E9FC - .4byte _0814EA38 - .4byte _0814EA78 - .4byte _0814EAB8 - .4byte _0814EAF8 - .4byte _0814EBB0 - .4byte _0814EC38 - .4byte _0814ECD4 - .4byte _0814ED70 - .4byte _0814EE0C - .4byte _0814EEA8 - .4byte _0814EF44 - .4byte _0814EF5C - .4byte _0814EF98 - .4byte _0814F080 - .4byte _0814F088 - .4byte _0814F098 - .4byte _0814F0A8 - .4byte _0814F0B8 - .4byte _0814F0D8 - .4byte _0814F164 - .4byte _0814F220 - .4byte _0814F230 - .4byte _0814F244 - .4byte _0814F258 - .4byte _0814F27C - .4byte _0814F298 - .4byte _0814F2C0 - .4byte _0814F300 - .4byte _0814F330 - .4byte _0814F3C4 - .4byte _0814F410 - .4byte _0814F418 - .4byte _0814F3E4 - .4byte _0814F3EC - .4byte _0814F43C - .4byte _0814F444 - .4byte _0814F468 - .4byte _0814F4B8 - .4byte _0814F508 - .4byte _0814F548 - .4byte _0814F594 - .4byte _0814F5B4 - .4byte _0814E8E4 -_0814E8A0: - ldr r5, =gBattleTextBuff1 - ldrb r0, [r5] - cmp r0, 0xFD - bne _0814E8B8 - ldr r4, =gStringVar1 - adds r0, r5, 0 - b _0814E8F0 - .pool -_0814E8B8: - adds r0, r5, 0 - bl AppendStatusString - adds r4, r0, 0 - cmp r4, 0 - beq _0814E8C8 - bl _0814F5C0 -_0814E8C8: - adds r4, r5, 0 - bl _0814F5C0 -_0814E8CE: - ldr r1, =gBattleTextBuff2 - ldrb r0, [r1] - cmp r0, 0xFD - bne _0814E904 - ldr r4, =gStringVar2 - b _0814E8EE - .pool -_0814E8E4: - ldr r1, =gBattleTextBuff3 - ldrb r0, [r1] - cmp r0, 0xFD - bne _0814E904 - ldr r4, =gStringVar3 -_0814E8EE: - adds r0, r1, 0 -_0814E8F0: - adds r1, r4, 0 - bl ExpandBattleTextBuffPlaceholders - bl _0814F5C0 - .pool -_0814E904: - adds r4, r1, 0 - bl _0814F5C0 -_0814E90A: - ldr r4, =gStringVar1 - bl _0814F5C0 - .pool -_0814E914: - ldr r4, =gStringVar2 - bl _0814F5C0 - .pool -_0814E920: - ldr r4, =gStringVar3 - bl _0814F5C0 - .pool -_0814E92C: - movs r0, 0 - bl GetBankByIdentity - ldr r1, =gBattlePartyID - lsls r0, 24 - lsrs r0, 23 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0x2 - mov r2, sp - bl GetMonData - mov r0, sp - bl StringGetEnd10 - bl _0814F5BE - .pool -_0814E960: - movs r0, 0x1 - bl GetBankByIdentity - ldr r1, =gBattlePartyID - lsls r0, 24 - lsrs r0, 23 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =gEnemyParty - adds r0, r1 - movs r1, 0x2 - mov r2, sp - bl GetMonData - mov r0, sp - bl StringGetEnd10 - bl _0814F5BE - .pool -_0814E994: - movs r0, 0x2 - bl GetBankByIdentity - ldr r1, =gBattlePartyID - lsls r0, 24 - lsrs r0, 23 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0x2 - mov r2, sp - bl GetMonData - mov r0, sp - bl StringGetEnd10 - bl _0814F5BE - .pool -_0814E9C8: - movs r0, 0x3 - bl GetBankByIdentity - ldr r1, =gBattlePartyID - lsls r0, 24 - lsrs r0, 23 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =gEnemyParty - adds r0, r1 - movs r1, 0x2 - mov r2, sp - bl GetMonData - mov r0, sp - bl StringGetEnd10 - bl _0814F5BE - .pool -_0814E9FC: - ldr r2, =gBattlePartyID - ldr r1, =gLinkPlayers - lsls r0, r7, 3 - subs r0, r7 - lsls r0, 2 - adds r0, r1 - ldrh r0, [r0, 0x18] - lsls r0, 1 - adds r0, r2 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0x2 - mov r2, sp - bl GetMonData - mov r0, sp - bl StringGetEnd10 - bl _0814F5BE - .pool -_0814EA38: - ldr r2, =gBattlePartyID - ldr r1, =gLinkPlayers - lsls r0, r7, 3 - subs r0, r7 - lsls r0, 2 - adds r0, r1 - ldrh r1, [r0, 0x18] - movs r0, 0x1 - eors r0, r1 - lsls r0, 1 - adds r0, r2 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =gEnemyParty - adds r0, r1 - movs r1, 0x2 - mov r2, sp - bl GetMonData - mov r0, sp - bl StringGetEnd10 - bl _0814F5BE - .pool -_0814EA78: - ldr r2, =gBattlePartyID - ldr r1, =gLinkPlayers - lsls r0, r7, 3 - subs r0, r7 - lsls r0, 2 - adds r0, r1 - ldrh r1, [r0, 0x18] - movs r0, 0x2 - eors r0, r1 - lsls r0, 1 - adds r0, r2 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0x2 - mov r2, sp - bl GetMonData - mov r0, sp - bl StringGetEnd10 - bl _0814F5BE - .pool -_0814EAB8: - ldr r2, =gBattlePartyID - ldr r1, =gLinkPlayers - lsls r0, r7, 3 - subs r0, r7 - lsls r0, 2 - adds r0, r1 - ldrh r1, [r0, 0x18] - movs r0, 0x3 - eors r0, r1 - lsls r0, 1 - adds r0, r2 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =gEnemyParty - adds r0, r1 - movs r1, 0x2 - mov r2, sp - bl GetMonData - mov r0, sp - bl StringGetEnd10 - bl _0814F5BE - .pool -_0814EAF8: - ldr r4, =gBankAttacker - ldrb r0, [r4] - bl GetBankSide - lsls r0, 24 - adds r2, r4, 0 - cmp r0, 0 - beq _0814EB74 - ldr r0, =gBattleTypeFlags - ldr r1, [r0] - movs r0, 0x8 - ands r1, r0 - ldr r4, =gText_WildPkmnPrefix - cmp r1, 0 - beq _0814EB36 - ldr r4, =gText_FoePkmnPrefix - b _0814EB36 - .pool -_0814EB2C: - mov r3, r8 - adds r0, r3, r6 - strb r1, [r0] - adds r6, 0x1 - adds r4, 0x1 -_0814EB36: - ldrb r1, [r4] - adds r0, r1, 0 - cmp r0, 0xFF - bne _0814EB2C - ldrb r0, [r2] - bl GetBankIdentity - adds r1, r0, 0 - movs r0, 0x1 - ands r0, r1 - bl GetBankByIdentity - ldr r1, =gBattlePartyID - lsls r0, 24 - lsrs r0, 23 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =gEnemyParty - adds r0, r1 - movs r1, 0x2 - mov r2, sp - bl GetMonData - b _0814EB9E - .pool -_0814EB74: - ldrb r0, [r2] - bl GetBankIdentity - adds r1, r0, 0 - movs r0, 0x1 - ands r0, r1 - bl GetBankByIdentity - ldr r1, =gBattlePartyID - lsls r0, 24 - lsrs r0, 23 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0x2 - mov r2, sp - bl GetMonData -_0814EB9E: - mov r0, sp - bl StringGetEnd10 - bl _0814F5BE - .pool -_0814EBB0: - ldr r4, =gBankAttacker - ldrb r0, [r4] - bl GetBankSide - lsls r0, 24 - cmp r0, 0 - bne _0814EBF8 - ldrb r0, [r4] - bl GetBankIdentity - adds r1, r0, 0 - movs r0, 0x1 - ands r0, r1 - bl GetBankByIdentity - ldr r1, =gBattlePartyID - lsls r0, 24 - lsrs r0, 23 - adds r0, 0x4 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0x2 - mov r2, sp - bl GetMonData - b _0814EC24 - .pool -_0814EBF8: - ldrb r0, [r4] - bl GetBankIdentity - adds r1, r0, 0 - movs r0, 0x1 - ands r0, r1 - bl GetBankByIdentity - ldr r1, =gBattlePartyID - lsls r0, 24 - lsrs r0, 23 - adds r0, 0x4 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =gEnemyParty - adds r0, r1 - movs r1, 0x2 - mov r2, sp - bl GetMonData -_0814EC24: - mov r0, sp - bl StringGetEnd10 - bl _0814F5BE - .pool -_0814EC38: - ldr r5, =gBankAttacker - ldrb r0, [r5] - bl GetBankSide - lsls r0, 24 - cmp r0, 0 - beq _0814ECA8 - ldr r0, =gBattleTypeFlags - ldr r1, [r0] - movs r0, 0x8 - ands r1, r0 - ldr r4, =gText_WildPkmnPrefix - cmp r1, 0 - beq _0814EC56 - ldr r4, =gText_FoePkmnPrefix -_0814EC56: - ldrb r1, [r4] - adds r0, r1, 0 - ldr r3, =gBattlePartyID - ldr r2, =gEnemyParty - mov r12, r2 - adds r2, r5, 0 - cmp r0, 0xFF - beq _0814EC78 -_0814EC66: - mov r5, r8 - adds r0, r5, r6 - strb r1, [r0] - adds r6, 0x1 - adds r4, 0x1 - ldrb r1, [r4] - adds r0, r1, 0 - cmp r0, 0xFF - bne _0814EC66 -_0814EC78: - ldrb r0, [r2] - lsls r0, 1 - adds r0, r3 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - add r0, r12 - movs r1, 0x2 - mov r2, sp - bl GetMonData - b _0814ECC2 - .pool -_0814ECA8: - ldr r1, =gBattlePartyID - ldrb r0, [r5] - lsls r0, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0x2 - mov r2, sp - bl GetMonData -_0814ECC2: - mov r0, sp - bl StringGetEnd10 - bl _0814F5BE - .pool -_0814ECD4: - ldr r5, =gBankTarget - ldrb r0, [r5] - bl GetBankSide - lsls r0, 24 - cmp r0, 0 - beq _0814ED44 - ldr r0, =gBattleTypeFlags - ldr r1, [r0] - movs r0, 0x8 - ands r1, r0 - ldr r4, =gText_WildPkmnPrefix - cmp r1, 0 - beq _0814ECF2 - ldr r4, =gText_FoePkmnPrefix -_0814ECF2: - ldrb r1, [r4] - adds r0, r1, 0 - ldr r3, =gBattlePartyID - ldr r2, =gEnemyParty - mov r12, r2 - adds r2, r5, 0 - cmp r0, 0xFF - beq _0814ED14 -_0814ED02: - mov r5, r8 - adds r0, r5, r6 - strb r1, [r0] - adds r6, 0x1 - adds r4, 0x1 - ldrb r1, [r4] - adds r0, r1, 0 - cmp r0, 0xFF - bne _0814ED02 -_0814ED14: - ldrb r0, [r2] - lsls r0, 1 - adds r0, r3 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - add r0, r12 - movs r1, 0x2 - mov r2, sp - bl GetMonData - b _0814ED5E - .pool -_0814ED44: - ldr r1, =gBattlePartyID - ldrb r0, [r5] - lsls r0, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0x2 - mov r2, sp - bl GetMonData -_0814ED5E: - mov r0, sp - bl StringGetEnd10 - bl _0814F5BE - .pool -_0814ED70: - ldr r5, =gEffectBank - ldrb r0, [r5] - bl GetBankSide - lsls r0, 24 - cmp r0, 0 - beq _0814EDE0 - ldr r0, =gBattleTypeFlags - ldr r1, [r0] - movs r0, 0x8 - ands r1, r0 - ldr r4, =gText_WildPkmnPrefix - cmp r1, 0 - beq _0814ED8E - ldr r4, =gText_FoePkmnPrefix -_0814ED8E: - ldrb r1, [r4] - adds r0, r1, 0 - ldr r3, =gBattlePartyID - ldr r2, =gEnemyParty - mov r12, r2 - adds r2, r5, 0 - cmp r0, 0xFF - beq _0814EDB0 -_0814ED9E: - mov r5, r8 - adds r0, r5, r6 - strb r1, [r0] - adds r6, 0x1 - adds r4, 0x1 - ldrb r1, [r4] - adds r0, r1, 0 - cmp r0, 0xFF - bne _0814ED9E -_0814EDB0: - ldrb r0, [r2] - lsls r0, 1 - adds r0, r3 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - add r0, r12 - movs r1, 0x2 - mov r2, sp - bl GetMonData - b _0814EDFA - .pool -_0814EDE0: - ldr r1, =gBattlePartyID - ldrb r0, [r5] - lsls r0, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0x2 - mov r2, sp - bl GetMonData -_0814EDFA: - mov r0, sp - bl StringGetEnd10 - bl _0814F5BE - .pool -_0814EE0C: - ldr r5, =gActiveBank - ldrb r0, [r5] - bl GetBankSide - lsls r0, 24 - cmp r0, 0 - beq _0814EE7C - ldr r0, =gBattleTypeFlags - ldr r1, [r0] - movs r0, 0x8 - ands r1, r0 - ldr r4, =gText_WildPkmnPrefix - cmp r1, 0 - beq _0814EE2A - ldr r4, =gText_FoePkmnPrefix -_0814EE2A: - ldrb r1, [r4] - adds r0, r1, 0 - ldr r3, =gBattlePartyID - ldr r2, =gEnemyParty - mov r12, r2 - adds r2, r5, 0 - cmp r0, 0xFF - beq _0814EE4C -_0814EE3A: - mov r5, r8 - adds r0, r5, r6 - strb r1, [r0] - adds r6, 0x1 - adds r4, 0x1 - ldrb r1, [r4] - adds r0, r1, 0 - cmp r0, 0xFF - bne _0814EE3A -_0814EE4C: - ldrb r0, [r2] - lsls r0, 1 - adds r0, r3 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - add r0, r12 - movs r1, 0x2 - mov r2, sp - bl GetMonData - b _0814EE96 - .pool -_0814EE7C: - ldr r1, =gBattlePartyID - ldrb r0, [r5] - lsls r0, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0x2 - mov r2, sp - bl GetMonData -_0814EE96: - mov r0, sp - bl StringGetEnd10 - b _0814F5BE - .pool -_0814EEA8: - ldr r5, =gBattleScripting - ldrb r0, [r5, 0x17] - bl GetBankSide - lsls r0, 24 - cmp r0, 0 - beq _0814EF18 - ldr r0, =gBattleTypeFlags - ldr r1, [r0] - movs r0, 0x8 - ands r1, r0 - ldr r4, =gText_WildPkmnPrefix - cmp r1, 0 - beq _0814EEC6 - ldr r4, =gText_FoePkmnPrefix -_0814EEC6: - ldrb r1, [r4] - adds r0, r1, 0 - ldr r3, =gBattlePartyID - ldr r2, =gEnemyParty - mov r12, r2 - adds r2, r5, 0 - cmp r0, 0xFF - beq _0814EEE8 -_0814EED6: - mov r5, r8 - adds r0, r5, r6 - strb r1, [r0] - adds r6, 0x1 - adds r4, 0x1 - ldrb r1, [r4] - adds r0, r1, 0 - cmp r0, 0xFF - bne _0814EED6 -_0814EEE8: - ldrb r0, [r2, 0x17] - lsls r0, 1 - adds r0, r3 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - add r0, r12 - movs r1, 0x2 - mov r2, sp - bl GetMonData - b _0814EF32 - .pool -_0814EF18: - ldr r1, =gBattlePartyID - ldrb r0, [r5, 0x17] - lsls r0, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0x2 - mov r2, sp - bl GetMonData -_0814EF32: - mov r0, sp - bl StringGetEnd10 - b _0814F5BE - .pool -_0814EF44: - ldr r0, =gStringInfo - ldr r2, [r0] - ldrh r1, [r2] - movs r0, 0xB1 - lsls r0, 1 - cmp r1, r0 - bhi _0814EF6A - ldrh r1, [r2] - b _0814EF8A - .pool -_0814EF5C: - ldr r0, =gStringInfo - ldr r2, [r0] - ldrh r1, [r2, 0x2] - movs r0, 0xB1 - lsls r0, 1 - cmp r1, r0 - bls _0814EF88 -_0814EF6A: - ldr r0, =gBattleStruct - ldr r0, [r0] - adds r0, 0x8E - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - ldr r1, =gText_UnknownMoveTypes - adds r4, r0, r1 - b _0814F5C0 - .pool -_0814EF88: - ldrh r1, [r2, 0x2] -_0814EF8A: - movs r0, 0xD - muls r1, r0 - ldr r0, =gMoveNames - adds r4, r1, r0 - b _0814F5C0 - .pool -_0814EF98: - ldr r0, =gBattleTypeFlags - ldr r1, [r0] - ldr r0, =0x02000002 - ands r0, r1 - cmp r0, 0 - beq _0814F06E - ldr r2, =gLastUsedItem - ldrh r0, [r2] - cmp r0, 0xAF - bne _0814F064 - movs r0, 0x40 - ands r1, r0 - cmp r1, 0 - bne _0814F014 - ldr r0, =gBattleScripting - adds r0, 0x25 - ldrb r0, [r0] - cmp r0, 0 - beq _0814EFE0 - ldr r2, =gStringBank - ldrb r1, [r2] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _0814EFEC - b _0814F05C - .pool -_0814EFE0: - ldr r2, =gStringBank - ldrb r1, [r2] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _0814F05C -_0814EFEC: - ldrb r0, [r2] - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - ldr r0, =gEnigmaBerries - adds r1, r0 - mov r0, sp - bl StringCopy - ldr r1, =gText_BerrySuffix - mov r0, sp - bl StringAppend - b _0814F5BE - .pool -_0814F014: - ldr r2, =gLinkPlayers - ldr r0, =gBattleScripting - adds r0, 0x25 - ldrb r1, [r0] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r2 - ldr r1, =gStringBank - ldrb r2, [r1] - ldrh r0, [r0, 0x18] - cmp r0, r2 - bne _0814F05C - lsls r1, r2, 3 - subs r1, r2 - lsls r1, 2 - ldr r0, =gEnigmaBerries - adds r1, r0 - mov r0, sp - bl StringCopy - ldr r1, =gText_BerrySuffix - mov r0, sp - bl StringAppend - b _0814F5BE - .pool -_0814F05C: - ldr r4, =gText_EnigmaBerry - b _0814F5C0 - .pool -_0814F064: - ldrh r0, [r2] - mov r1, sp - bl CopyItemName - b _0814F5BE -_0814F06E: - ldr r0, =gLastUsedItem - ldrh r0, [r0] - mov r1, sp - bl CopyItemName - b _0814F5BE - .pool -_0814F080: - ldr r0, =gLastUsedAbility - b _0814F0C0 - .pool -_0814F088: - ldr r1, =gAbilitiesPerBank - ldr r0, =gBankAttacker - b _0814F0BC - .pool -_0814F098: - ldr r1, =gAbilitiesPerBank - ldr r0, =gBankTarget - b _0814F0BC - .pool -_0814F0A8: - ldr r1, =gAbilitiesPerBank - ldr r0, =gBattleScripting - ldrb r0, [r0, 0x17] - b _0814F0BE - .pool -_0814F0B8: - ldr r1, =gAbilitiesPerBank - ldr r0, =gEffectBank -_0814F0BC: - ldrb r0, [r0] -_0814F0BE: - adds r0, r1 -_0814F0C0: - ldrb r1, [r0] - movs r0, 0xD - muls r1, r0 - ldr r0, =gAbilityNames - adds r4, r1, r0 - b _0814F5C0 - .pool -_0814F0D8: - ldr r0, =gBattleTypeFlags - ldr r1, [r0] - movs r0, 0x80 - lsls r0, 20 - ands r0, r1 - cmp r0, 0 - beq _0814F0F0 - bl GetSecretBaseTrainerNameIndex - b _0814F59C - .pool -_0814F0F0: - ldr r3, =gTrainerBattleOpponent_A - ldrh r2, [r3] - movs r0, 0xC0 - lsls r0, 4 - cmp r2, r0 - bne _0814F10C - bl sub_8068BB0 - lsls r0, 16 - lsrs r0, 16 - b _0814F5A0 - .pool -_0814F10C: - ldr r0, =0x000003fe - cmp r2, r0 - bne _0814F11C - bl sub_81A4D00 - b _0814F59C - .pool -_0814F11C: - ldr r0, =0x003f0100 - ands r0, r1 - cmp r0, 0 - beq _0814F12C - ldrh r0, [r3] - b _0814F598 - .pool -_0814F12C: - movs r0, 0x80 - lsls r0, 19 - ands r0, r1 - cmp r0, 0 - beq _0814F13E - ldrh r0, [r3] - bl sub_81D5530 - b _0814F59C -_0814F13E: - movs r0, 0x80 - lsls r0, 4 - ands r1, r0 - cmp r1, 0 - beq _0814F14E - bl sub_8165264 - b _0814F59C -_0814F14E: - ldr r2, =gTrainers - ldrh r1, [r3] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - ldrb r1, [r0, 0x1] - movs r0, 0xD - b _0814F5A2 - .pool -_0814F164: - ldr r0, =gBattleTypeFlags - ldr r1, [r0] - movs r0, 0x80 - lsls r0, 20 - ands r0, r1 - cmp r0, 0 - beq _0814F1AC - movs r2, 0 - ldr r4, =gBattleResources - ldr r3, [r4] -_0814F178: - mov r1, sp - adds r0, r1, r2 - ldr r1, [r3] - adds r1, 0x2 - adds r1, r2 - ldrb r1, [r1] - strb r1, [r0] - adds r2, 0x1 - cmp r2, 0x6 - ble _0814F178 - mov r3, sp - adds r1, r3, r2 - movs r0, 0xFF - strb r0, [r1] - ldr r0, [r4] - ldr r0, [r0] - ldrb r1, [r0, 0xD] - mov r0, sp - bl ConvertInternationalString - b _0814F5BE - .pool -_0814F1AC: - ldr r3, =gTrainerBattleOpponent_A - ldrh r2, [r3] - movs r0, 0xC0 - lsls r0, 4 - cmp r2, r0 - bne _0814F1C4 - movs r1, 0x1 - adds r0, r7, 0 - eors r0, r1 - b _0814F284 - .pool -_0814F1C4: - ldr r0, =0x000003fe - cmp r2, r0 - bne _0814F1D8 - mov r0, sp - bl sub_81A4D50 - b _0814F5BE - .pool -_0814F1D8: - ldr r0, =0x003f0100 - ands r0, r1 - cmp r0, 0 - beq _0814F1E8 - ldrh r1, [r3] - b _0814F5B8 - .pool -_0814F1E8: - movs r0, 0x80 - lsls r0, 19 - ands r0, r1 - cmp r0, 0 - beq _0814F1FC - ldrh r1, [r3] - mov r0, sp - bl sub_81D5554 - b _0814F5BE -_0814F1FC: - movs r0, 0x80 - lsls r0, 4 - ands r1, r0 - cmp r1, 0 - beq _0814F20E - mov r0, sp - bl sub_8165284 - b _0814F5BE -_0814F20E: - ldrh r0, [r3] - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =gTrainers + 0x4 @ name offset - adds r4, r1, r0 - b _0814F5C0 - .pool -_0814F220: - lsls r0, r7, 3 - subs r0, r7 - lsls r0, 2 - ldr r1, =gLinkPlayers + 8 - adds r4, r0, r1 - b _0814F5C0 - .pool -_0814F230: - ldr r4, =gLinkPlayers - lsls r0, r7, 3 - subs r0, r7 - lsls r0, 2 - adds r0, r4 - ldrh r1, [r0, 0x18] - movs r0, 0x2 - b _0814F266 - .pool -_0814F244: - ldr r4, =gLinkPlayers - lsls r0, r7, 3 - subs r0, r7 - lsls r0, 2 - adds r0, r4 - ldrh r1, [r0, 0x18] - movs r0, 0x1 - b _0814F266 - .pool -_0814F258: - ldr r4, =gLinkPlayers - lsls r0, r7, 3 - subs r0, r7 - lsls r0, 2 - adds r0, r4 - ldrh r1, [r0, 0x18] - movs r0, 0x3 -_0814F266: - eors r0, r1 - bl sub_806D864 - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r4, 0x8 - adds r4, r1, r4 - b _0814F5C0 - .pool -_0814F27C: - ldr r0, =gBattleScripting - ldrb r0, [r0, 0x17] - bl sub_806D864 -_0814F284: - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - ldr r0, =gLinkPlayers + 8 - adds r4, r1, r0 - b _0814F5C0 - .pool -_0814F298: - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 17 - ands r0, r1 - cmp r0, 0 - beq _0814F2B4 - ldr r4, =gLinkPlayers + 8 - b _0814F5C0 - .pool -_0814F2B4: - ldr r0, =gSaveBlock2Ptr - ldr r4, [r0] - b _0814F5C0 - .pool -_0814F2C0: - ldr r0, =gBattleTypeFlags - ldr r1, [r0] - ldr r0, =0x003f0100 - ands r0, r1 - cmp r0, 0 - beq _0814F2E0 - ldr r0, =gTrainerBattleOpponent_A - ldrh r1, [r0] - movs r0, 0x2 - b _0814F55A - .pool -_0814F2E0: - movs r0, 0x80 - lsls r0, 19 - ands r1, r0 - cmp r1, 0 - beq _0814F2F8 - ldr r0, =gTrainerBattleOpponent_A - ldrh r1, [r0] - movs r0, 0x4 - b _0814F584 - .pool -_0814F2F8: - bl sub_80B1CA4 - adds r4, r0, 0 - b _0814F5C0 -_0814F300: - ldr r0, =gBattleTypeFlags - ldr r1, [r0] - ldr r0, =0x003f0100 - ands r0, r1 - cmp r0, 0 - beq _0814F31C - ldr r0, =gTrainerBattleOpponent_A - b _0814F556 - .pool -_0814F31C: - movs r0, 0x80 - lsls r0, 19 - ands r1, r0 - cmp r1, 0 - bne _0814F328 - b _0814F5C0 -_0814F328: - ldr r0, =gTrainerBattleOpponent_A - b _0814F580 - .pool -_0814F330: - ldr r0, =gBattleScripting - ldrb r0, [r0, 0x17] - bl GetBankSide - lsls r0, 24 - cmp r0, 0 - beq _0814F39C - ldr r0, =gBattleTypeFlags - ldr r1, [r0] - movs r0, 0x8 - ands r1, r0 - ldr r4, =gText_WildPkmnPrefix - cmp r1, 0 - beq _0814F34E - ldr r4, =gText_FoePkmnPrefix -_0814F34E: - ldrb r1, [r4] - adds r0, r1, 0 - ldr r5, =gEnemyParty - mov r12, r5 - ldr r2, =gBattleStruct - cmp r0, 0xFF - beq _0814F36E -_0814F35C: - mov r3, r8 - adds r0, r3, r6 - strb r1, [r0] - adds r6, 0x1 - adds r4, 0x1 - ldrb r1, [r4] - adds r0, r1, 0 - cmp r0, 0xFF - bne _0814F35C -_0814F36E: - ldr r0, [r2] - adds r0, 0x52 - ldrb r1, [r0] - movs r0, 0x64 - muls r0, r1 - add r0, r12 - movs r1, 0x2 - mov r2, sp - bl GetMonData - b _0814F3B4 - .pool -_0814F39C: - ldr r0, =gBattleStruct - ldr r0, [r0] - adds r0, 0x52 - ldrb r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0x2 - mov r2, sp - bl GetMonData -_0814F3B4: - mov r0, sp - bl StringGetEnd10 - b _0814F5BE - .pool -_0814F3C4: - ldr r0, =0x000008ab - bl FlagGet - lsls r0, 24 - ldr r4, =gText_Someones - cmp r0, 0 - bne _0814F3D4 - b _0814F5C0 -_0814F3D4: - ldr r4, =gText_Lanettes - b _0814F5C0 - .pool -_0814F3E4: - ldr r0, =gBankAttacker - b _0814F3EE - .pool -_0814F3EC: - ldr r0, =gBankTarget -_0814F3EE: - ldrb r0, [r0] - bl GetBankSide - lsls r0, 24 - ldr r4, =gText_FoePkmnPrefix3 - cmp r0, 0 - beq _0814F3FE - b _0814F5C0 -_0814F3FE: - ldr r4, =gText_AllyPkmnPrefix2 - b _0814F5C0 - .pool -_0814F410: - ldr r0, =gBankAttacker - b _0814F41A - .pool -_0814F418: - ldr r0, =gBankTarget -_0814F41A: - ldrb r0, [r0] - bl GetBankSide - lsls r0, 24 - ldr r4, =gText_FoePkmnPrefix2 - cmp r0, 0 - beq _0814F42A - b _0814F5C0 -_0814F42A: - ldr r4, =gText_AllyPkmnPrefix - b _0814F5C0 - .pool -_0814F43C: - ldr r0, =gBankAttacker - b _0814F446 - .pool -_0814F444: - ldr r0, =gBankTarget -_0814F446: - ldrb r0, [r0] - bl GetBankSide - lsls r0, 24 - ldr r4, =gText_FoePkmnPrefix4 - cmp r0, 0 - beq _0814F456 - b _0814F5C0 -_0814F456: - ldr r4, =gText_AllyPkmnPrefix3 - b _0814F5C0 - .pool -_0814F468: - ldr r0, =gBattleTypeFlags - ldr r1, [r0] - ldr r0, =0x003f0100 - ands r0, r1 - cmp r0, 0 - beq _0814F484 - ldr r0, =gTrainerBattleOpponent_B - b _0814F596 - .pool -_0814F484: - movs r0, 0x80 - lsls r0, 19 - ands r1, r0 - cmp r1, 0 - beq _0814F49C - ldr r0, =gTrainerBattleOpponent_B - ldrh r0, [r0] - bl sub_81D5530 - b _0814F59C - .pool -_0814F49C: - ldr r2, =gTrainers - ldr r0, =gTrainerBattleOpponent_B - ldrh r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - ldrb r1, [r0, 0x1] - movs r0, 0xD - b _0814F5A2 - .pool -_0814F4B8: - ldr r0, =gBattleTypeFlags - ldr r1, [r0] - ldr r0, =0x003f0100 - ands r0, r1 - cmp r0, 0 - beq _0814F4D4 - ldr r0, =gTrainerBattleOpponent_B - b _0814F5B6 - .pool -_0814F4D4: - movs r0, 0x80 - lsls r0, 19 - ands r1, r0 - cmp r1, 0 - beq _0814F4F0 - ldr r0, =gTrainerBattleOpponent_B - ldrh r1, [r0] - mov r0, sp - bl sub_81D5554 - b _0814F5BE - .pool -_0814F4F0: - ldr r0, =gTrainerBattleOpponent_B - ldrh r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - ldr r1, =gTrainers + 0x4 @ name offset - adds r4, r0, r1 - b _0814F5C0 - .pool -_0814F508: - ldr r0, =gBattleTypeFlags - ldr r1, [r0] - ldr r0, =0x003f0100 - ands r0, r1 - cmp r0, 0 - beq _0814F528 - ldr r0, =gTrainerBattleOpponent_B - ldrh r1, [r0] - movs r0, 0x2 - b _0814F55A - .pool -_0814F528: - movs r0, 0x80 - lsls r0, 19 - ands r1, r0 - cmp r1, 0 - beq _0814F540 - ldr r0, =gTrainerBattleOpponent_B - ldrh r1, [r0] - movs r0, 0x4 - b _0814F584 - .pool -_0814F540: - bl sub_80B1CE0 - adds r4, r0, 0 - b _0814F5C0 -_0814F548: - ldr r0, =gBattleTypeFlags - ldr r1, [r0] - ldr r0, =0x003f0100 - ands r0, r1 - cmp r0, 0 - beq _0814F574 - ldr r0, =gTrainerBattleOpponent_B -_0814F556: - ldrh r1, [r0] - movs r0, 0x1 -_0814F55A: - bl sub_81A36D0 - ldr r4, =gStringVar4 - b _0814F5C0 - .pool -_0814F574: - movs r0, 0x80 - lsls r0, 19 - ands r1, r0 - cmp r1, 0 - beq _0814F5C0 - ldr r0, =gTrainerBattleOpponent_B -_0814F580: - ldrh r1, [r0] - movs r0, 0x3 -_0814F584: - bl sub_81D572C - ldr r4, =gStringVar4 - b _0814F5C0 - .pool -_0814F594: - ldr r0, =gPartnerTrainerId -_0814F596: - ldrh r0, [r0] -_0814F598: - bl GetFrontierOpponentClass -_0814F59C: - lsls r0, 24 - lsrs r0, 24 -_0814F5A0: - movs r1, 0xD -_0814F5A2: - muls r1, r0 - ldr r0, =gTrainerClassNames - adds r4, r1, r0 - b _0814F5C0 - .pool -_0814F5B4: - ldr r0, =gPartnerTrainerId -_0814F5B6: - ldrh r1, [r0] -_0814F5B8: - mov r0, sp - bl GetFrontierTrainerName -_0814F5BE: - mov r4, sp -_0814F5C0: - ldrb r1, [r4] - adds r0, r1, 0 - mov r5, r9 - ldrb r2, [r5] - mov r3, r9 - adds r3, 0x1 - cmp r0, 0xFF - beq _0814F5E2 -_0814F5D0: - mov r5, r8 - adds r0, r5, r6 - strb r1, [r0] - adds r6, 0x1 - adds r4, 0x1 - ldrb r1, [r4] - adds r0, r1, 0 - cmp r0, 0xFF - bne _0814F5D0 -_0814F5E2: - lsls r0, r2, 24 - lsrs r0, 24 - cmp r0, 0x24 - beq _0814F5F6 - cmp r0, 0x30 - beq _0814F5F6 - cmp r0, 0x25 - beq _0814F5F6 - cmp r0, 0x31 - bne _0814F61C -_0814F5F6: - mov r0, r8 - adds r1, r0, r6 - movs r0, 0xFC - strb r0, [r1] - adds r6, 0x1 - mov r2, r8 - adds r1, r2, r6 - movs r0, 0x9 - strb r0, [r1] - adds r6, 0x1 - b _0814F61C - .pool -_0814F610: - mov r3, r8 - adds r0, r3, r6 - strb r1, [r0] - adds r6, 0x1 - mov r3, r9 - adds r3, 0x1 -_0814F61C: - mov r9, r3 - ldrb r1, [r3] -_0814F620: - adds r0, r1, 0 - cmp r0, 0xFF - beq _0814F62A - bl _0814E7A4 -_0814F62A: - mov r5, r8 - adds r1, r5, r6 - mov r2, r9 - ldrb r0, [r2] - strb r0, [r1] - adds r6, 0x1 - adds r0, r6, 0 - add sp, 0x20 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end BattleStringExpandPlaceholders - - thumb_func_start ExpandBattleTextBuffPlaceholders -ExpandBattleTextBuffPlaceholders: @ 814F648 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0xC - adds r7, r0, 0 - adds r6, r1, 0 - movs r5, 0x1 - movs r0, 0 - mov r8, r0 - movs r0, 0xFF - strb r0, [r6] - ldrb r0, [r7, 0x1] - cmp r0, 0xFF - bne _0814F666 - b _0814F8EA -_0814F666: - adds r0, r7, r5 - ldrb r1, [r0] - adds r4, r0, 0 - cmp r1, 0xA - bls _0814F672 - b _0814F8E0 -_0814F672: - lsls r0, r1, 2 - ldr r1, =_0814F680 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0814F680: - .4byte _0814F6AC - .4byte _0814F6C8 - .4byte _0814F71C - .4byte _0814F734 - .4byte _0814F744 - .4byte _0814F7BC - .4byte _0814F7D0 - .4byte _0814F7E2 - .4byte _0814F828 - .4byte _0814F83C - .4byte _0814F858 -_0814F6AC: - adds r0, r5, r7 - ldrb r1, [r0, 0x1] - ldrb r0, [r0, 0x2] - lsls r0, 8 - orrs r1, r0 - ldr r0, =gBattleStringsTable - subs r1, 0xC - lsls r1, 2 - adds r1, r0 - ldr r1, [r1] - b _0814F8BE - .pool -_0814F6C8: - ldrb r0, [r4, 0x1] - cmp r0, 0x2 - beq _0814F6E4 - cmp r0, 0x2 - bgt _0814F6D8 - cmp r0, 0x1 - beq _0814F6DE - b _0814F706 -_0814F6D8: - cmp r0, 0x4 - beq _0814F6EC - b _0814F706 -_0814F6DE: - ldrb r4, [r4, 0x3] - mov r8, r4 - b _0814F706 -_0814F6E4: - ldrb r1, [r4, 0x3] - ldrb r0, [r4, 0x4] - lsls r0, 8 - b _0814F702 -_0814F6EC: - ldrb r0, [r4, 0x3] - mov r8, r0 - ldrb r0, [r4, 0x4] - lsls r0, 8 - mov r1, r8 - orrs r1, r0 - ldrb r0, [r4, 0x5] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r4, 0x6] - lsls r0, 24 -_0814F702: - orrs r1, r0 - mov r8, r1 -_0814F706: - adds r4, r5, r7 - ldrb r3, [r4, 0x2] - adds r0, r6, 0 - mov r1, r8 - movs r2, 0 - bl ConvertIntToDecimalStringN - adds r0, r5, 0x3 - ldrb r4, [r4, 0x1] - adds r5, r0, r4 - b _0814F8E0 -_0814F71C: - adds r0, r5, r7 - ldrb r1, [r0, 0x1] - ldrb r0, [r0, 0x2] - lsls r0, 8 - orrs r1, r0 - movs r0, 0xD - muls r1, r0 - ldr r0, =gMoveNames - adds r1, r0 - b _0814F8BE - .pool -_0814F734: - adds r0, r5, r7 - ldrb r0, [r0, 0x1] - lsls r1, r0, 3 - subs r1, r0 - ldr r0, =gTypeNames - b _0814F846 - .pool -_0814F744: - ldrb r0, [r4, 0x1] - bl GetBankSide - lsls r0, 24 - cmp r0, 0 - bne _0814F768 - ldrb r1, [r4, 0x2] - movs r0, 0x64 - muls r0, r1 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0x2 - mov r2, sp - bl GetMonData - b _0814F7A4 - .pool -_0814F768: - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - movs r1, 0x8 - ands r0, r1 - cmp r0, 0 - beq _0814F788 - ldr r1, =gText_FoePkmnPrefix - adds r0, r6, 0 - bl StringAppend - b _0814F790 - .pool -_0814F788: - ldr r1, =gText_WildPkmnPrefix - adds r0, r6, 0 - bl StringAppend -_0814F790: - adds r0, r5, r7 - ldrb r1, [r0, 0x2] - movs r0, 0x64 - muls r0, r1 - ldr r1, =gEnemyParty - adds r0, r1 - movs r1, 0x2 - mov r2, sp - bl GetMonData -_0814F7A4: - mov r0, sp - bl StringGetEnd10 - adds r0, r6, 0 - mov r1, sp - bl StringAppend - b _0814F8DE - .pool -_0814F7BC: - ldr r1, =gStatNamesTable - adds r0, r5, r7 - ldrb r0, [r0, 0x1] - lsls r0, 2 - adds r0, r1 - ldr r1, [r0] - b _0814F848 - .pool -_0814F7D0: - adds r0, r5, r7 - ldrb r1, [r0, 0x1] - ldrb r0, [r0, 0x2] - lsls r0, 8 - orrs r1, r0 - adds r0, r6, 0 - bl GetSpeciesName - b _0814F8DE -_0814F7E2: - adds r4, r5, r7 - ldrb r0, [r4, 0x1] - bl GetBankSide - lsls r0, 24 - cmp r0, 0 - bne _0814F808 - ldrb r1, [r4, 0x2] - movs r0, 0x64 - muls r0, r1 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0x2 - adds r2, r6, 0 - bl GetMonData - b _0814F81A - .pool -_0814F808: - ldrb r1, [r4, 0x2] - movs r0, 0x64 - muls r0, r1 - ldr r1, =gEnemyParty - adds r0, r1 - movs r1, 0x2 - adds r2, r6, 0 - bl GetMonData -_0814F81A: - adds r0, r6, 0 - bl StringGetEnd10 - b _0814F8DE - .pool -_0814F828: - ldr r1, =gPokeblockWasTooXStringTable - adds r0, r5, r7 - ldrb r0, [r0, 0x1] - lsls r0, 2 - adds r0, r1 - ldr r1, [r0] - b _0814F848 - .pool -_0814F83C: - adds r0, r5, r7 - ldrb r1, [r0, 0x1] - movs r0, 0xD - muls r1, r0 - ldr r0, =gAbilityNames -_0814F846: - adds r1, r0 -_0814F848: - adds r0, r6, 0 - bl StringAppend - adds r5, 0x2 - b _0814F8E0 - .pool -_0814F858: - adds r0, r5, r7 - ldrb r2, [r0, 0x1] - ldrb r0, [r0, 0x2] - lsls r0, 8 - orrs r2, r0 - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - ldr r1, =0x02000002 - ands r0, r1 - cmp r0, 0 - beq _0814F8D6 - cmp r2, 0xAF - bne _0814F8CC - ldr r2, =gLinkPlayers - ldr r0, =gBattleScripting - adds r0, 0x25 - ldrb r1, [r0] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - adds r0, r2 - ldr r1, =gStringBank - ldrb r2, [r1] - ldrh r0, [r0, 0x18] - cmp r0, r2 - bne _0814F8BC - lsls r1, r2, 3 - subs r1, r2 - lsls r1, 2 - ldr r0, =gEnigmaBerries - adds r1, r0 - adds r0, r6, 0 - bl StringCopy - ldr r1, =gText_BerrySuffix - b _0814F8BE - .pool -_0814F8BC: - ldr r1, =gText_EnigmaBerry -_0814F8BE: - adds r0, r6, 0 - bl StringAppend - b _0814F8DE - .pool -_0814F8CC: - adds r0, r2, 0 - adds r1, r6, 0 - bl CopyItemName - b _0814F8DE -_0814F8D6: - adds r0, r2, 0 - adds r1, r6, 0 - bl CopyItemName -_0814F8DE: - adds r5, 0x3 -_0814F8E0: - adds r0, r7, r5 - ldrb r0, [r0] - cmp r0, 0xFF - beq _0814F8EA - b _0814F666 -_0814F8EA: - add sp, 0xC - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end ExpandBattleTextBuffPlaceholders thumb_func_start sub_814F8F8 sub_814F8F8: @ 814F8F8 diff --git a/asm/battle_setup.s b/asm/battle_setup.s index fcc0de95b..fbedfff2f 100644 --- a/asm/battle_setup.s +++ b/asm/battle_setup.s @@ -2617,8 +2617,8 @@ _080B1C96: .pool thumb_func_end sub_80B1C7C - thumb_func_start sub_80B1CA4 -sub_80B1CA4: @ 80B1CA4 + thumb_func_start GetTrainer1LoseText +GetTrainer1LoseText: @ 80B1CA4 push {r4,lr} ldr r0, =gTrainerBattleOpponent_A ldrh r1, [r0] @@ -2643,10 +2643,10 @@ _080B1CC0: pop {r1} bx r1 .pool - thumb_func_end sub_80B1CA4 + thumb_func_end GetTrainer1LoseText - thumb_func_start sub_80B1CE0 -sub_80B1CE0: @ 80B1CE0 + thumb_func_start GetTrainer2LoseText +GetTrainer2LoseText: @ 80B1CE0 push {r4,lr} ldr r4, =gStringVar4 ldr r0, =gUnknown_02038BE0 @@ -2660,7 +2660,7 @@ sub_80B1CE0: @ 80B1CE0 pop {r1} bx r1 .pool - thumb_func_end sub_80B1CE0 + thumb_func_end GetTrainer2LoseText thumb_func_start sub_80B1D04 sub_80B1D04: @ 80B1D04 diff --git a/asm/battle_tower.s b/asm/battle_tower.s index eb91121ae..59971c5d2 100755 --- a/asm/battle_tower.s +++ b/asm/battle_tower.s @@ -5857,8 +5857,8 @@ sub_8165244: @ 8165244 .pool thumb_func_end sub_8165244 - thumb_func_start sub_8165264 -sub_8165264: @ 8165264 + thumb_func_start GetEreaderTrainerClassId +GetEreaderTrainerClassId: @ 8165264 ldr r1, =gTrainerClassToNameIndex ldr r0, =gSaveBlock2Ptr ldr r0, [r0] @@ -5869,10 +5869,10 @@ sub_8165264: @ 8165264 ldrb r0, [r0] bx lr .pool - thumb_func_end sub_8165264 + thumb_func_end GetEreaderTrainerClassId - thumb_func_start sub_8165284 -sub_8165284: @ 8165284 + thumb_func_start GetEreaderTrainerName +GetEreaderTrainerName: @ 8165284 push {r4,lr} adds r3, r0, 0 movs r2, 0 @@ -5896,7 +5896,7 @@ _08165294: pop {r0} bx r0 .pool - thumb_func_end sub_8165284 + thumb_func_end GetEreaderTrainerName thumb_func_start sub_81652B4 sub_81652B4: @ 81652B4 diff --git a/asm/rom6.s b/asm/rom6.s index c53e6fe6e..0b35ab0e8 100644 --- a/asm/rom6.s +++ b/asm/rom6.s @@ -7347,7 +7347,7 @@ sub_8139228: @ 8139228 sub_8139238: @ 8139238 push {lr} ldr r0, =gStringVar1 - bl sub_8165284 + bl GetEreaderTrainerName pop {r0} bx r0 .pool diff --git a/charmap.txt b/charmap.txt index 8fe4147cc..05eff3012 100644 --- a/charmap.txt +++ b/charmap.txt @@ -355,12 +355,12 @@ B_LINK_OPPONENT_MON1_NAME = FD 0A B_LINK_PLAYER_MON2_NAME = FD 0B B_LINK_OPPONENT_MON2_NAME = FD 0C B_ATK_NAME_WITH_PREFIX_MON1 = FD 0D -B_ATK_NAME = FD 0E +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_SCR_ACTIVE_NAME_WITH_PREFIX = FD 12 -B_ACTIVE_NAME_WITH_PREFIX = FD 13 +B_ACTIVE_NAME_WITH_PREFIX = FD 12 +B_SCR_ACTIVE_NAME_WITH_PREFIX = FD 13 B_CURRENT_MOVE = FD 14 B_LAST_MOVE = FD 15 B_LAST_ITEM = FD 16 diff --git a/include/battle_2.h b/include/battle_2.h index edd6b6ef3..ab5068446 100644 --- a/include/battle_2.h +++ b/include/battle_2.h @@ -25,6 +25,6 @@ extern const u8 gStatusConditionString_IceJpn[8]; extern const u8 gStatusConditionString_ConfusionJpn[8]; extern const u8 gStatusConditionString_LoveJpn[8]; -extern const u8 * const gStatusConditionStringsTable[][2]; +extern const u8 * const gStatusConditionStringsTable[7][2]; #endif // GUARD_BATTLE_2_H diff --git a/include/battle_message.h b/include/battle_message.h index 1884c9e37..be2aca9b2 100644 --- a/include/battle_message.h +++ b/include/battle_message.h @@ -3,59 +3,59 @@ // for 0xFD -#define B_TXT_BUFF1 00 -#define B_TXT_BUFF2 01 -#define B_TXT_COPY_VAR_1 02 -#define B_TXT_COPY_VAR_2 03 -#define B_TXT_COPY_VAR_3 04 -#define B_TXT_PLAYER_MON1_NAME 05 -#define B_TXT_OPPONENT_MON1_NAME 06 -#define B_TXT_PLAYER_MON2_NAME 07 -#define B_TXT_OPPONENT_MON2_NAME 08 -#define B_TXT_LINK_PLAYER_MON1_NAME 09 -#define B_TXT_LINK_OPPONENT_MON1_NAME 0A -#define B_TXT_LINK_PLAYER_MON2_NAME 0B -#define B_TXT_LINK_OPPONENT_MON2_NAME 0C -#define B_TXT_ATK_NAME_WITH_PREFIX_MON1 0D -#define B_TXT_ATK_NAME 0E -#define B_TXT_ATK_NAME_WITH_PREFIX 0F -#define B_TXT_DEF_NAME_WITH_PREFIX 10 -#define B_TXT_EFF_NAME_WITH_PREFIX 11 // EFF = short for gEffectBank -#define B_TXT_SCR_ACTIVE_NAME_WITH_PREFIX 12 -#define B_TXT_ACTIVE_NAME_WITH_PREFIX 13 -#define B_TXT_CURRENT_MOVE 14 -#define B_TXT_LAST_MOVE 15 -#define B_TXT_LAST_ITEM 16 -#define B_TXT_LAST_ABILITY 17 -#define B_TXT_ATK_ABILITY 18 -#define B_TXT_DEF_ABILITY 19 -#define B_TXT_SCR_ACTIVE_ABILITY 1A -#define B_TXT_EFF_ABILITY 1B -#define B_TXT_TRAINER1_CLASS 1C -#define B_TXT_TRAINER1_NAME 1D -#define B_TXT_1E 1E // trainer name for a link player -#define B_TXT_1F 1F // trainer name for a link player -#define B_TXT_20 20 // trainer name for a link player -#define B_TXT_21 21 // trainer name for a link player -#define B_TXT_22 22 // trainer name for a link player -#define B_TXT_PLAYER_NAME 23 -#define B_TXT_TRAINER1_LOSE_TEXT 24 -#define B_TXT_TRAINER1_WIN_TEXT 25 -#define B_TXT_26 26 -#define B_TXT_PC_CREATOR_NAME 27 -#define B_TXT_ATK_PREFIX1 28 -#define B_TXT_DEF_PREFIX1 29 -#define B_TXT_ATK_PREFIX2 2A -#define B_TXT_DEF_PREFIX2 2B -#define B_TXT_ATK_PREFIX3 2C -#define B_TXT_DEF_PREFIX3 2D -#define B_TXT_TRAINER2_CLASS 2E -#define B_TXT_TRAINER2_NAME 2F -#define B_TXT_TRAINER2_LOSE_TEXT 30 -#define B_TXT_TRAINER2_WIN_TEXT 31 -#define B_TXT_PARTNER_CLASS 32 -#define B_TXT_PARTNER_NAME 33 -#define B_TXT_BUFF3 34 +#define B_TXT_BUFF1 0x0 +#define B_TXT_BUFF2 0x1 +#define B_TXT_COPY_VAR_1 0x2 +#define B_TXT_COPY_VAR_2 0x3 +#define B_TXT_COPY_VAR_3 0x4 +#define B_TXT_PLAYER_MON1_NAME 0x5 +#define B_TXT_OPPONENT_MON1_NAME 0x6 +#define B_TXT_PLAYER_MON2_NAME 0x7 +#define B_TXT_OPPONENT_MON2_NAME 0x8 +#define B_TXT_LINK_PLAYER_MON1_NAME 0x9 +#define B_TXT_LINK_OPPONENT_MON1_NAME 0xA +#define B_TXT_LINK_PLAYER_MON2_NAME 0xB +#define B_TXT_LINK_OPPONENT_MON2_NAME 0xC +#define B_TXT_ATK_NAME_WITH_PREFIX_MON1 0xD +#define B_TXT_ATK_PARTNER_NAME 0xE +#define B_TXT_ATK_NAME_WITH_PREFIX 0xF +#define B_TXT_DEF_NAME_WITH_PREFIX 0x10 +#define B_TXT_EFF_NAME_WITH_PREFIX 0x11 // EFF = short for gEffectBank +#define B_TXT_ACTIVE_NAME_WITH_PREFIX 0x12 +#define B_TXT_SCR_ACTIVE_NAME_WITH_PREFIX 0x13 +#define B_TXT_CURRENT_MOVE 0x14 +#define B_TXT_LAST_MOVE 0x15 +#define B_TXT_LAST_ITEM 0x16 +#define B_TXT_LAST_ABILITY 0x17 +#define B_TXT_ATK_ABILITY 0x18 +#define B_TXT_DEF_ABILITY 0x19 +#define B_TXT_SCR_ACTIVE_ABILITY 0x1A +#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_PLAYER_NAME 0x23 +#define B_TXT_TRAINER1_LOSE_TEXT 0x24 +#define B_TXT_TRAINER1_WIN_TEXT 0x25 +#define B_TXT_26 0x26 +#define B_TXT_PC_CREATOR_NAME 0x27 +#define B_TXT_ATK_PREFIX1 0x28 +#define B_TXT_DEF_PREFIX1 0x29 +#define B_TXT_ATK_PREFIX2 0x2A +#define B_TXT_DEF_PREFIX2 0x2B +#define B_TXT_ATK_PREFIX3 0x2C +#define B_TXT_DEF_PREFIX3 0x2D +#define B_TXT_TRAINER2_CLASS 0x2E +#define B_TXT_TRAINER2_NAME 0x2F +#define B_TXT_TRAINER2_LOSE_TEXT 0x30 +#define B_TXT_TRAINER2_WIN_TEXT 0x31 +#define B_TXT_PARTNER_CLASS 0x32 +#define B_TXT_PARTNER_NAME 0x33 +#define B_TXT_BUFF3 0x34 // for B_TXT_BUFF1, B_TXT_BUFF2 and B_TXT_BUFF3 diff --git a/include/global.h b/include/global.h index e0c09d29a..e98b01ee2 100644 --- a/include/global.h +++ b/include/global.h @@ -225,24 +225,25 @@ extern struct SaveBlock2 *gSaveBlock2Ptr; struct SecretBaseRecord { - /*ID?*/ /*0x1A08*/ u8 sbr_field_0; - /*0x1A09*/ u8 sbr_field_1_0:4; - /*0x1A09*/ u8 gender:1; - /*0x1A09*/ u8 sbr_field_1_5:1; - /*0x1A09*/ u8 sbr_field_1_6:2; - /*0x1A0A*/ u8 sbr_field_2[7]; // 0xFF bytes? - /*0x1A12*/ u8 trainerId[4]; // byte 0 is used for determining trainer class - /*0x1A16*/ u16 sbr_field_e; - /*0x1A18*/ u8 sbr_field_10; - /*0x1A19*/ u8 sbr_field_11; - /*0x1A1A*/ u8 decorations[16]; - /*0x1A2A*/ u8 decorationPos[16]; - /*0x1A3A*/ u32 partyPersonality[6]; - /*0x1A54*/ u16 partyMoves[6 * 4]; - /*0x1A84*/ u16 partySpecies[6]; - /*0x1A90*/ u16 partyHeldItems[6]; - /*0x1A9C*/ u8 partyLevels[6]; - /*0x1AA2*/ u8 partyEVs[6]; + u8 sbr_field_0; + u8 sbr_field_1_0:4; + u8 gender:1; + u8 sbr_field_1_5:1; + u8 sbr_field_1_6:2; + u8 trainerName[7]; + u8 trainerId[4]; // byte 0 is used for determining trainer class + u8 language; + u16 sbr_field_e; + u8 sbr_field_10; + u8 sbr_field_11; + u8 decorations[16]; + u8 decorationPos[16]; + u32 partyPersonality[6]; + u16 partyMoves[6 * 4]; + u16 partySpecies[6]; + u16 partyHeldItems[6]; + u8 partyLevels[6]; + u8 partyEVs[6]; }; #include "game_stat.h" diff --git a/src/battle_2.c b/src/battle_2.c index 0fc7e8ffd..8e48f3ed6 100644 --- a/src/battle_2.c +++ b/src/battle_2.c @@ -344,7 +344,7 @@ const u8 gStatusConditionString_IceJpn[8] = _("こおり$$$$"); const u8 gStatusConditionString_ConfusionJpn[8] = _("こんらん$$$"); const u8 gStatusConditionString_LoveJpn[8] = _("メロメロ$$$"); -const u8 * const gStatusConditionStringsTable[][2] = +const u8 * const gStatusConditionStringsTable[7][2] = { {gStatusConditionString_PoisonJpn, gText_Poison}, {gStatusConditionString_SleepJpn, gText_Sleep}, diff --git a/src/battle_message.c b/src/battle_message.c index aaaf23fae..510b8a581 100644 --- a/src/battle_message.c +++ b/src/battle_message.c @@ -5,6 +5,10 @@ #include "moves.h" #include "text.h" #include "string_util.h" +#include "items.h" +#include "event_data.h" +#include "link.h" +#include "item.h" extern u16 gLastUsedItem; extern u8 gLastUsedAbility; @@ -16,11 +20,16 @@ extern u8 gEffectBank; extern u8 gAbilitiesPerBank[BATTLE_BANKS_COUNT]; extern u32 gBattleTypeFlags; extern u16 gTrainerBattleOpponent_A; +extern u16 gTrainerBattleOpponent_B; +extern u16 gPartnerTrainerId; extern u16 gBattlePartyID[BATTLE_BANKS_COUNT]; extern struct BattleEnigmaBerry gEnigmaBerries[BATTLE_BANKS_COUNT]; extern u8 gBattleBufferA[BATTLE_BANKS_COUNT][0x200]; extern const u8 gMoveNames[LAST_MOVE_INDEX + 1][13]; +extern const u8 gAbilityNames[][13]; +extern const u8 gTrainerClassNames[][13]; +extern const u8 gTypeNames[][7]; // strings extern const u8 gText_PkmnBoxSomeonesPCFull[]; @@ -28,9 +37,24 @@ extern const u8 gText_PkmnBoxLanettesPCFull[]; extern const u8 gText_PkmnTransferredSomeonesPC[]; extern const u8 gText_PkmnTransferredLanettesPC[]; +extern u16 sub_8068BB0(void); // pokemon_1 +extern u8 sub_81A4D00(void); // battle_frontier_2 +extern u8 GetFrontierOpponentClass(u16 trainerId); // battle_tower +extern u8 sub_81D5530(u16 trainerId); // pokenav +extern u8 GetEreaderTrainerClassId(void); // battle_tower +extern void sub_81A4D50(u8 *txtPtr); // battle_frontier_2 +extern void sub_81D5554(u8 *txtPtr, u16 trainerId); // pokenav +extern void GetEreaderTrainerName(u8 *txtPtr); +extern void sub_81A36D0(u8 arg0, u16 trainerId); // battle_frontier_2 +extern void sub_81D572C(u8 arg0, u16 trainerId); // pokenav +extern const u8* GetTrainer1LoseText(void); // battle_setup +extern const u8* GetTrainer2LoseText(void); // battle_setup +extern void GetFrontierTrainerName(u8 *dst, u16 trainerId); + // this file's functions void sub_814F8F8(u8 *txtPtr); void sub_814F950(u8 *txtPtr); +static void ExpandBattleTextBuffPlaceholders(const u8 *src, u8 *dst); // ewram variables EWRAM_DATA u8 gDisplayedStringBattle[300] = {0}; @@ -64,33 +88,33 @@ const u8 gText_PkmnFainted2[] = _("{B_DEF_NAME_WITH_PREFIX}\nfainted!\p"); const u8 gText_PlayerGotMoney[] = _("{B_PLAYER_NAME} got ¥{B_BUFF1}\nfor winning!\p"); const u8 gText_PlayerWhiteout[] = _("{B_PLAYER_NAME} is out of\nusable POKéMON!\p"); const u8 gText_PlayerWhiteout2[] = _("{B_PLAYER_NAME} whited out!{PAUSE_UNTIL_PRESS}"); -const u8 gText_PreventsEscape[] = _("{B_ACTIVE_NAME_WITH_PREFIX} prevents\nescape with {B_SCR_ACTIVE_ABILITY}!\p"); +const u8 gText_PreventsEscape[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX} prevents\nescape with {B_SCR_ACTIVE_ABILITY}!\p"); const u8 gText_CantEscape2[] = _("Can’t escape!\p"); const u8 gText_PkmnCantEscape2[] = _("{B_ATK_NAME_WITH_PREFIX} can’t escape!"); const u8 gText_HitXTimes[] = _("Hit {B_BUFF1} time(s)!"); const u8 gText_PkmnFellAsleep[] = _("{B_EFF_NAME_WITH_PREFIX}\nfell asleep!"); -const u8 gText_PkmnMadeSleep[] = _("{B_ACTIVE_NAME_WITH_PREFIX}’s {B_SCR_ACTIVE_ABILITY}\nmade {B_EFF_NAME_WITH_PREFIX} sleep!"); +const u8 gText_PkmnMadeSleep[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX}’s {B_SCR_ACTIVE_ABILITY}\nmade {B_EFF_NAME_WITH_PREFIX} sleep!"); const u8 gText_PkmnAlreadyAsleep[] = _("{B_DEF_NAME_WITH_PREFIX} is\nalready asleep!"); const u8 gText_PkmnAlreadyAsleep2[] = _("{B_ATK_NAME_WITH_PREFIX} is\nalready asleep!"); const u8 gText_PkmnWasntAffected[] = _("{B_DEF_NAME_WITH_PREFIX}\nwasn’t affected!"); const u8 gText_PkmnWasPoisoned[] = _("{B_EFF_NAME_WITH_PREFIX}\nwas poisoned!"); -const u8 gText_PkmnPoisonedBy[] = _("{B_ACTIVE_NAME_WITH_PREFIX}’s {B_SCR_ACTIVE_ABILITY}\npoisoned {B_EFF_NAME_WITH_PREFIX}!"); +const u8 gText_PkmnPoisonedBy[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX}’s {B_SCR_ACTIVE_ABILITY}\npoisoned {B_EFF_NAME_WITH_PREFIX}!"); const u8 gText_PkmnHurtByPoison[] = _("{B_ATK_NAME_WITH_PREFIX} is hurt\nby poison!"); const u8 gText_PkmnAlreadyPoisoned[] = _("{B_DEF_NAME_WITH_PREFIX} is already\npoisoned."); const u8 gText_PkmnBadlyPoisoned[] = _("{B_EFF_NAME_WITH_PREFIX} is badly\npoisoned!"); const u8 gText_PkmnEnergyDrained[] = _("{B_DEF_NAME_WITH_PREFIX} had its\nenergy drained!"); const u8 gText_PkmnWasBurned[] = _("{B_EFF_NAME_WITH_PREFIX} was burned!"); -const u8 gText_PkmnBurnedBy[] = _("{B_ACTIVE_NAME_WITH_PREFIX}’s {B_SCR_ACTIVE_ABILITY}\nburned {B_EFF_NAME_WITH_PREFIX}!"); +const u8 gText_PkmnBurnedBy[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX}’s {B_SCR_ACTIVE_ABILITY}\nburned {B_EFF_NAME_WITH_PREFIX}!"); const u8 gText_PkmnHurtByBurn[] = _("{B_ATK_NAME_WITH_PREFIX} is hurt\nby its burn!"); const u8 gText_PkmnAlreadyHasBurn[] = _("{B_DEF_NAME_WITH_PREFIX} already\nhas a burn."); const u8 gText_PkmnWasFrozen[] = _("{B_EFF_NAME_WITH_PREFIX} was\nfrozen solid!"); -const u8 gText_PkmnFrozenBy[] = _("{B_ACTIVE_NAME_WITH_PREFIX}’s {B_SCR_ACTIVE_ABILITY}\nfroze {B_EFF_NAME_WITH_PREFIX} solid!"); +const u8 gText_PkmnFrozenBy[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX}’s {B_SCR_ACTIVE_ABILITY}\nfroze {B_EFF_NAME_WITH_PREFIX} solid!"); const u8 gText_PkmnIsFrozen[] = _("{B_ATK_NAME_WITH_PREFIX} is\nfrozen solid!"); const u8 gText_PkmnWasDefrosted[] = _("{B_DEF_NAME_WITH_PREFIX} was\ndefrosted!"); const u8 gText_PkmnWasDefrosted2[] = _("{B_ATK_NAME_WITH_PREFIX} was\ndefrosted!"); const u8 gText_PkmnWasDefrostedBy[] = _("{B_ATK_NAME_WITH_PREFIX} was\ndefrosted by {B_CURRENT_MOVE}!"); const u8 gText_PkmnWasParalyzed[] = _("{B_EFF_NAME_WITH_PREFIX} is paralyzed!\nIt may be unable to move!"); -const u8 gText_PkmnWasParalyzedBy[] = _("{B_ACTIVE_NAME_WITH_PREFIX}’s {B_SCR_ACTIVE_ABILITY}\nparalyzed {B_EFF_NAME_WITH_PREFIX}!\lIt may be unable to move!"); +const u8 gText_PkmnWasParalyzedBy[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX}’s {B_SCR_ACTIVE_ABILITY}\nparalyzed {B_EFF_NAME_WITH_PREFIX}!\lIt may be unable to move!"); const u8 gText_PkmnIsParalyzed[] = _("{B_ATK_NAME_WITH_PREFIX} is paralyzed!\nIt can’t move!"); const u8 gText_PkmnIsAlreadyParalyzed[] = _("{B_DEF_NAME_WITH_PREFIX} is\nalready paralyzed!"); const u8 gText_PkmnHealedParalysis[] = _("{B_DEF_NAME_WITH_PREFIX} was\nhealed of paralysis!"); @@ -104,7 +128,7 @@ const u8 gText_PkmnHealedConfusion[] = _("{B_ATK_NAME_WITH_PREFIX} snapped\nout const u8 gText_PkmnWasConfused[] = _("{B_EFF_NAME_WITH_PREFIX} became\nconfused!"); const u8 gText_PkmnAlreadyConfused[] = _("{B_DEF_NAME_WITH_PREFIX} is\nalready confused!"); const u8 gText_PkmnFellInLove[] = _("{B_DEF_NAME_WITH_PREFIX}\nfell in love!"); -const u8 gText_PkmnInLove[] = _("{B_ATK_NAME_WITH_PREFIX} is in love\nwith {B_ACTIVE_NAME_WITH_PREFIX}!"); +const u8 gText_PkmnInLove[] = _("{B_ATK_NAME_WITH_PREFIX} is in love\nwith {B_SCR_ACTIVE_NAME_WITH_PREFIX}!"); const u8 gText_PkmnImmobilizedByLove[] = _("{B_ATK_NAME_WITH_PREFIX} is\nimmobilized by love!"); const u8 gText_PkmnBlownAway[] = _("{B_DEF_NAME_WITH_PREFIX} was\nblown away!"); const u8 gText_PkmnChangedType[] = _("{B_ATK_NAME_WITH_PREFIX} transformed\ninto the {B_BUFF1} type!"); @@ -137,7 +161,7 @@ const u8 gText_PkmnHurtBy[] = _("{B_ATK_NAME_WITH_PREFIX} is hurt\nby {B_BUFF1}! const u8 gText_PkmnFreedFrom[] = _("{B_ATK_NAME_WITH_PREFIX} was freed\nfrom {B_BUFF1}!"); const u8 gText_PkmnCrashed[] = _("{B_ATK_NAME_WITH_PREFIX} kept going\nand crashed!"); const u8 gText_PkmnShroudedInMist[] = _("{B_ATK_PREFIX2} became\nshrouded in MIST!"); -const u8 gText_PkmnProtectedByMist[] = _("{B_ACTIVE_NAME_WITH_PREFIX} is protected\nby MIST!"); +const u8 gText_PkmnProtectedByMist[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX} is protected\nby MIST!"); const u8 gText_PkmnGettingPumped[] = _("{B_ATK_NAME_WITH_PREFIX} is getting\npumped!"); const u8 gText_PkmnHitWithRecoil[] = _("{B_ATK_NAME_WITH_PREFIX} is hit\nwith recoil!"); const u8 gText_PkmnProtectedItself2[] = _("{B_ATK_NAME_WITH_PREFIX} protected\nitself!"); @@ -149,7 +173,7 @@ const u8 gText_PkmnEvadedAttack[] = _("{B_DEF_NAME_WITH_PREFIX} evaded\nthe atta const u8 gText_PkmnSappedByLeechSeed[] = _("{B_ATK_NAME_WITH_PREFIX}’s health is\nsapped by LEECH SEED!"); const u8 gText_PkmnFastAsleep[] = _("{B_ATK_NAME_WITH_PREFIX} is fast\nasleep."); const u8 gText_PkmnWokeUp[] = _("{B_ATK_NAME_WITH_PREFIX} woke up!"); -const u8 gText_PkmnUproarKeptAwake[] = _("But {B_ACTIVE_NAME_WITH_PREFIX}’s UPROAR\nkept it awake!"); +const u8 gText_PkmnUproarKeptAwake[] = _("But {B_SCR_ACTIVE_NAME_WITH_PREFIX}’s UPROAR\nkept it awake!"); const u8 gText_PkmnWokeUpInUproar[] = _("{B_ATK_NAME_WITH_PREFIX} woke up\nin the UPROAR!"); const u8 gText_PkmnCausedUproar[] = _("{B_ATK_NAME_WITH_PREFIX} caused\nan UPROAR!"); const u8 gText_PkmnMakingUproar[] = _("{B_ATK_NAME_WITH_PREFIX} is making\nan UPROAR!"); @@ -188,7 +212,7 @@ const u8 gText_PkmnLockedInNightmare[] = _("{B_ATK_NAME_WITH_PREFIX} is locked\n const u8 gText_PkmnLaidCurse[] = _("{B_ATK_NAME_WITH_PREFIX} cut its own HP and\nlaid a CURSE on {B_DEF_NAME_WITH_PREFIX}!"); const u8 gText_PkmnAfflictedByCurse[] = _("{B_ATK_NAME_WITH_PREFIX} is afflicted\nby the CURSE!"); const u8 gText_SpikesScattered[] = _("SPIKES were scattered all around\nthe opponent’s side!"); -const u8 gText_PkmnHurtBySpikes[] = _("{B_ACTIVE_NAME_WITH_PREFIX} is hurt\nby SPIKES!"); +const u8 gText_PkmnHurtBySpikes[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX} is hurt\nby SPIKES!"); const u8 gText_PkmnIdentified[] = _("{B_ATK_NAME_WITH_PREFIX} identified\n{B_DEF_NAME_WITH_PREFIX}!"); const u8 gText_PkmnPerishCountFell[] = _("{B_ATK_NAME_WITH_PREFIX}’s PERISH count\nfell to {B_BUFF1}!"); const u8 gText_PkmnBracedItself[] = _("{B_ATK_NAME_WITH_PREFIX} braced\nitself!"); @@ -231,25 +255,25 @@ const u8 gText_PkmnLostPPGrudge[] = _("{B_ATK_NAME_WITH_PREFIX}’s {B_BUFF1} lo const u8 gText_PkmnShroudedItself[] = _("{B_ATK_NAME_WITH_PREFIX} shrouded\nitself in {B_CURRENT_MOVE}!"); const u8 gText_PkmnMoveBounced[] = _("{B_ATK_NAME_WITH_PREFIX}’s {B_CURRENT_MOVE}\nwas bounced back by MAGIC COAT!"); const u8 gText_PkmnWaitsForTarget[] = _("{B_ATK_NAME_WITH_PREFIX} waits for a target\nto make a move!"); -const u8 gText_PkmnSnatchedMove[] = _("{B_DEF_NAME_WITH_PREFIX} SNATCHED\n{B_ACTIVE_NAME_WITH_PREFIX}’s move!"); +const u8 gText_PkmnSnatchedMove[] = _("{B_DEF_NAME_WITH_PREFIX} SNATCHED\n{B_SCR_ACTIVE_NAME_WITH_PREFIX}’s move!"); const u8 gText_ElectricityWeakened[] = _("Electricity’s power was\nweakened!"); const u8 gText_FireWeakened[] = _("Fire’s power was\nweakened!"); const u8 gText_XFoundOneY[] = _("{B_ATK_NAME_WITH_PREFIX} found\none {B_LAST_ITEM}!"); const u8 gText_SoothingAroma[] = _("A soothing aroma wafted\nthrough the area!"); const u8 gText_ItemsCantBeUsedNow[] = _("Items can’t be used now.{PAUSE 64}"); -const u8 gText_ForXCommaYZ[] = _("For {B_ACTIVE_NAME_WITH_PREFIX},\n{B_LAST_ITEM} {B_BUFF1}"); -const u8 gText_PkmnUsedXToGetPumped[] = _("{B_ACTIVE_NAME_WITH_PREFIX} used\n{B_LAST_ITEM} to get pumped!"); +const u8 gText_ForXCommaYZ[] = _("For {B_SCR_ACTIVE_NAME_WITH_PREFIX},\n{B_LAST_ITEM} {B_BUFF1}"); +const u8 gText_PkmnUsedXToGetPumped[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX} used\n{B_LAST_ITEM} to get pumped!"); const u8 gText_PkmnLostFocus[] = _("{B_ATK_NAME_WITH_PREFIX} lost its\nfocus and couldn’t move!"); const u8 gText_PkmnWasDraggedOut[] = _("{B_DEF_NAME_WITH_PREFIX} was\ndragged out!\p"); const u8 gText_TheWallShattered[] = _("The wall shattered!"); const u8 gText_ButNoEffect[] = _("But it had no effect!"); -const u8 gText_PkmnHasNoMovesLeft[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX} has no\nmoves left!\p"); -const u8 gText_PkmnMoveIsDisabled[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX}’s {B_CURRENT_MOVE}\nis disabled!\p"); -const u8 gText_PkmnCantUseMoveTorment[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX} can’t use the same\nmove in a row due to the TORMENT!\p"); -const u8 gText_PkmnCantUseMoveTaunt[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX} can’t use\n{B_CURRENT_MOVE} after the TAUNT!\p"); -const u8 gText_PkmnCantUseMoveSealed[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX} can’t use the\nsealed {B_CURRENT_MOVE}!\p"); -const u8 gText_PkmnMadeItRain[] = _("{B_ACTIVE_NAME_WITH_PREFIX}’s {B_SCR_ACTIVE_ABILITY}\nmade it rain!"); -const u8 gText_PkmnRaisedSpeed[] = _("{B_ACTIVE_NAME_WITH_PREFIX}’s {B_SCR_ACTIVE_ABILITY}\nraised its SPEED!"); +const u8 gText_PkmnHasNoMovesLeft[] = _("{B_ACTIVE_NAME_WITH_PREFIX} has no\nmoves left!\p"); +const u8 gText_PkmnMoveIsDisabled[] = _("{B_ACTIVE_NAME_WITH_PREFIX}’s {B_CURRENT_MOVE}\nis disabled!\p"); +const u8 gText_PkmnCantUseMoveTorment[] = _("{B_ACTIVE_NAME_WITH_PREFIX} can’t use the same\nmove in a row due to the TORMENT!\p"); +const u8 gText_PkmnCantUseMoveTaunt[] = _("{B_ACTIVE_NAME_WITH_PREFIX} can’t use\n{B_CURRENT_MOVE} after the TAUNT!\p"); +const u8 gText_PkmnCantUseMoveSealed[] = _("{B_ACTIVE_NAME_WITH_PREFIX} can’t use the\nsealed {B_CURRENT_MOVE}!\p"); +const u8 gText_PkmnMadeItRain[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX}’s {B_SCR_ACTIVE_ABILITY}\nmade it rain!"); +const u8 gText_PkmnRaisedSpeed[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX}’s {B_SCR_ACTIVE_ABILITY}\nraised its SPEED!"); const u8 gText_PkmnProtectedBy[] = _("{B_DEF_NAME_WITH_PREFIX} was protected\nby {B_DEF_ABILITY}!"); const u8 gText_PkmnPreventsUsage[] = _("{B_DEF_NAME_WITH_PREFIX}’s {B_DEF_ABILITY}\nprevents {B_ATK_NAME_WITH_PREFIX}\lfrom using {B_CURRENT_MOVE}!"); const u8 gText_PkmnRestoredHPUsing[] = _("{B_DEF_NAME_WITH_PREFIX} restored HP\nusing its {B_DEF_ABILITY}!"); @@ -261,37 +285,37 @@ const u8 gText_PkmnPreventsPoisoningWith[] = _("{B_EFF_NAME_WITH_PREFIX}’s {B_ const u8 gText_PkmnPreventsConfusionWith[] = _("{B_DEF_NAME_WITH_PREFIX}’s {B_DEF_ABILITY}\nprevents confusion!"); const u8 gText_PkmnRaisedFirePowerWith[] = _("{B_DEF_NAME_WITH_PREFIX}’s {B_DEF_ABILITY}\nraised its FIRE power!"); const u8 gText_PkmnAnchorsItselfWith[] = _("{B_DEF_NAME_WITH_PREFIX} anchors\nitself with {B_DEF_ABILITY}!"); -const u8 gText_PkmnCutsAttackWith[] = _("{B_ACTIVE_NAME_WITH_PREFIX}’s {B_SCR_ACTIVE_ABILITY}\ncuts {B_DEF_NAME_WITH_PREFIX}’s ATTACK!"); -const u8 gText_PkmnPreventsStatLossWith[] = _("{B_ACTIVE_NAME_WITH_PREFIX}’s {B_SCR_ACTIVE_ABILITY}\nprevents stat loss!"); +const u8 gText_PkmnCutsAttackWith[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX}’s {B_SCR_ACTIVE_ABILITY}\ncuts {B_DEF_NAME_WITH_PREFIX}’s ATTACK!"); +const u8 gText_PkmnPreventsStatLossWith[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX}’s {B_SCR_ACTIVE_ABILITY}\nprevents stat loss!"); const u8 gText_PkmnHurtsWith[] = _("{B_DEF_NAME_WITH_PREFIX}’s {B_DEF_ABILITY}\nhurt {B_ATK_NAME_WITH_PREFIX}!"); -const u8 gText_PkmnTraced[] = _("{B_ACTIVE_NAME_WITH_PREFIX} TRACED\n{B_BUFF1}’s {B_BUFF2}!"); +const u8 gText_PkmnTraced[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX} TRACED\n{B_BUFF1}’s {B_BUFF2}!"); const u8 gText_PkmnsXPreventsBurns[] = _("{B_EFF_NAME_WITH_PREFIX}’s {STRING 27}\nprevents burns!"); const u8 gText_PkmnsXBlocksY[] = _("{B_DEF_NAME_WITH_PREFIX}’s {B_DEF_ABILITY}\nblocks {B_CURRENT_MOVE}!"); -const u8 gText_PkmnsXBlocksY2[] = _("{B_ACTIVE_NAME_WITH_PREFIX}’s {B_SCR_ACTIVE_ABILITY}\nblocks {B_CURRENT_MOVE}!"); +const u8 gText_PkmnsXBlocksY2[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX}’s {B_SCR_ACTIVE_ABILITY}\nblocks {B_CURRENT_MOVE}!"); const u8 gText_PkmnsXRestoredHPALittle2[] = _("{B_ATK_NAME_WITH_PREFIX}’s {STRING 24}\nrestored its HP a little!"); -const u8 gText_PkmnsXWhippedUpSandstorm[] = _("{B_ACTIVE_NAME_WITH_PREFIX}’s {B_SCR_ACTIVE_ABILITY}\nwhipped up a sandstorm!"); -const u8 gText_PkmnsXIntensifiedSun[] = _("{B_ACTIVE_NAME_WITH_PREFIX}’s {B_SCR_ACTIVE_ABILITY}\nintensified the sun’s rays!"); -const u8 gText_PkmnsXPreventsYLoss[] = _("{B_ACTIVE_NAME_WITH_PREFIX}’s {B_SCR_ACTIVE_ABILITY}\nprevents {B_BUFF1} loss!"); +const u8 gText_PkmnsXWhippedUpSandstorm[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX}’s {B_SCR_ACTIVE_ABILITY}\nwhipped up a sandstorm!"); +const u8 gText_PkmnsXIntensifiedSun[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX}’s {B_SCR_ACTIVE_ABILITY}\nintensified the sun’s rays!"); +const u8 gText_PkmnsXPreventsYLoss[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX}’s {B_SCR_ACTIVE_ABILITY}\nprevents {B_BUFF1} loss!"); const u8 gText_PkmnsXInfatuatedY[] = _("{B_DEF_NAME_WITH_PREFIX}’s {B_DEF_ABILITY}\ninfatuated {B_ATK_NAME_WITH_PREFIX}!"); const u8 gText_PkmnsXMadeYIneffective[] = _("{B_DEF_NAME_WITH_PREFIX}’s {B_DEF_ABILITY}\nmade {B_CURRENT_MOVE} ineffective!"); -const u8 gText_PkmnsXCuredYProblem[] = _("{B_ACTIVE_NAME_WITH_PREFIX}’s {B_SCR_ACTIVE_ABILITY}\ncured its {B_BUFF1} problem!"); +const u8 gText_PkmnsXCuredYProblem[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX}’s {B_SCR_ACTIVE_ABILITY}\ncured its {B_BUFF1} problem!"); const u8 gText_ItSuckedLiquidOoze[] = _("It sucked up the\nLIQUID OOZE!"); -const u8 gText_PkmnTransformed[] = _("{B_ACTIVE_NAME_WITH_PREFIX} transformed!"); +const u8 gText_PkmnTransformed[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX} transformed!"); const u8 gText_PkmnsXTookAttack[] = _("{B_DEF_NAME_WITH_PREFIX}’s {B_DEF_ABILITY}\ntook the attack!"); const u8 gText_PkmnsXPreventsSwitching[] = _("{B_BUFF1}’s {STRING 23}\nprevents switching!\p"); -const u8 gText_PreventedFromWorking[] = _("{B_DEF_NAME_WITH_PREFIX}’s {B_DEF_ABILITY}\nprevented {B_ACTIVE_NAME_WITH_PREFIX}’s\l{B_BUFF1} from working!"); -const u8 gText_PkmnsXMadeItIneffective[] = _("{B_ACTIVE_NAME_WITH_PREFIX}’s {B_SCR_ACTIVE_ABILITY}\nmade it ineffective!"); +const u8 gText_PreventedFromWorking[] = _("{B_DEF_NAME_WITH_PREFIX}’s {B_DEF_ABILITY}\nprevented {B_SCR_ACTIVE_NAME_WITH_PREFIX}’s\l{B_BUFF1} from working!"); +const u8 gText_PkmnsXMadeItIneffective[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX}’s {B_SCR_ACTIVE_ABILITY}\nmade it ineffective!"); const u8 gText_PkmnsXPreventsFlinching[] = _("{B_EFF_NAME_WITH_PREFIX}’s {STRING 27}\nprevents flinching!"); const u8 gText_PkmnsXPreventsYsZ[] = _("{B_ATK_NAME_WITH_PREFIX}’s {STRING 24}\nprevents {B_DEF_NAME_WITH_PREFIX}’s\l{B_DEF_ABILITY} from working!"); -const u8 gText_PkmnsXCuredItsYProblem[] = _("{B_ACTIVE_NAME_WITH_PREFIX}’s {B_SCR_ACTIVE_ABILITY}\ncured its {B_BUFF1} problem!"); -const u8 gText_PkmnsXHadNoEffectOnY[] = _("{B_ACTIVE_NAME_WITH_PREFIX}’s {B_SCR_ACTIVE_ABILITY}\nhad no effect on {B_EFF_NAME_WITH_PREFIX}!"); +const u8 gText_PkmnsXCuredItsYProblem[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX}’s {B_SCR_ACTIVE_ABILITY}\ncured its {B_BUFF1} problem!"); +const u8 gText_PkmnsXHadNoEffectOnY[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX}’s {B_SCR_ACTIVE_ABILITY}\nhad no effect on {B_EFF_NAME_WITH_PREFIX}!"); const u8 gText_StatSharply[] = _("sharply "); const u8 gText_StatRose[] = _("rose!"); const u8 gText_StatHarshly[] = _("harshly "); const u8 gText_StatFell[] = _("fell!"); const u8 gText_PkmnsStatChanged[] = _("{B_ATK_NAME_WITH_PREFIX}’s {B_BUFF1}\n{B_BUFF2}"); const u8 gText_PkmnsStatChanged2[] = _("{B_DEF_NAME_WITH_PREFIX}’s {B_BUFF1}\n{B_BUFF2}"); -const u8 gText_UsingXTheYOfZN[] = _("Using {B_LAST_ITEM}, the {B_BUFF1}\nof {B_ACTIVE_NAME_WITH_PREFIX} {B_BUFF2}"); +const u8 gText_UsingXTheYOfZN[] = _("Using {B_LAST_ITEM}, the {B_BUFF1}\nof {B_SCR_ACTIVE_NAME_WITH_PREFIX} {B_BUFF2}"); const u8 gText_PkmnsStatChanged3[] = _("{B_ATK_NAME_WITH_PREFIX}’s {B_BUFF1}\n{B_BUFF2}"); const u8 gText_PkmnsStatChanged4[] = _("{B_DEF_NAME_WITH_PREFIX}’s {B_BUFF1}\n{B_BUFF2}"); const u8 gText_StatsWontIncrease2[] = _("{B_ATK_NAME_WITH_PREFIX}’s stats won’t\ngo any higher!"); @@ -462,18 +486,18 @@ const u8 gText_SandstormIsRaging[] = _("A sandstorm is raging."); const u8 gText_BoxIsFull[] = _("The BOX is full!\nYou can’t catch any more!\p"); const u8 gText_EnigmaBerry[] = _("ENIGMA BERRY"); const u8 gText_BerrySuffix[] = _(" BERRY"); -const u8 gText_PkmnsItemCuredParalysis[] = _("{B_ACTIVE_NAME_WITH_PREFIX}’s {B_LAST_ITEM}\ncured paralysis!"); -const u8 gText_PkmnsItemCuredPoison[] = _("{B_ACTIVE_NAME_WITH_PREFIX}’s {B_LAST_ITEM}\ncured poison!"); -const u8 gText_PkmnsItemHealedBurn[] = _("{B_ACTIVE_NAME_WITH_PREFIX}’s {B_LAST_ITEM}\nhealed its burn!"); -const u8 gText_PkmnsItemDefrostedIt[] = _("{B_ACTIVE_NAME_WITH_PREFIX}’s {B_LAST_ITEM}\ndefrosted it!"); -const u8 gText_PkmnsItemWokeIt[] = _("{B_ACTIVE_NAME_WITH_PREFIX}’s {B_LAST_ITEM}\nwoke it from its sleep!"); -const u8 gText_PkmnsItemSnappedOut[] = _("{B_ACTIVE_NAME_WITH_PREFIX}’s {B_LAST_ITEM}\nsnapped it out of confusion!"); -const u8 gText_PkmnsItemCuredProblem[] = _("{B_ACTIVE_NAME_WITH_PREFIX}’s {B_LAST_ITEM}\ncured its {B_BUFF1} problem!"); -const u8 gText_PkmnsItemNormalizedStatus[] = _("{B_ACTIVE_NAME_WITH_PREFIX}’s {B_LAST_ITEM}\nnormalized its status!"); -const u8 gText_PkmnsItemRestoredHealth[] = _("{B_ACTIVE_NAME_WITH_PREFIX}’s {B_LAST_ITEM}\nrestored health!"); -const u8 gText_PkmnsItemRestoredPP[] = _("{B_ACTIVE_NAME_WITH_PREFIX}’s {B_LAST_ITEM}\nrestored {B_BUFF1}’s PP!"); -const u8 gText_PkmnsItemRestoredStatus[] = _("{B_ACTIVE_NAME_WITH_PREFIX}’s {B_LAST_ITEM}\nrestored its status!"); -const u8 gText_PkmnsItemRestoredHPALittle[] = _("{B_ACTIVE_NAME_WITH_PREFIX}’s {B_LAST_ITEM}\nrestored its HP a little!"); +const u8 gText_PkmnsItemCuredParalysis[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX}’s {B_LAST_ITEM}\ncured paralysis!"); +const u8 gText_PkmnsItemCuredPoison[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX}’s {B_LAST_ITEM}\ncured poison!"); +const u8 gText_PkmnsItemHealedBurn[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX}’s {B_LAST_ITEM}\nhealed its burn!"); +const u8 gText_PkmnsItemDefrostedIt[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX}’s {B_LAST_ITEM}\ndefrosted it!"); +const u8 gText_PkmnsItemWokeIt[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX}’s {B_LAST_ITEM}\nwoke it from its sleep!"); +const u8 gText_PkmnsItemSnappedOut[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX}’s {B_LAST_ITEM}\nsnapped it out of confusion!"); +const u8 gText_PkmnsItemCuredProblem[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX}’s {B_LAST_ITEM}\ncured its {B_BUFF1} problem!"); +const u8 gText_PkmnsItemNormalizedStatus[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX}’s {B_LAST_ITEM}\nnormalized its status!"); +const u8 gText_PkmnsItemRestoredHealth[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX}’s {B_LAST_ITEM}\nrestored health!"); +const u8 gText_PkmnsItemRestoredPP[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX}’s {B_LAST_ITEM}\nrestored {B_BUFF1}’s PP!"); +const u8 gText_PkmnsItemRestoredStatus[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX}’s {B_LAST_ITEM}\nrestored its status!"); +const u8 gText_PkmnsItemRestoredHPALittle[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX}’s {B_LAST_ITEM}\nrestored its HP a little!"); const u8 gText_ItemAllowsOnlyYMove[] = _("{B_LAST_ITEM} allows the\nuse of only {B_CURRENT_MOVE}!\p"); const u8 gText_PkmnHungOnWithX[] = _("{B_DEF_NAME_WITH_PREFIX} hung on\nusing its {B_LAST_ITEM}!"); const u8 gText_EmptyString3[] = _(""); @@ -910,7 +934,7 @@ const u8 gText_PkmnIsEvolving[] = _("What?\n{STR_VAR_1} is evolving!"); const u8 gText_CongratsPkmnEvolved[] = _("Congratulations! Your {STR_VAR_1}\nevolved into {STR_VAR_2}!{UNKNOWN_A}\p"); const u8 gText_PkmnStoppedEvolving[] = _("Huh? {STR_VAR_1}\nstopped evolving!\p"); const u8 gText_EllipsisQuestionMark[] = _("……?\p"); -const u8 gText_WhatWillPkmnDo[] = _("What will\n{B_SCR_ACTIVE_NAME_WITH_PREFIX} do?"); +const u8 gText_WhatWillPkmnDo[] = _("What will\n{B_ACTIVE_NAME_WITH_PREFIX} do?"); const u8 gText_WhatWillPkmnDo2[] = _("What will\n{B_PLAYER_NAME} do?"); const u8 gText_WhatWillWallyDo[] = _("What will\nWALLY do?"); const u8 gText_LinkStandby[] = _("{PAUSE 16}Link standby…"); @@ -1013,10 +1037,10 @@ const u8 gText_InGamePartnerSentOutZGoN[] = _("{B_PARTNER_CLASS} {B_PARTNER_NAME const u8 gText_TwoInGameTrainersDefeated[] = _("{B_TRAINER1_CLASS} {B_TRAINER1_NAME} and\n{B_TRAINER2_CLASS} {B_TRAINER2_NAME}\lwere defeated!\p"); const u8 gText_Trainer2LoseText[] = _("{B_TRAINER2_LOSE_TEXT}"); const u8 gText_PkmnIncapableOfPower[] = _("{B_ATK_NAME_WITH_PREFIX} appears incapable\nof using its power!"); -const u8 gText_GlintAppearsInEye[] = _("A glint appears in\n{B_ACTIVE_NAME_WITH_PREFIX}’s eyes!"); -const u8 gText_PkmnGettingIntoPosition[] = _("{B_ACTIVE_NAME_WITH_PREFIX} is getting into\nposition!"); -const u8 gText_PkmnBeganGrowlingDeeply[] = _("{B_ACTIVE_NAME_WITH_PREFIX} began growling deeply!"); -const u8 gText_PkmnEagerForMore[] = _("{B_ACTIVE_NAME_WITH_PREFIX} is eager for more!"); +const u8 gText_GlintAppearsInEye[] = _("A glint appears in\n{B_SCR_ACTIVE_NAME_WITH_PREFIX}’s eyes!"); +const u8 gText_PkmnGettingIntoPosition[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX} is getting into\nposition!"); +const u8 gText_PkmnBeganGrowlingDeeply[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX} began growling deeply!"); +const u8 gText_PkmnEagerForMore[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX} is eager for more!"); const u16 gUnknown_085CCF0A[] = { @@ -1080,7 +1104,7 @@ const u16 gUnknown_085CD336[] = 0x0104, 0x0110, 0x011b, 0x0141, 0x0157, 0x0000, }; -const u8 gUnknown_085CD422[] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0}; +static const u8 sDummyWeirdStatusString[] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0}; const u16 gUnknown_085CD42C[] = { @@ -1426,3 +1450,620 @@ void BufferStringBattle(u16 stringID) BattleStringExpandPlaceholdersToDisplayedString(stringPtr); } + +u32 BattleStringExpandPlaceholdersToDisplayedString(const u8* src) +{ + BattleStringExpandPlaceholders(src, gDisplayedStringBattle); +} + +static const u8* TryGetStatusString(u8* src) +{ + u32 i; + u8 status[8]; + u32 chars1, chars2; + u8* statusPtr; + + memcpy(status, sDummyWeirdStatusString, 8); + + statusPtr = status; + for (i = 0; i < 8; i++) + { + if (*src == EOS) + break; + *statusPtr = *src; + src++; + statusPtr++; + } + + chars1 = *(u32*)(&status[0]); + chars2 = *(u32*)(&status[4]); + + for (i = 0; i < ARRAY_COUNT(gStatusConditionStringsTable); i++) + { + if (chars1 == *(u32*)(&gStatusConditionStringsTable[i][0][0]) + && chars2 == *(u32*)(&gStatusConditionStringsTable[i][0][4])) + return gStatusConditionStringsTable[i][1]; + } + return NULL; +} + +#define HANDLE_NICKNAME_STRING_CASE(bank, monIndex) \ + if (GetBankSide(bank) != SIDE_PLAYER) \ + { \ + if (gBattleTypeFlags & BATTLE_TYPE_TRAINER) \ + toCpy = gText_FoePkmnPrefix; \ + else \ + toCpy = gText_WildPkmnPrefix; \ + while (*toCpy != EOS) \ + { \ + dst[dstID] = *toCpy; \ + dstID++; \ + toCpy++; \ + } \ + GetMonData(&gEnemyParty[monIndex], MON_DATA_NICKNAME, text); \ + } \ + else \ + { \ + GetMonData(&gPlayerParty[monIndex], MON_DATA_NICKNAME, text); \ + } \ + StringGetEnd10(text); \ + toCpy = text; + +extern u8 gUnknown_0203C7B4; + +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; + s32 i; + + if (gBattleTypeFlags & BATTLE_TYPE_x2000000) + multiplayerID = gUnknown_0203C7B4; + else + multiplayerID = GetMultiplayerId(); + + while (*src != EOS) + { + if (*src == PLACEHOLDER_BEGIN) + { + src++; + switch (*src) + { + case B_TXT_BUFF1: + if (gBattleTextBuff1[0] == B_BUFF_PLACEHOLDER_BEGIN) + { + ExpandBattleTextBuffPlaceholders(gBattleTextBuff1, gStringVar1); + toCpy = gStringVar1; + } + else + { + toCpy = TryGetStatusString(gBattleTextBuff1); + if (toCpy == NULL) + toCpy = gBattleTextBuff1; + } + break; + case B_TXT_BUFF2: + if (gBattleTextBuff2[0] == B_BUFF_PLACEHOLDER_BEGIN) + { + ExpandBattleTextBuffPlaceholders(gBattleTextBuff2, gStringVar2); + toCpy = gStringVar2; + } + else + toCpy = gBattleTextBuff2; + break; + case B_TXT_BUFF3: + if (gBattleTextBuff3[0] == B_BUFF_PLACEHOLDER_BEGIN) + { + ExpandBattleTextBuffPlaceholders(gBattleTextBuff3, gStringVar3); + toCpy = gStringVar3; + } + else + toCpy = gBattleTextBuff3; + break; + case B_TXT_COPY_VAR_1: + toCpy = gStringVar1; + break; + case B_TXT_COPY_VAR_2: + toCpy = gStringVar2; + break; + case B_TXT_COPY_VAR_3: + toCpy = gStringVar3; + break; + case B_TXT_PLAYER_MON1_NAME: // first player poke name + GetMonData(&gPlayerParty[gBattlePartyID[GetBankByIdentity(IDENTITY_PLAYER_MON1)]], + MON_DATA_NICKNAME, text); + StringGetEnd10(text); + toCpy = text; + break; + case B_TXT_OPPONENT_MON1_NAME: // first enemy poke name + GetMonData(&gEnemyParty[gBattlePartyID[GetBankByIdentity(IDENTITY_OPPONENT_MON1)]], + MON_DATA_NICKNAME, text); + StringGetEnd10(text); + toCpy = text; + break; + case B_TXT_PLAYER_MON2_NAME: // second player poke name + GetMonData(&gPlayerParty[gBattlePartyID[GetBankByIdentity(IDENTITY_PLAYER_MON2)]], + MON_DATA_NICKNAME, text); + StringGetEnd10(text); + toCpy = text; + break; + case B_TXT_OPPONENT_MON2_NAME: // second enemy poke name + GetMonData(&gEnemyParty[gBattlePartyID[GetBankByIdentity(IDENTITY_OPPONENT_MON2)]], + MON_DATA_NICKNAME, text); + StringGetEnd10(text); + toCpy = text; + break; + case B_TXT_LINK_PLAYER_MON1_NAME: // link first player poke name + GetMonData(&gPlayerParty[gBattlePartyID[gLinkPlayers[multiplayerID].lp_field_18]], + MON_DATA_NICKNAME, text); + StringGetEnd10(text); + toCpy = text; + break; + case B_TXT_LINK_OPPONENT_MON1_NAME: // link first opponent poke name + GetMonData(&gEnemyParty[gBattlePartyID[gLinkPlayers[multiplayerID].lp_field_18 ^ 1]], + MON_DATA_NICKNAME, text); + StringGetEnd10(text); + toCpy = text; + break; + case B_TXT_LINK_PLAYER_MON2_NAME: // link second player poke name + GetMonData(&gPlayerParty[gBattlePartyID[gLinkPlayers[multiplayerID].lp_field_18 ^ 2]], + MON_DATA_NICKNAME, text); + StringGetEnd10(text); + toCpy = text; + break; + case B_TXT_LINK_OPPONENT_MON2_NAME: // link second opponent poke name + GetMonData(&gEnemyParty[gBattlePartyID[gLinkPlayers[multiplayerID].lp_field_18 ^ 3]], + MON_DATA_NICKNAME, text); + StringGetEnd10(text); + toCpy = text; + break; + case B_TXT_ATK_NAME_WITH_PREFIX_MON1: // attacker name with prefix, only bank 0/1 + HANDLE_NICKNAME_STRING_CASE(gBankAttacker, + gBattlePartyID[GetBankByIdentity(GET_BANK_SIDE(gBankAttacker))]) + break; + case B_TXT_ATK_PARTNER_NAME: // attacker partner name + if (GetBankSide(gBankAttacker) == SIDE_PLAYER) + GetMonData(&gPlayerParty[gBattlePartyID[GetBankByIdentity(GET_BANK_SIDE(gBankAttacker)) + 2]], MON_DATA_NICKNAME, text); + else + GetMonData(&gEnemyParty[gBattlePartyID[GetBankByIdentity(GET_BANK_SIDE(gBankAttacker)) + 2]], MON_DATA_NICKNAME, text); + + StringGetEnd10(text); + toCpy = text; + break; + case B_TXT_ATK_NAME_WITH_PREFIX: // attacker name with prefix + HANDLE_NICKNAME_STRING_CASE(gBankAttacker, gBattlePartyID[gBankAttacker]) + break; + case B_TXT_DEF_NAME_WITH_PREFIX: // target name with prefix + HANDLE_NICKNAME_STRING_CASE(gBankTarget, gBattlePartyID[gBankTarget]) + break; + case B_TXT_EFF_NAME_WITH_PREFIX: // effect bank name with prefix + HANDLE_NICKNAME_STRING_CASE(gEffectBank, gBattlePartyID[gEffectBank]) + break; + case B_TXT_ACTIVE_NAME_WITH_PREFIX: // active bank name with prefix + HANDLE_NICKNAME_STRING_CASE(gActiveBank, gBattlePartyID[gActiveBank]) + break; + case B_TXT_SCR_ACTIVE_NAME_WITH_PREFIX: // scripting active bank name with prefix + HANDLE_NICKNAME_STRING_CASE(gBattleScripting.bank, gBattlePartyID[gBattleScripting.bank]) + break; + case B_TXT_CURRENT_MOVE: // current move name + if (gStringInfo->currentMove > LAST_MOVE_INDEX) + toCpy = gText_UnknownMoveTypes[gBattleStruct->stringMoveType]; + else + toCpy = gMoveNames[gStringInfo->currentMove]; + break; + case B_TXT_LAST_MOVE: // last used move name + if (gStringInfo->lastMove > LAST_MOVE_INDEX) + toCpy = gText_UnknownMoveTypes[gBattleStruct->stringMoveType]; + else + toCpy = gMoveNames[gStringInfo->lastMove]; + break; + case B_TXT_LAST_ITEM: // last used item + if (gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_x2000000)) + { + if (gLastUsedItem == ITEM_ENIGMA_BERRY) + { + if (!(gBattleTypeFlags & BATTLE_TYPE_MULTI)) + { + if ((gBattleScripting.multiplayerId != 0 && (gStringBank & BIT_SIDE)) + || (gBattleScripting.multiplayerId == 0 && !(gStringBank & BIT_SIDE))) + { + StringCopy(text, gEnigmaBerries[gStringBank].name); + StringAppend(text, gText_BerrySuffix); + toCpy = text; + } + else + { + toCpy = gText_EnigmaBerry; + } + } + else + { + if (gLinkPlayers[gBattleScripting.multiplayerId].lp_field_18 == gStringBank) + { + StringCopy(text, gEnigmaBerries[gStringBank].name); + StringAppend(text, gText_BerrySuffix); + toCpy = text; + } + else + toCpy = gText_EnigmaBerry; + } + } + else + { + CopyItemName(gLastUsedItem, text); + toCpy = text; + } + } + else + { + CopyItemName(gLastUsedItem, text); + toCpy = text; + } + break; + case B_TXT_LAST_ABILITY: // last used ability + toCpy = gAbilityNames[gLastUsedAbility]; + break; + case B_TXT_ATK_ABILITY: // attacker ability + toCpy = gAbilityNames[gAbilitiesPerBank[gBankAttacker]]; + break; + case B_TXT_DEF_ABILITY: // target ability + toCpy = gAbilityNames[gAbilitiesPerBank[gBankTarget]]; + break; + case B_TXT_SCR_ACTIVE_ABILITY: // scripting active ability + toCpy = gAbilityNames[gAbilitiesPerBank[gBattleScripting.bank]]; + break; + case B_TXT_EFF_ABILITY: // effect bank ability + toCpy = gAbilityNames[gAbilitiesPerBank[gEffectBank]]; + break; + case B_TXT_TRAINER1_CLASS: // trainer class name + if (gBattleTypeFlags & BATTLE_TYPE_SECRET_BASE) + toCpy = gTrainerClassNames[GetSecretBaseTrainerNameIndex()]; + else if (gTrainerBattleOpponent_A == TRAINER_OPPONENT_C00) + toCpy = gTrainerClassNames[sub_8068BB0()]; + else if (gTrainerBattleOpponent_A == TRAINER_OPPONENT_3FE) + toCpy = gTrainerClassNames[sub_81A4D00()]; + else if (gBattleTypeFlags & BATTLE_TYPE_FRONTIER) + toCpy = gTrainerClassNames[GetFrontierOpponentClass(gTrainerBattleOpponent_A)]; + else if (gBattleTypeFlags & BATTLE_TYPE_x4000000) + toCpy = gTrainerClassNames[sub_81D5530(gTrainerBattleOpponent_A)]; + else if (gBattleTypeFlags & BATTLE_TYPE_EREADER_TRAINER) + toCpy = gTrainerClassNames[GetEreaderTrainerClassId()]; + else + toCpy = gTrainerClassNames[gTrainers[gTrainerBattleOpponent_A].trainerClass]; + break; + case B_TXT_TRAINER1_NAME: // trainer1 name + if (gBattleTypeFlags & BATTLE_TYPE_SECRET_BASE) + { + for (i = 0; i < (s32) ARRAY_COUNT(gBattleResources->secretBase->trainerName); i++) + text[i] = gBattleResources->secretBase->trainerName[i]; + text[i] = EOS; + ConvertInternationalString(text, gBattleResources->secretBase->language); + toCpy = text; + } + else if (gTrainerBattleOpponent_A == TRAINER_OPPONENT_C00) + { + toCpy = gLinkPlayers[multiplayerID ^ BIT_SIDE].name; + } + else if (gTrainerBattleOpponent_A == TRAINER_OPPONENT_3FE) + { + sub_81A4D50(text); + toCpy = text; + } + else if (gBattleTypeFlags & BATTLE_TYPE_FRONTIER) + { + GetFrontierTrainerName(text, gTrainerBattleOpponent_A); + toCpy = text; + } + else if (gBattleTypeFlags & BATTLE_TYPE_x4000000) + { + sub_81D5554(text, gTrainerBattleOpponent_A); + toCpy = text; + } + else if (gBattleTypeFlags & BATTLE_TYPE_EREADER_TRAINER) + { + GetEreaderTrainerName(text); + toCpy = text; + } + else + { + toCpy = gTrainers[gTrainerBattleOpponent_A].trainerName; + } + break; + case B_TXT_1E: // link player name? + toCpy = gLinkPlayers[multiplayerID].name; + break; + case B_TXT_1F: // link partner name? + toCpy = gLinkPlayers[sub_806D864(2 ^ gLinkPlayers[multiplayerID].lp_field_18)].name; + break; + case B_TXT_20: // link opponent 1 name? + toCpy = gLinkPlayers[sub_806D864(1 ^ gLinkPlayers[multiplayerID].lp_field_18)].name; + break; + case B_TXT_21: // link opponent 2 name? + toCpy = gLinkPlayers[sub_806D864(3 ^ gLinkPlayers[multiplayerID].lp_field_18)].name; + break; + case B_TXT_22: // link scripting active name + toCpy = gLinkPlayers[sub_806D864(gBattleScripting.bank)].name; + break; + case B_TXT_PLAYER_NAME: // player name + if (gBattleTypeFlags & BATTLE_TYPE_RECORDED) + toCpy = gLinkPlayers[0].name; + else + toCpy = gSaveBlock2Ptr->playerName; + break; + case B_TXT_TRAINER1_LOSE_TEXT: // trainerA lose text + if (gBattleTypeFlags & BATTLE_TYPE_FRONTIER) + { + sub_81A36D0(2, gTrainerBattleOpponent_A); + toCpy = gStringVar4; + } + else if (gBattleTypeFlags & BATTLE_TYPE_x4000000) + { + sub_81D572C(4, gTrainerBattleOpponent_A); + toCpy = gStringVar4; + } + else + { + toCpy = GetTrainer1LoseText(); + } + break; + case B_TXT_TRAINER1_WIN_TEXT: // trainerA win text + if (gBattleTypeFlags & BATTLE_TYPE_FRONTIER) + { + sub_81A36D0(1, gTrainerBattleOpponent_A); + toCpy = gStringVar4; + } + else if (gBattleTypeFlags & BATTLE_TYPE_x4000000) + { + sub_81D572C(3, gTrainerBattleOpponent_A); + toCpy = gStringVar4; + } + break; + case B_TXT_26: // ? + HANDLE_NICKNAME_STRING_CASE(gBattleScripting.bank, *(&gBattleStruct->field_52)) + break; + case B_TXT_PC_CREATOR_NAME: // lanette pc + if (FlagGet(SYS_PC_LANETTE)) + toCpy = gText_Lanettes; + else + toCpy = gText_Someones; + break; + case B_TXT_ATK_PREFIX2: + if (GetBankSide(gBankAttacker) == SIDE_PLAYER) + toCpy = gText_AllyPkmnPrefix2; + else + toCpy = gText_FoePkmnPrefix3; + break; + case B_TXT_DEF_PREFIX2: + if (GetBankSide(gBankTarget) == SIDE_PLAYER) + toCpy = gText_AllyPkmnPrefix2; + else + toCpy = gText_FoePkmnPrefix3; + break; + case B_TXT_ATK_PREFIX1: + if (GetBankSide(gBankAttacker) == SIDE_PLAYER) + toCpy = gText_AllyPkmnPrefix; + else + toCpy = gText_FoePkmnPrefix2; + break; + case B_TXT_DEF_PREFIX1: + if (GetBankSide(gBankTarget) == SIDE_PLAYER) + toCpy = gText_AllyPkmnPrefix; + else + toCpy = gText_FoePkmnPrefix2; + break; + case B_TXT_ATK_PREFIX3: + if (GetBankSide(gBankAttacker) == SIDE_PLAYER) + toCpy = gText_AllyPkmnPrefix3; + else + toCpy = gText_FoePkmnPrefix4; + break; + case B_TXT_DEF_PREFIX3: + if (GetBankSide(gBankTarget) == SIDE_PLAYER) + toCpy = gText_AllyPkmnPrefix3; + else + toCpy = gText_FoePkmnPrefix4; + break; + case B_TXT_TRAINER2_CLASS: + if (gBattleTypeFlags & BATTLE_TYPE_FRONTIER) + toCpy = gTrainerClassNames[GetFrontierOpponentClass(gTrainerBattleOpponent_B)]; + else if (gBattleTypeFlags & BATTLE_TYPE_x4000000) + toCpy = gTrainerClassNames[sub_81D5530(gTrainerBattleOpponent_B)]; + else + toCpy = gTrainerClassNames[gTrainers[gTrainerBattleOpponent_B].trainerClass]; + break; + case B_TXT_TRAINER2_NAME: + if (gBattleTypeFlags & BATTLE_TYPE_FRONTIER) + { + GetFrontierTrainerName(text, gTrainerBattleOpponent_B); + toCpy = text; + } + else if (gBattleTypeFlags & BATTLE_TYPE_x4000000) + { + sub_81D5554(text, gTrainerBattleOpponent_B); + toCpy = text; + } + else + { + toCpy = gTrainers[gTrainerBattleOpponent_B].trainerName; + } + break; + case B_TXT_TRAINER2_LOSE_TEXT: + if (gBattleTypeFlags & BATTLE_TYPE_FRONTIER) + { + sub_81A36D0(2, gTrainerBattleOpponent_B); + toCpy = gStringVar4; + } + else if (gBattleTypeFlags & BATTLE_TYPE_x4000000) + { + sub_81D572C(4, gTrainerBattleOpponent_B); + toCpy = gStringVar4; + } + else + { + toCpy = GetTrainer2LoseText(); + } + break; + case B_TXT_TRAINER2_WIN_TEXT: + if (gBattleTypeFlags & BATTLE_TYPE_FRONTIER) + { + sub_81A36D0(1, gTrainerBattleOpponent_B); + toCpy = gStringVar4; + } + else if (gBattleTypeFlags & BATTLE_TYPE_x4000000) + { + sub_81D572C(3, gTrainerBattleOpponent_B); + toCpy = gStringVar4; + } + break; + case B_TXT_PARTNER_CLASS: + toCpy = gTrainerClassNames[GetFrontierOpponentClass(gPartnerTrainerId)]; + break; + case B_TXT_PARTNER_NAME: + GetFrontierTrainerName(text, gPartnerTrainerId); + toCpy = text; + break; + } + + // missing if (toCpy != NULL) check + while (*toCpy != EOS) + { + dst[dstID] = *toCpy; + dstID++; + toCpy++; + } + if (*src == B_TXT_TRAINER1_LOSE_TEXT || *src == B_TXT_TRAINER2_LOSE_TEXT + || *src == B_TXT_TRAINER1_WIN_TEXT || *src == B_TXT_TRAINER2_WIN_TEXT) + { + dst[dstID] = EXT_CTRL_CODE_BEGIN; + dstID++; + dst[dstID] = 9; + dstID++; + } + } + else + { + dst[dstID] = *src; + dstID++; + } + src++; + } + + dst[dstID] = *src; + dstID++; + + return dstID; +} + +// TODO: move these to a general header like util.h +#define ByteRead16(ptr) ((ptr)[0] | ((ptr)[1] << 8)) +#define ByteRead32(ptr) ((ptr)[0] | (ptr)[1] << 8 | (ptr)[2] << 16 | (ptr)[3] << 24) + +static void ExpandBattleTextBuffPlaceholders(const u8 *src, u8 *dst) +{ + u32 srcID = 1; + u32 value = 0; + u8 text[12]; + u16 hword; + + *dst = EOS; + while (src[srcID] != B_BUFF_EOS) + { + switch (src[srcID]) + { + case B_BUFF_STRING: // battle string + hword = ByteRead16(&src[srcID + 1]); + StringAppend(dst, gBattleStringsTable[hword - BATTLESTRINGS_ID_ADDER]); + srcID += 3; + break; + case B_BUFF_NUMBER: // int to string + switch (src[srcID + 1]) + { + case 1: + value = src[srcID + 3]; + break; + case 2: + value = ByteRead16(&src[srcID + 3]); + break; + case 4: + value = ByteRead32(&src[srcID + 3]); + break; + } + ConvertIntToDecimalStringN(dst, value, 0, src[srcID + 2]); + srcID += src[srcID + 1] + 3; + break; + case B_BUFF_MOVE: // move name + StringAppend(dst, gMoveNames[ByteRead16(&src[srcID + 1])]); + srcID += 3; + break; + case B_BUFF_TYPE: // type name + StringAppend(dst, gTypeNames[src[srcID + 1]]); + srcID += 2; + break; + case B_BUFF_MON_NICK_WITH_PREFIX: // poke nick with prefix + if (GetBankSide(src[srcID + 1]) == SIDE_PLAYER) + { + GetMonData(&gPlayerParty[src[srcID + 2]], MON_DATA_NICKNAME, text); + } + else + { + if (gBattleTypeFlags & BATTLE_TYPE_TRAINER) + StringAppend(dst, gText_FoePkmnPrefix); + else + StringAppend(dst, gText_WildPkmnPrefix); + + GetMonData(&gEnemyParty[src[srcID + 2]], MON_DATA_NICKNAME, text); + } + StringGetEnd10(text); + StringAppend(dst, text); + srcID += 3; + break; + case B_BUFF_STAT: // stats + StringAppend(dst, gStatNamesTable[src[srcID + 1]]); + srcID += 2; + break; + case B_BUFF_SPECIES: // species name + GetSpeciesName(dst, ByteRead16(&src[srcID + 1])); + srcID += 3; + break; + case B_BUFF_MON_NICK: // poke nick without prefix + if (GetBankSide(src[srcID + 1]) == SIDE_PLAYER) + GetMonData(&gPlayerParty[src[srcID + 2]], MON_DATA_NICKNAME, dst); + else + GetMonData(&gEnemyParty[src[srcID + 2]], MON_DATA_NICKNAME, dst); + StringGetEnd10(dst); + srcID += 3; + break; + case B_BUFF_NEGATIVE_FLAVOUR: // flavour table + StringAppend(dst, gPokeblockWasTooXStringTable[src[srcID + 1]]); + srcID += 2; + break; + case B_BUFF_ABILITY: // ability names + StringAppend(dst, gAbilityNames[src[srcID + 1]]); + srcID += 2; + break; + case B_BUFF_ITEM: // item name + hword = ByteRead16(&src[srcID + 1]); + if (gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_x2000000)) + { + if (hword == ITEM_ENIGMA_BERRY) + { + if (gLinkPlayers[gBattleScripting.multiplayerId].lp_field_18 == gStringBank) + { + StringCopy(dst, gEnigmaBerries[gStringBank].name); + StringAppend(dst, gText_BerrySuffix); + } + else + StringAppend(dst, gText_EnigmaBerry); + } + else + CopyItemName(hword, dst); + } + else + CopyItemName(hword, dst); + srcID += 3; + break; + } + } +}