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
+2 -2
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)
+2 -1
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];
-1
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"
-1
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"
+21 -22
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;
+1 -2
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,
-1
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"
-1
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"
-1
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"