Merge pull request #537 from GriffinRichards/doc-bmsg

Sync/document battle_message.c
This commit is contained in:
GriffinR
2022-08-23 10:45:48 -04:00
committed by GitHub
33 changed files with 777 additions and 433 deletions
+6 -6
View File
@@ -1282,16 +1282,16 @@
various BS_ATTACKER, VARIOUS_RESET_PLAYER_FAINTED
.endm
.macro various8 battler:req
various \battler, 8
.macro getbattlersforrecall
various BS_ATTACKER, VARIOUS_GET_BATTLERS_FOR_RECALL
.endm
.macro returnopponentmon1toball battler:req
various \battler, VARIOUS_RETURN_OPPONENT_MON1
.macro returnopponentmon1toball
various BS_ATTACKER, VARIOUS_RETURN_OPPONENT_MON1
.endm
.macro returnopponentmon2toball battler:req
various \battler, VARIOUS_RETURN_OPPONENT_MON2
.macro returnopponentmon2toball
various BS_ATTACKER, VARIOUS_RETURN_OPPONENT_MON2
.endm
.macro checkpokeflute battler:req
+3 -3
View File
@@ -2964,13 +2964,13 @@ BattleScript_RivalBattleLostSkipMonRecall::
end2
BattleScript_BattleTowerLost::
various8 BS_ATTACKER
getbattlersforrecall
jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 0, BattleScript_BattleTowerLostLostSkipMonRecall
printfromtable gDoubleBattleRecallStrings
waitmessage B_WAIT_TIME_LONG
returnopponentmon1toball BS_ATTACKER
returnopponentmon1toball
waitstate
returnopponentmon2toball BS_ATTACKER
returnopponentmon2toball
waitstate
BattleScript_BattleTowerLostLostSkipMonRecall::
trainerslidein BS_ATTACKER
+1 -1
View File
@@ -30,7 +30,7 @@
&& !(gDisableStructs[battler].mimickedMoves & gBitTable[moveSlot]))
#define TRAINER_OPPONENT_3FE 0x3FE
#define TRAINER_OPPONENT_C00 0xC00
#define TRAINER_UNION_ROOM 0xC00
#define TRAINER_LINK_OPPONENT 0x800
#define SECRET_BASE_OPPONENT 0x400
+10 -2
View File
@@ -3,8 +3,7 @@
#include "global.h"
enum
{
enum {
AI_ITEM_FULL_RESTORE = 1,
AI_ITEM_HEAL_HP,
AI_ITEM_CURE_CONDITION,
@@ -13,6 +12,15 @@ enum
AI_ITEM_NOT_RECOGNIZABLE
};
enum {
AI_HEAL_CONFUSION,
AI_HEAL_PARALYSIS,
AI_HEAL_FREEZE,
AI_HEAL_BURN,
AI_HEAL_POISON,
AI_HEAL_SLEEP,
};
void AI_TrySwitchOrUseItem(void);
u8 GetMostSuitableMonToSwitchInto(void);
+5 -5
View File
@@ -242,11 +242,11 @@ extern const u8 gText_Ice[];
extern const u8 gText_Confusion[];
extern const u8 gText_Love[];
extern const u8 gUnknown_83FE859[];
extern const u8 gUnknown_83FE85E[];
extern const u8 gUnknown_83FE85C[];
extern const u8 gUnknown_83FE860[];
extern const u8 gUnknown_83FE864[];
extern const u8 gText_BattleTowerBan_Space[];
extern const u8 gText_BattleTowerBan_Newline1[];
extern const u8 gText_BattleTowerBan_Newline2[];
extern const u8 gText_BattleTowerBan_Is1[];
extern const u8 gText_BattleTowerBan_Is2[];
extern const u8 gText_SafariBalls[];
extern const u8 gText_HighlightRed_Left[];
+5 -8
View File
@@ -385,7 +385,7 @@
#define STRINGID_TRAINER1MON2COMEBACK 384
#define STRINGID_TRAINER1MON1AND2COMEBACK 385
#define BATTLESTRINGS_COUNT 374
#define BATTLESTRINGS_COUNT 386
// This is the string id that gBattleStringsTable starts with.
// String ids before this (e.g. STRINGID_INTROMSG) are not in the table,
@@ -545,19 +545,16 @@
#define B_MSG_WONT_OBEY 1
#define B_MSG_TURNED_AWAY 2
#define B_MSG_PRETEND_NOT_NOTICE 3
#define B_MSG_INCAPABLE_OF_POWER 4
// For randomly selecting a disobey string
// Skips the one used for Battle Palace
#define NUM_LOAF_STRINGS 4
#define NUM_LOAF_STRINGS 4 // For randomly selecting a disobey string
// gSafariGetNearStringIds
#define B_MSG_CREPT_CLOSER 0
#define B_MSG_CANT_GET_CLOSER 1
// gSafariPokeblockResultStringIds
#define B_MSG_MON_CURIOUS 0
#define B_MSG_MON_ENTHRALLED 1
#define B_MSG_MON_IGNORED 2
#define B_MSG_MON_WATCHING 0
#define B_MSG_MON_ANGRY 1
#define B_MSG_MON_EATING 2
// gFlashFireStringIds
#define B_MSG_FLASH_FIRE_BOOST 0
+1 -1
View File
@@ -324,7 +324,7 @@
#define BATTLE_RUN_FORBIDDEN 1
#define BATTLE_RUN_FAILURE 2
// Window Ids for sStandardBattleWindowTemplates
// Window Ids for sTextOnWindowsInfo_Normal
#define B_WIN_MSG 0
#define B_WIN_ACTION_PROMPT 1 // "What will {x} do?"
#define B_WIN_ACTION_MENU 2 // "Fight/Pokémon/Bag/Run" menu
+1 -1
View File
@@ -87,7 +87,7 @@
#define VARIOUS_RESET_INTIMIDATE_TRACE_BITS 5
#define VARIOUS_UPDATE_CHOICE_MOVE_ON_LVL_UP 6
#define VARIOUS_RESET_PLAYER_FAINTED 7
#define VARIOUS_CASE_8 8
#define VARIOUS_GET_BATTLERS_FOR_RECALL 8
#define VARIOUS_RETURN_OPPONENT_MON1 9
#define VARIOUS_RETURN_OPPONENT_MON2 10
#define VARIOUS_CHECK_POKEFLUTE 11
+20 -19
View File
@@ -93,25 +93,26 @@
#define MON_DATA_SPDEF2 88
// Pokemon types
#define TYPE_NORMAL 0x00
#define TYPE_FIGHTING 0x01
#define TYPE_FLYING 0x02
#define TYPE_POISON 0x03
#define TYPE_GROUND 0x04
#define TYPE_ROCK 0x05
#define TYPE_BUG 0x06
#define TYPE_GHOST 0x07
#define TYPE_STEEL 0x08
#define TYPE_MYSTERY 0x09
#define TYPE_FIRE 0x0a
#define TYPE_WATER 0x0b
#define TYPE_GRASS 0x0c
#define TYPE_ELECTRIC 0x0d
#define TYPE_PSYCHIC 0x0e
#define TYPE_ICE 0x0f
#define TYPE_DRAGON 0x10
#define TYPE_DARK 0x11
#define NUMBER_OF_MON_TYPES 0x12
#define TYPE_NONE 255
#define TYPE_NORMAL 0
#define TYPE_FIGHTING 1
#define TYPE_FLYING 2
#define TYPE_POISON 3
#define TYPE_GROUND 4
#define TYPE_ROCK 5
#define TYPE_BUG 6
#define TYPE_GHOST 7
#define TYPE_STEEL 8
#define TYPE_MYSTERY 9
#define TYPE_FIRE 10
#define TYPE_WATER 11
#define TYPE_GRASS 12
#define TYPE_ELECTRIC 13
#define TYPE_PSYCHIC 14
#define TYPE_ICE 15
#define TYPE_DRAGON 16
#define TYPE_DARK 17
#define NUMBER_OF_MON_TYPES 18
// Pokemon egg groups
#define EGG_GROUP_NONE 0
+1
View File
@@ -16,6 +16,7 @@
#define WEATHER_DROUGHT 12 // unused and broken in overworld
#define WEATHER_DOWNPOUR 13 // unused
#define WEATHER_UNDERWATER_BUBBLES 14 // unused
#define WEATHER_ABNORMAL 15 // unused
#define WEATHER_ROUTE119_CYCLE 20 // unused
#define WEATHER_ROUTE123_CYCLE 21 // unused
+1 -1
View File
@@ -4848,7 +4848,7 @@ extern const u32 gBuyMenuFrame_TmHmTilemap[];
extern const u32 gBuyMenuFrame_Pal[];
// battle_message
extern const u16 gUnknown_8D2FBB4[];
extern const u16 gPPTextPalette[];
// trainer card
extern const u16 gKantoTrainerCard_Pal[];
+2 -2
View File
@@ -11,8 +11,8 @@ enum StringConvertMode
};
u8 *StringCopy_Nickname(u8 *dest, const u8 *src);
u8 *StringGetEnd10(u8 *str);
u8 *StringCopy7(u8 *dest, const u8 *src);
u8 *StringGet_Nickname(u8 *str);
u8 *StringCopy_PlayerName(u8 *dest, const u8 *src);
u8 *StringCopy(u8 *dest, const u8 *src);
u8 *StringAppend(u8 *dest, const u8 *src);
u8 *StringCopyN(u8 *dest, const u8 *src, u8 n);
+2 -2
View File
@@ -216,12 +216,12 @@ extern const u8 gString_SlotMachineControls[];
// battle_controller_safari
extern const u8 gText_EmptyString3[];
extern const u8 gUnknown_83FE747[];
extern const u8 gText_SafariZoneMenu[];
extern const u8 gText_WhatWillPlayerThrow[];
// battle_controller_player
extern const u8 gText_BattleSwitchWhich[];
extern const u8 gUnknown_83FE770[];
extern const u8 gText_MoveInterfaceDynamicColors[];
extern const u8 gText_MoveInterfacePP[];
extern const u8 gText_MoveInterfaceType[];
extern const u8 gText_LinkStandby[];
+1 -1
View File
@@ -1134,7 +1134,7 @@ static void LinkOpponentHandleDrawTrainerPic(void)
else
{
xPos = 176;
if (gTrainerBattleOpponent_A == TRAINER_OPPONENT_C00)
if (gTrainerBattleOpponent_A == TRAINER_UNION_ROOM)
{
trainerPicId = GetUnionRoomTrainerPic();
}
+2 -2
View File
@@ -1369,7 +1369,7 @@ static void MoveSelectionDisplayMoveNames(void)
for (i = 0; i < MAX_MON_MOVES; ++i)
{
MoveSelectionDestroyCursorAt(i);
StringCopy(gDisplayedStringBattle, gUnknown_83FE770);
StringCopy(gDisplayedStringBattle, gText_MoveInterfaceDynamicColors);
StringAppend(gDisplayedStringBattle, gMoveNames[moveInfo->moves[i]]);
BattlePutTextOnWindow(gDisplayedStringBattle, i + 3);
if (moveInfo->moves[i] != MOVE_NONE)
@@ -1407,7 +1407,7 @@ static void MoveSelectionDisplayMoveType(void)
*txtPtr++ = EXT_CTRL_CODE_BEGIN;
*txtPtr++ = 6;
*txtPtr++ = 1;
txtPtr = StringCopy(txtPtr, gUnknown_83FE770);
txtPtr = StringCopy(txtPtr, gText_MoveInterfaceDynamicColors);
StringCopy(txtPtr, gTypeNames[gBattleMoves[moveInfo->moves[gMoveSelectionCursor[gActiveBattler]]].type]);
BattlePutTextOnWindow(gDisplayedStringBattle, B_WIN_MOVE_TYPE);
}
+1 -1
View File
@@ -439,7 +439,7 @@ static void SafariHandleChooseAction(void)
gBattlerControllerFuncs[gActiveBattler] = HandleChooseActionAfterDma3;
BattlePutTextOnWindow(gText_EmptyString3, B_WIN_MSG);
BattlePutTextOnWindow(gUnknown_83FE747, B_WIN_ACTION_MENU);
BattlePutTextOnWindow(gText_SafariZoneMenu, B_WIN_ACTION_MENU);
for (i = 0; i < 4; ++i)
ActionSelectionDestroyCursorAt(i);
ActionSelectionCreateCursorAt(gActionSelectionCursor[gActiveBattler], 0);
+1 -1
View File
@@ -1473,7 +1473,7 @@ void UpdateNickInHealthbox(u8 healthboxSpriteId, struct Pokemon *mon)
ptr = StringCopy(gDisplayedStringBattle, gUnknown_8260556);
GetMonData(mon, MON_DATA_NICKNAME, nickname);
StringGetEnd10(nickname);
StringGet_Nickname(nickname);
ptr = StringCopy(ptr, nickname);
*ptr++ = EXT_CTRL_CODE_BEGIN;
*ptr++ = EXT_CTRL_CODE_COLOR;
+686 -349
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -6125,7 +6125,7 @@ static void Cmd_various(void)
gHitMarker &= ~HITMARKER_PLAYER_FAINTED;
}
break;
case VARIOUS_CASE_8:
case VARIOUS_GET_BATTLERS_FOR_RECALL:
i = 0; // redundant
gBattleCommunication[MULTISTRING_CHOOSER] = 0;
gActiveBattler = 1;
+8 -8
View File
@@ -717,21 +717,21 @@ static u8 AppendBattleTowerBannedSpeciesName(u16 species, u8 count)
if (GetSetPokedexFlag(SpeciesToNationalPokedexNum(species), FLAG_GET_CAUGHT))
{
if (count == 0)
StringAppend(gStringVar1, gUnknown_83FE859);
StringAppend(gStringVar1, gText_BattleTowerBan_Space);
count++;
StringAppend(gStringVar1, gSpeciesNames[species]);
switch (count)
{
case 2:
StringAppend(gStringVar1, gUnknown_83FE85E);
StringAppend(gStringVar1, gText_BattleTowerBan_Newline2);
break;
case 5:
case 8:
case 11:
StringAppend(gStringVar1, gUnknown_83FE85C);
StringAppend(gStringVar1, gText_BattleTowerBan_Newline1);
break;
default:
StringAppend(gStringVar1, gUnknown_83FE859);
StringAppend(gStringVar1, gText_BattleTowerBan_Space);
break;
}
}
@@ -815,9 +815,9 @@ void CheckPartyBattleTowerBanlist(void)
i = StringLength(gStringVar1);
gStringVar1[i - 1] = EOS;
if (counter < 3)
StringAppend(gStringVar1, gUnknown_83FE860);
StringAppend(gStringVar1, gText_BattleTowerBan_Is1);
else
StringAppend(gStringVar1, gUnknown_83FE864);
StringAppend(gStringVar1, gText_BattleTowerBan_Is2);
}
else
{
@@ -1119,7 +1119,7 @@ static void SetPlayerBattleTowerRecord(void)
playerRecord->trainerClass = trainerClass;
CopyTrainerId(playerRecord->trainerId, gSaveBlock2Ptr->playerTrainerId);
StringCopy7(playerRecord->name, gSaveBlock2Ptr->playerName);
StringCopy_PlayerName(playerRecord->name, gSaveBlock2Ptr->playerName);
playerRecord->winStreak = GetCurrentBattleTowerWinStreak(battleTowerLevelType);
@@ -1310,7 +1310,7 @@ static void Debug_FillEReaderTrainerWithPlayerData(void)
}
CopyTrainerId(ereaderTrainer->trainerId, gSaveBlock2Ptr->playerTrainerId);
StringCopy7(ereaderTrainer->name, gSaveBlock2Ptr->playerName);
StringCopy_PlayerName(ereaderTrainer->name, gSaveBlock2Ptr->playerName);
ereaderTrainer->winStreak = 1;
+1 -1
View File
@@ -36,7 +36,7 @@ static void FaintFromFieldPoison(u8 partyIdx)
AdjustFriendship(pokemon, FRIENDSHIP_EVENT_FAINT_OUTSIDE_BATTLE);
SetMonData(pokemon, MON_DATA_STATUS, &status);
GetMonData(pokemon, MON_DATA_NICKNAME, gStringVar1);
StringGetEnd10(gStringVar1);
StringGet_Nickname(gStringVar1);
}
static bool32 MonFaintedFromPoison(u8 partyIdx)
+1 -1
View File
@@ -1671,7 +1671,7 @@ static void ChangePokemonNickname_CB(void)
void BufferMonNickname(void)
{
GetMonData(&gPlayerParty[gSpecialVar_0x8004], MON_DATA_NICKNAME, gStringVar1);
StringGetEnd10(gStringVar1);
StringGet_Nickname(gStringVar1);
}
void IsMonOTIDNotPlayers(void)
+1 -1
View File
@@ -950,7 +950,7 @@ const u32 gBattleAnimSpritePal_Meteor[] = INCBIN_U32("graphics/battle_anims/spri
const u32 gBattleAnimSpriteGfx_FlatRock[] = INCBIN_U32("graphics/battle_anims/sprites/flat_rock.4bpp.lz");
const u32 gBattleAnimSpritePal_FlatRock[] = INCBIN_U32("graphics/battle_anims/sprites/flat_rock.gbapal.lz");
const u16 gUnknown_8D2FBB4[] = INCBIN_U16("graphics/interface/unk_8D2FBB4.gbapal");
const u16 gPPTextPalette[] = INCBIN_U16("graphics/interface/text_pp.gbapal");
#include "data/graphics/pokemon.h"
#include "data/graphics/trainers.h"
+2 -2
View File
@@ -895,7 +895,7 @@ static void DisplayPartyPokemonDataForMultiBattle(u8 slot)
{
menuBox->infoRects->blitFunc(menuBox->windowId, 0, 0, 0, 0, FALSE);
StringCopy(gStringVar1, gMultiPartnerParty[actualSlot].nickname);
StringGetEnd10(gStringVar1);
StringGet_Nickname(gStringVar1);
if (StringLength(gStringVar1) <= 5)
ConvertInternationalString(gStringVar1, 1);
DisplayPartyPokemonBarDetail(menuBox->windowId, gStringVar1, 0, menuBox->infoRects->dimensions);
@@ -1530,7 +1530,7 @@ static s8 GetNewSlotDoubleLayout(s8 slotId, s8 movementDir)
u8 *GetMonNickname(struct Pokemon *mon, u8 *dest)
{
GetMonData(mon, MON_DATA_NICKNAME, dest);
return StringGetEnd10(dest);
return StringGet_Nickname(dest);
}
#define tKeepOpen data[0]
+1 -1
View File
@@ -6082,7 +6082,7 @@ bool8 CheckBattleTypeGhost(struct Pokemon *mon, u8 battlerId)
if (gBattleTypeFlags & BATTLE_TYPE_GHOST && GetBattlerSide(battlerId) != B_SIDE_PLAYER)
{
GetMonData(mon, MON_DATA_NICKNAME, buffer);
StringGetEnd10(buffer);
StringGet_Nickname(buffer);
if (!StringCompare(buffer, gText_Ghost))
return TRUE;
}
+2 -2
View File
@@ -1026,7 +1026,7 @@ static void SetCursorMonData(void *pokemon, u8 mode)
gPSSData->displayMonIsEgg = GetMonData(mon, MON_DATA_IS_EGG);
GetMonData(mon, MON_DATA_NICKNAME, gPSSData->displayMonName);
StringGetEnd10(gPSSData->displayMonName);
StringGet_Nickname(gPSSData->displayMonName);
gPSSData->displayMonLevel = GetMonData(mon, MON_DATA_LEVEL);
gPSSData->displayMonMarkings = GetMonData(mon, MON_DATA_MARKINGS);
gPSSData->displayMonPersonality = GetMonData(mon, MON_DATA_PERSONALITY);
@@ -1051,7 +1051,7 @@ static void SetCursorMonData(void *pokemon, u8 mode)
GetBoxMonData(boxMon, MON_DATA_NICKNAME, gPSSData->displayMonName);
StringGetEnd10(gPSSData->displayMonName);
StringGet_Nickname(gPSSData->displayMonName);
gPSSData->displayMonLevel = GetLevelFromBoxMonExp(boxMon);
gPSSData->displayMonMarkings = GetBoxMonData(boxMon, MON_DATA_MARKINGS);
gPSSData->displayMonPersonality = GetBoxMonData(boxMon, MON_DATA_PERSONALITY);
+1 -1
View File
@@ -2110,7 +2110,7 @@ static void BufferMonInfo(void)
GetMonData(&sMonSummaryScreen->currentMon, MON_DATA_NICKNAME, tempStr);
StringCopyN_Multibyte(sMonSummaryScreen->summary.nicknameStrBuf, tempStr, POKEMON_NAME_LENGTH);
StringGetEnd10(sMonSummaryScreen->summary.nicknameStrBuf);
StringGet_Nickname(sMonSummaryScreen->summary.nicknameStrBuf);
gender = GetMonGender(&sMonSummaryScreen->currentMon);
dexNum = GetMonData(&sMonSummaryScreen->currentMon, MON_DATA_SPECIES2);
+3 -3
View File
@@ -1149,9 +1149,9 @@ static const u16 *BufferQuestLogText_LinkBattledMulti(const u16 *a0)
memset(gStringVar1, EOS, PLAYER_NAME_LENGTH + 1);
memset(gStringVar2, EOS, PLAYER_NAME_LENGTH + 1);
memset(gStringVar3, EOS, PLAYER_NAME_LENGTH + 1);
StringCopy7(gStringVar1, (const u8 *)a0 + 5);
StringCopy7(gStringVar2, (const u8 *)a0 + 12);
StringCopy7(gStringVar3, (const u8 *)a0 + 19);
StringCopy_PlayerName(gStringVar1, (const u8 *)a0 + 5);
StringCopy_PlayerName(gStringVar2, (const u8 *)a0 + 12);
StringCopy_PlayerName(gStringVar3, (const u8 *)a0 + 19);
BufferLinkPartnersName(gStringVar1);
BufferLinkPartnersName(gStringVar2);
BufferLinkPartnersName(gStringVar3);
+1 -1
View File
@@ -1617,7 +1617,7 @@ bool8 ScrCmd_bufferpartymonnick(struct ScriptContext * ctx)
u16 partyIndex = VarGet(ScriptReadHalfword(ctx));
GetMonData(&gPlayerParty[partyIndex], MON_DATA_NICKNAME, sScriptStringVars[stringVarIndex]);
StringGetEnd10(sScriptStringVars[stringVarIndex]);
StringGet_Nickname(sScriptStringVars[stringVarIndex]);
return FALSE;
}
+4 -4
View File
@@ -54,10 +54,10 @@ u8 *StringCopy_Nickname(u8 *dest, const u8 *src)
return &dest[i];
}
u8 *StringGetEnd10(u8 *str)
u8 *StringGet_Nickname(u8 *str)
{
u8 i;
u32 limit = 10;
u32 limit = POKEMON_NAME_LENGTH;
for (i = 0; i < limit; i++)
if (str[i] == EOS)
@@ -67,10 +67,10 @@ u8 *StringGetEnd10(u8 *str)
return &str[i];
}
u8 *StringCopy7(u8 *dest, const u8 *src)
u8 *StringCopy_PlayerName(u8 *dest, const u8 *src)
{
s32 i;
s32 limit = 7;
s32 limit = PLAYER_NAME_LENGTH;
for (i = 0; i < limit; i++)
{
+1 -1
View File
@@ -645,7 +645,7 @@ static const u8 sUnref_84570D1[] = _("{DYNAMIC 00}·{DYNAMIC 01}");
// These are functions in Emerald but inlined in FireRed
#define IntlConvPartnerUname7(dest, arg1) ({ \
StringCopy7(dest, (arg1).gname_uname.uname); \
StringCopy_PlayerName(dest, (arg1).gname_uname.uname); \
ConvertInternationalString(dest, (arg1).gname_uname.gname.unk_00.language); \
})
+1 -1
View File
@@ -58,7 +58,7 @@ static void SetUpPartiesAndStartBattle(void)
}
IncrementGameStat(GAME_STAT_NUM_UNION_ROOM_BATTLES);
CalculatePlayerPartyCount();
gTrainerBattleOpponent_A = TRAINER_OPPONENT_C00;
gTrainerBattleOpponent_A = TRAINER_UNION_ROOM;
SetMainCallback2(CB2_InitBattle);
}