Document safari reactions, move b string ids to constants

This commit is contained in:
GriffinR 2022-08-23 11:11:50 -04:00
parent a5853a71bd
commit da955aaf64
15 changed files with 41 additions and 44 deletions

View File

@ -1,5 +1,6 @@
#include "constants/battle.h"
#include "constants/battle_anim.h"
#include "constants/battle_string_ids.h"
#include "constants/rgb.h"
#include "constants/songs.h"
#include "constants/sound.h"
@ -10970,9 +10971,9 @@ General_SafariRockThrow:
General_SafariReaction:
createvisualtask AnimTask_SafariGetReaction, 2
waitforvisualfinish
jumpreteq 0, SafariReaction_WatchingCarefully
jumpreteq 1, SafariReaction_Angry
jumpreteq 2, SafariReaction_Eating
jumpreteq B_MSG_MON_WATCHING, SafariReaction_WatchingCarefully
jumpreteq B_MSG_MON_ANGRY, SafariReaction_Angry
jumpreteq B_MSG_MON_EATING, SafariReaction_Eating
end
SafariReaction_WatchingCarefully:

View File

@ -11,7 +11,7 @@
#include "constants/songs.h"
#include "constants/trainers.h"
#include "constants/game_stat.h"
#include "battle_string_ids.h"
#include "constants/battle_string_ids.h"
.include "asm/macros/battle_script.inc"
@ Define these here since misc_constants.inc conflicts with the C headers
.set NULL, 0

View File

@ -9,7 +9,7 @@
#include "constants/pokemon.h"
#include "constants/songs.h"
#include "constants/game_stat.h"
#include "battle_string_ids.h"
#include "constants/battle_string_ids.h"
.include "asm/macros/battle_script.inc"
@ Define these here since misc_constants.inc conflicts with the C headers
.set NULL, 0
@ -209,7 +209,7 @@ BattleScript_PokeFluteEnd::
finishaction
BattleScript_WatchesCarefully::
printfromtable gSafariPokeblockResultStringIds
printfromtable gSafariReactionStringIds
waitmessage B_WAIT_TIME_LONG
playanimation BS_OPPONENT1, B_ANIM_SAFARI_REACTION
end2

View File

@ -402,8 +402,8 @@ struct BattleStruct
u8 runTries;
u8 caughtMonNick[POKEMON_NAME_LENGTH + 1];
u8 field_78; // unused
u8 safariGoNearCounter;
u8 safariPkblThrowCounter;
u8 safariRockThrowCounter;
u8 safariBaitThrowCounter;
u8 safariEscapeFactor;
u8 safariCatchFactor;
u8 linkBattleVsSpriteId_V;

View File

@ -2,6 +2,7 @@
#define GUARD_BATTLE_MESSAGE_H
#include "global.h"
#include "constants/battle_string_ids.h"
// for 0xFD

View File

@ -551,10 +551,11 @@
#define B_MSG_CREPT_CLOSER 0
#define B_MSG_CANT_GET_CLOSER 1
// gSafariPokeblockResultStringIds
#define B_MSG_MON_WATCHING 0
#define B_MSG_MON_ANGRY 1
#define B_MSG_MON_EATING 2
// gSafariReactionStringIds
#define B_MSG_MON_WATCHING 0
#define B_MSG_MON_ANGRY 1
#define B_MSG_MON_EATING 2
#define NUM_SAFARI_REACTIONS 3
// gFlashFireStringIds
#define B_MSG_FLASH_FIRE_BOOST 0

View File

@ -1714,13 +1714,13 @@ static void Cmd_if_random_safari_flee(void)
{
u8 safariFleeRate;
if (gBattleStruct->safariGoNearCounter)
if (gBattleStruct->safariRockThrowCounter)
{
safariFleeRate = gBattleStruct->safariEscapeFactor * 2;
if (safariFleeRate > 20)
safariFleeRate = 20;
}
else if (gBattleStruct->safariPkblThrowCounter != 0)
else if (gBattleStruct->safariBaitThrowCounter != 0)
{
safariFleeRate = gBattleStruct->safariEscapeFactor / 4;
if (safariFleeRate == 0)

View File

@ -3,6 +3,7 @@
#include "battle.h"
#include "battle_anim.h"
#include "battle_main.h"
#include "battle_message.h"
#include "battle_controllers.h"
#include "battle_interface.h"
#include "decompress.h"
@ -2278,7 +2279,7 @@ void AnimTask_SafariOrGhost_DecideAnimSides(u8 taskId)
void AnimTask_SafariGetReaction(u8 taskId)
{
if (gBattleCommunication[MULTISTRING_CHOOSER] > 2)
if (gBattleCommunication[MULTISTRING_CHOOSER] >= NUM_SAFARI_REACTIONS)
gBattleAnimArgs[7] = 0;
else
gBattleAnimArgs[7] = gBattleCommunication[MULTISTRING_CHOOSER];

View File

@ -15,7 +15,6 @@
#include "battle_interface.h"
#include "battle_message.h"
#include "reshow_battle_screen.h"
#include "battle_string_ids.h"
#include "constants/songs.h"
#include "constants/items.h"

View File

@ -15,7 +15,6 @@
#include "battle_controllers.h"
#include "battle_interface.h"
#include "battle_message.h"
#include "battle_string_ids.h"
#include "reshow_battle_screen.h"
#include "teachy_tv.h"
#include "constants/songs.h"

View File

@ -9,7 +9,6 @@
#include "battle_message.h"
#include "battle_scripts.h"
#include "battle_setup.h"
#include "battle_string_ids.h"
#include "berry.h"
#include "data.h"
#include "decompress.h"
@ -2274,8 +2273,8 @@ static void BattleStartClearSetData(void)
gLeveledUpInBattle = 0;
gAbsentBattlerFlags = 0;
gBattleStruct->runTries = 0;
gBattleStruct->safariGoNearCounter = 0;
gBattleStruct->safariPkblThrowCounter = 0;
gBattleStruct->safariRockThrowCounter = 0;
gBattleStruct->safariBaitThrowCounter = 0;
*(&gBattleStruct->safariCatchFactor) = gBaseStats[GetMonData(&gEnemyParty[0], MON_DATA_SPECIES)].catchRate * 100 / 1275;
*(&gBattleStruct->safariEscapeFactor) = gBaseStats[GetMonData(&gEnemyParty[0], MON_DATA_SPECIES)].safariZoneFleeRate * 100 / 1275;
if (gBattleStruct->safariEscapeFactor <= 1)
@ -4331,32 +4330,32 @@ static void HandleAction_WatchesCarefully(void)
gBattlerAttacker = gBattlerByTurnOrder[gCurrentTurnActionNumber];
gBattle_BG0_X = 0;
gBattle_BG0_Y = 0;
if (gBattleStruct->safariGoNearCounter != 0)
if (gBattleStruct->safariRockThrowCounter != 0)
{
--gBattleStruct->safariGoNearCounter;
if (gBattleStruct->safariGoNearCounter == 0)
--gBattleStruct->safariRockThrowCounter;
if (gBattleStruct->safariRockThrowCounter == 0)
{
*(&gBattleStruct->safariCatchFactor) = gBaseStats[GetMonData(gEnemyParty, MON_DATA_SPECIES)].catchRate * 100 / 1275;
gBattleCommunication[MULTISTRING_CHOOSER] = 0;
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_MON_WATCHING;
}
else
{
gBattleCommunication[MULTISTRING_CHOOSER] = 1;
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_MON_ANGRY;
}
}
else
{
if (gBattleStruct->safariPkblThrowCounter != 0)
if (gBattleStruct->safariBaitThrowCounter != 0)
{
--gBattleStruct->safariPkblThrowCounter;
if (gBattleStruct->safariPkblThrowCounter == 0)
gBattleCommunication[MULTISTRING_CHOOSER] = 0;
--gBattleStruct->safariBaitThrowCounter;
if (gBattleStruct->safariBaitThrowCounter == 0)
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_MON_WATCHING;
else
gBattleCommunication[5] = 2;
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_MON_EATING;
}
else
{
gBattleCommunication[MULTISTRING_CHOOSER] = 0;
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_MON_WATCHING;
}
}
gBattlescriptCurrInstr = gBattlescriptsForSafariActions[0];
@ -4379,10 +4378,10 @@ static void HandleAction_ThrowBait(void)
gBattlerAttacker = gBattlerByTurnOrder[gCurrentTurnActionNumber];
gBattle_BG0_X = 0;
gBattle_BG0_Y = 0;
gBattleStruct->safariPkblThrowCounter += Random() % 5 + 2;
if (gBattleStruct->safariPkblThrowCounter > 6)
gBattleStruct->safariPkblThrowCounter = 6;
gBattleStruct->safariGoNearCounter = 0;
gBattleStruct->safariBaitThrowCounter += Random() % 5 + 2;
if (gBattleStruct->safariBaitThrowCounter > 6)
gBattleStruct->safariBaitThrowCounter = 6;
gBattleStruct->safariRockThrowCounter = 0;
gBattleStruct->safariCatchFactor >>= 1;
if (gBattleStruct->safariCatchFactor <= 2)
gBattleStruct->safariCatchFactor = 3;
@ -4395,10 +4394,10 @@ static void HandleAction_ThrowRock(void)
gBattlerAttacker = gBattlerByTurnOrder[gCurrentTurnActionNumber];
gBattle_BG0_X = 0;
gBattle_BG0_Y = 0;
gBattleStruct->safariGoNearCounter += Random() % 5 + 2;
if (gBattleStruct->safariGoNearCounter > 6)
gBattleStruct->safariGoNearCounter = 6;
gBattleStruct->safariPkblThrowCounter = 0;
gBattleStruct->safariRockThrowCounter += Random() % 5 + 2;
if (gBattleStruct->safariRockThrowCounter > 6)
gBattleStruct->safariRockThrowCounter = 6;
gBattleStruct->safariBaitThrowCounter = 0;
gBattleStruct->safariCatchFactor <<= 1;
if (gBattleStruct->safariCatchFactor > 20)
gBattleStruct->safariCatchFactor = 20;

View File

@ -1,6 +1,5 @@
#include "global.h"
#include "gflib.h"
#include "battle_string_ids.h"
#include "battle.h"
#include "battle_anim.h"
#include "strings.h"
@ -1186,7 +1185,7 @@ const u16 gInobedientStringIds[] =
[B_MSG_PRETEND_NOT_NOTICE] = STRINGID_PKMNPRETENDNOTNOTICE
};
const u16 gSafariPokeblockResultStringIds[] =
const u16 gSafariReactionStringIds[NUM_SAFARI_REACTIONS] =
{
[B_MSG_MON_WATCHING] = STRINGID_PKMNWATCHINGCAREFULLY,
[B_MSG_MON_ANGRY] = STRINGID_PKMNANGRY,

View File

@ -23,7 +23,6 @@
#include "battle_anim.h"
#include "battle_ai_script_commands.h"
#include "battle_scripts.h"
#include "battle_string_ids.h"
#include "reshow_battle_screen.h"
#include "battle_controllers.h"
#include "battle_interface.h"

View File

@ -15,7 +15,6 @@
#include "battle_message.h"
#include "constants/battle_anim.h"
#include "battle_controllers.h"
#include "battle_string_ids.h"
#include "battle_ai_script_commands.h"
#include "constants/battle.h"
#include "constants/moves.h"

View File

@ -22,7 +22,6 @@
#include "task.h"
#include "text_window.h"
#include "trig.h"
#include "battle_string_ids.h"
#include "constants/moves.h"
#include "constants/songs.h"
#include "constants/pokemon.h"