From 2f4f63afdb6a7b77a8161f0cd42ae64cc5f1515c Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Mon, 15 Mar 2021 14:27:50 -0400 Subject: Document old man batttle controller --- src/battle_message.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/battle_message.c') diff --git a/src/battle_message.c b/src/battle_message.c index 68f75ffa1..e3669abd0 100644 --- a/src/battle_message.c +++ b/src/battle_message.c @@ -1469,7 +1469,7 @@ void BufferStringBattle(u16 stringId) gLastUsedItem = sBattleMsgDataPtr->lastItem; gLastUsedAbility = sBattleMsgDataPtr->lastAbility; gBattleScripting.battler = sBattleMsgDataPtr->scrActive; - *(&gBattleStruct->field_52) = sBattleMsgDataPtr->unk1605E; + *(&gBattleStruct->scriptPartyIdx) = sBattleMsgDataPtr->bakScriptPartyIdx; *(&gBattleStruct->hpScale) = sBattleMsgDataPtr->hpScale; gPotentialItemEffectBattler = sBattleMsgDataPtr->itemEffectBattler; *(&gBattleStruct->stringMoveType) = sBattleMsgDataPtr->moveType; @@ -2079,7 +2079,7 @@ u32 BattleStringExpandPlaceholders(const u8 *src, u8 *dst) toCpy = gStringVar4; break; case B_TXT_26: // ? - HANDLE_NICKNAME_STRING_CASE(gBattleScripting.battler, *(&gBattleStruct->field_52)) + HANDLE_NICKNAME_STRING_CASE(gBattleScripting.battler, *(&gBattleStruct->scriptPartyIdx)) break; case B_TXT_PC_CREATOR_NAME: // lanette pc if (FlagGet(FLAG_SYS_NOT_SOMEONES_PC)) @@ -2379,6 +2379,9 @@ static const struct BattleWindowText sTextOnWindowsInfo_Normal[] = { const u8 gUnknown_83FEC90[] = {0x04, 0x05, 0x02, 0x02}; +// windowId: Upper 2 bits are text flags +// x40: Use NPC context-defined font +// x80: Inhibit window clear void BattlePutTextOnWindow(const u8 *text, u8 windowId) { bool32 copyToVram; struct TextPrinterTemplate printerTemplate; @@ -2457,7 +2460,7 @@ void BattlePutTextOnWindow(const u8 *text, u8 windowId) { } } -bool8 sub_80D89B0(u16 stringId) +bool8 BattleStringShouldBeColored(u16 stringId) { if (stringId == STRINGID_TRAINER1LOSETEXT || stringId == STRINGID_TRAINER2CLASS || stringId == STRINGID_TRAINER1WINTEXT || stringId == STRINGID_TRAINER2NAME) return TRUE; -- cgit v1.2.3 From 18f108088229e520660ee55fe74a323b3156b036 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Thu, 18 Mar 2021 14:33:43 -0400 Subject: Finish syncing pokemon.c with emerald --- src/battle_message.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/battle_message.c') diff --git a/src/battle_message.c b/src/battle_message.c index e3669abd0..20b7f9c75 100644 --- a/src/battle_message.c +++ b/src/battle_message.c @@ -1983,7 +1983,7 @@ u32 BattleStringExpandPlaceholders(const u8 *src, u8 *dst) if (gTrainerBattleOpponent_A == SECRET_BASE_OPPONENT) toCpy = gTrainerClassNames[GetSecretBaseTrainerNameIndex()]; else if (gTrainerBattleOpponent_A == TRAINER_OPPONENT_C00) - toCpy = gTrainerClassNames[sub_80447F0()]; + toCpy = gTrainerClassNames[GetUnionRoomTrainerClass()]; else if (gBattleTypeFlags & BATTLE_TYPE_BATTLE_TOWER) toCpy = gTrainerClassNames[GetBattleTowerTrainerClassNameId()]; else if (gBattleTypeFlags & BATTLE_TYPE_TRAINER_TOWER) -- cgit v1.2.3