Merge pull request #1397 from GriffinRichards/doc-moremisc

Clean up battle scripts
This commit is contained in:
GriffinR
2021-04-10 12:41:35 -04:00
committed by GitHub
36 changed files with 1468 additions and 1097 deletions
+1 -1
View File
@@ -1311,7 +1311,7 @@
various \battler, 15 various \battler, 15
.endm .endm
.macro arenajudmengtstring id:req .macro arenajudgmentstring id:req
various \id, VARIOUS_ARENA_JUDGMENT_STRING various \id, VARIOUS_ARENA_JUDGMENT_STRING
.endm .endm
+586 -581
View File
File diff suppressed because it is too large Load Diff
+34 -39
View File
@@ -34,7 +34,7 @@ gBattlescriptsForUsingItem:: @ 82DBD3C
.4byte BattleScript_OpponentUsesHealItem @ AI_ITEM_HEAL_HP .4byte BattleScript_OpponentUsesHealItem @ AI_ITEM_HEAL_HP
.4byte BattleScript_OpponentUsesStatusCureItem @ AI_ITEM_CURE_CONDITION .4byte BattleScript_OpponentUsesStatusCureItem @ AI_ITEM_CURE_CONDITION
.4byte BattleScript_OpponentUsesXItem @ AI_ITEM_X_STAT .4byte BattleScript_OpponentUsesXItem @ AI_ITEM_X_STAT
.4byte BattleScript_OpponentUsesGuardSpecs @ AI_ITEM_GUARD_SPECS .4byte BattleScript_OpponentUsesGuardSpec @ AI_ITEM_GUARD_SPEC
.align 2 .align 2
gBattlescriptsForRunningByItem:: @ 82DBD54 gBattlescriptsForRunningByItem:: @ 82DBD54
@@ -69,16 +69,16 @@ BattleScript_PrintCaughtMonInfo::
trysetcaughtmondexflags BattleScript_TryNicknameCaughtMon trysetcaughtmondexflags BattleScript_TryNicknameCaughtMon
printstring STRINGID_PKMNDATAADDEDTODEX printstring STRINGID_PKMNDATAADDEDTODEX
waitstate waitstate
setbyte gBattleCommunication, 0x0 setbyte gBattleCommunication, 0
displaydexinfo displaydexinfo
BattleScript_TryNicknameCaughtMon:: BattleScript_TryNicknameCaughtMon::
printstring STRINGID_GIVENICKNAMECAPTURED printstring STRINGID_GIVENICKNAMECAPTURED
waitstate waitstate
setbyte gBattleCommunication, 0x0 setbyte gBattleCommunication, 0
trygivecaughtmonnick BattleScript_GiveCaughtMonEnd trygivecaughtmonnick BattleScript_GiveCaughtMonEnd
givecaughtmon givecaughtmon
printfromtable gCaughtMonStringIds printfromtable gCaughtMonStringIds
waitmessage 0x40 waitmessage B_WAIT_TIME_LONG
goto BattleScript_SuccessBallThrowEnd goto BattleScript_SuccessBallThrowEnd
BattleScript_GiveCaughtMonEnd:: BattleScript_GiveCaughtMonEnd::
givecaughtmon givecaughtmon
@@ -93,83 +93,78 @@ BattleScript_WallyBallThrow::
BattleScript_ShakeBallThrow:: BattleScript_ShakeBallThrow::
printfromtable gBallEscapeStringIds printfromtable gBallEscapeStringIds
waitmessage 0x40 waitmessage B_WAIT_TIME_LONG
jumpifword CMP_NO_COMMON_BITS, gBattleTypeFlags, BATTLE_TYPE_SAFARI, BattleScript_ShakeBallThrowEnd jumpifword CMP_NO_COMMON_BITS, gBattleTypeFlags, BATTLE_TYPE_SAFARI, BattleScript_ShakeBallThrowEnd
jumpifbyte CMP_NOT_EQUAL, gNumSafariBalls, 0x0, BattleScript_ShakeBallThrowEnd jumpifbyte CMP_NOT_EQUAL, gNumSafariBalls, 0, BattleScript_ShakeBallThrowEnd
printstring STRINGID_OUTOFSAFARIBALLS printstring STRINGID_OUTOFSAFARIBALLS
waitmessage 0x40 waitmessage B_WAIT_TIME_LONG
setbyte gBattleOutcome, B_OUTCOME_NO_SAFARI_BALLS setbyte gBattleOutcome, B_OUTCOME_NO_SAFARI_BALLS
BattleScript_ShakeBallThrowEnd:: BattleScript_ShakeBallThrowEnd::
finishaction finishaction
BattleScript_TrainerBallBlock:: BattleScript_TrainerBallBlock::
waitmessage 0x40 waitmessage B_WAIT_TIME_LONG
printstring STRINGID_TRAINERBLOCKEDBALL printstring STRINGID_TRAINERBLOCKEDBALL
waitmessage 0x40 waitmessage B_WAIT_TIME_LONG
printstring STRINGID_DONTBEATHIEF printstring STRINGID_DONTBEATHIEF
waitmessage 0x40 waitmessage B_WAIT_TIME_LONG
finishaction finishaction
BattleScript_PlayerUsesItem:: BattleScript_PlayerUsesItem::
setbyte sMOVEEND_STATE, 0xF moveendcase MOVEEND_MIRROR_MOVE
moveend 0x1, 0x0
end end
BattleScript_OpponentUsesHealItem:: BattleScript_OpponentUsesHealItem::
printstring STRINGID_EMPTYSTRING3 printstring STRINGID_EMPTYSTRING3
pause 0x30 pause B_WAIT_TIME_MED
playse SE_USE_ITEM playse SE_USE_ITEM
printstring STRINGID_TRAINER1USEDITEM printstring STRINGID_TRAINER1USEDITEM
waitmessage 0x40 waitmessage B_WAIT_TIME_LONG
useitemonopponent useitemonopponent
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE
healthbarupdate BS_ATTACKER healthbarupdate BS_ATTACKER
datahpupdate BS_ATTACKER datahpupdate BS_ATTACKER
printstring STRINGID_PKMNSITEMRESTOREDHEALTH printstring STRINGID_PKMNSITEMRESTOREDHEALTH
waitmessage 0x40 waitmessage B_WAIT_TIME_LONG
updatestatusicon BS_ATTACKER updatestatusicon BS_ATTACKER
setbyte sMOVEEND_STATE, 0xF moveendcase MOVEEND_MIRROR_MOVE
moveend 0x1, 0x0
finishaction finishaction
BattleScript_OpponentUsesStatusCureItem:: BattleScript_OpponentUsesStatusCureItem::
printstring STRINGID_EMPTYSTRING3 printstring STRINGID_EMPTYSTRING3
pause 0x30 pause B_WAIT_TIME_MED
playse SE_USE_ITEM playse SE_USE_ITEM
printstring STRINGID_TRAINER1USEDITEM printstring STRINGID_TRAINER1USEDITEM
waitmessage 0x40 waitmessage B_WAIT_TIME_LONG
useitemonopponent useitemonopponent
printfromtable gTrainerItemCuredStatusStringIds printfromtable gTrainerItemCuredStatusStringIds
waitmessage 0x40 waitmessage B_WAIT_TIME_LONG
updatestatusicon BS_ATTACKER updatestatusicon BS_ATTACKER
setbyte sMOVEEND_STATE, 0xF moveendcase MOVEEND_MIRROR_MOVE
moveend 0x1, 0x0
finishaction finishaction
BattleScript_OpponentUsesXItem:: BattleScript_OpponentUsesXItem::
printstring STRINGID_EMPTYSTRING3 printstring STRINGID_EMPTYSTRING3
pause 0x30 pause B_WAIT_TIME_MED
playse SE_USE_ITEM playse SE_USE_ITEM
printstring STRINGID_TRAINER1USEDITEM printstring STRINGID_TRAINER1USEDITEM
waitmessage 0x40 waitmessage B_WAIT_TIME_LONG
useitemonopponent useitemonopponent
printfromtable gStatUpStringIds printfromtable gStatUpStringIds
waitmessage 0x40 waitmessage B_WAIT_TIME_LONG
setbyte sMOVEEND_STATE, 0xF moveendcase MOVEEND_MIRROR_MOVE
moveend 0x1, 0x0
finishaction finishaction
BattleScript_OpponentUsesGuardSpecs:: BattleScript_OpponentUsesGuardSpec::
printstring STRINGID_EMPTYSTRING3 printstring STRINGID_EMPTYSTRING3
pause 0x30 pause B_WAIT_TIME_MED
playse SE_USE_ITEM playse SE_USE_ITEM
printstring STRINGID_TRAINER1USEDITEM printstring STRINGID_TRAINER1USEDITEM
waitmessage 0x40 waitmessage B_WAIT_TIME_LONG
useitemonopponent useitemonopponent
printfromtable gMistUsedStringIds printfromtable gMistUsedStringIds
waitmessage 0x40 waitmessage B_WAIT_TIME_LONG
setbyte sMOVEEND_STATE, 0xF moveendcase MOVEEND_MIRROR_MOVE
moveend 0x1, 0x0
finishaction finishaction
BattleScript_RunByUsingItem:: BattleScript_RunByUsingItem::
@@ -179,29 +174,29 @@ BattleScript_RunByUsingItem::
BattleScript_ActionWatchesCarefully: BattleScript_ActionWatchesCarefully:
printstring STRINGID_PKMNWATCHINGCAREFULLY printstring STRINGID_PKMNWATCHINGCAREFULLY
waitmessage 0x40 waitmessage B_WAIT_TIME_LONG
end2 end2
BattleScript_ActionGetNear: BattleScript_ActionGetNear:
printfromtable gSafariGetNearStringIds printfromtable gSafariGetNearStringIds
waitmessage 0x40 waitmessage B_WAIT_TIME_LONG
end2 end2
BattleScript_ActionThrowPokeblock: BattleScript_ActionThrowPokeblock:
printstring STRINGID_THREWPOKEBLOCKATPKMN printstring STRINGID_THREWPOKEBLOCKATPKMN
waitmessage 0x40 waitmessage B_WAIT_TIME_LONG
playanimation BS_ATTACKER, B_ANIM_POKEBLOCK_THROW, NULL playanimation BS_ATTACKER, B_ANIM_POKEBLOCK_THROW, NULL
printfromtable gSafariPokeblockResultStringIds printfromtable gSafariPokeblockResultStringIds
waitmessage 0x40 waitmessage B_WAIT_TIME_LONG
end2 end2
BattleScript_ActionWallyThrow: BattleScript_ActionWallyThrow:
printstring STRINGID_RETURNMON printstring STRINGID_RETURNMON
waitmessage 0x40 waitmessage B_WAIT_TIME_LONG
returnatktoball returnatktoball
waitstate waitstate
trainerslidein BS_TARGET trainerslidein BS_TARGET
waitstate waitstate
printstring STRINGID_YOUTHROWABALLNOWRIGHT printstring STRINGID_YOUTHROWABALLNOWRIGHT
waitmessage 0x40 waitmessage B_WAIT_TIME_LONG
end2 end2
+4 -4
View File
@@ -2925,7 +2925,7 @@ gTVInSearchOfTrainersText08:: @ 0828C011
.string "That's all for today!\n" .string "That's all for today!\n"
.string "See you again on our next broadcast!$" .string "See you again on our next broadcast!$"
gTVPokemonContestLiveUpdates2Text00:: @ 0828C137 ContestLadyShow_Text_Intro:: @ 0828C137
.string "“POKéMON CONTEST LIVE UPDATES!”\p" .string "“POKéMON CONTEST LIVE UPDATES!”\p"
.string "MC: Sorry to interrupt the regular\n" .string "MC: Sorry to interrupt the regular\n"
.string "programming, and thanks for joining us!\p" .string "programming, and thanks for joining us!\p"
@@ -2940,7 +2940,7 @@ gTVPokemonContestLiveUpdates2Text00:: @ 0828C137
.string "Spectators: ?!!!!\n" .string "Spectators: ?!!!!\n"
.string "?!!!!$" .string "?!!!!$"
gTVPokemonContestLiveUpdates2Text01:: @ 0828C28C ContestLadyShow_Text_Won:: @ 0828C28C
.string "MC: Excuse me!\n" .string "MC: Excuse me!\n"
.string "Thanks for joining us on live TV!\p" .string "Thanks for joining us on live TV!\p"
.string "May I congratulate you on your win?\p" .string "May I congratulate you on your win?\p"
@@ -2959,7 +2959,7 @@ gTVPokemonContestLiveUpdates2Text01:: @ 0828C28C
.string "We did it!\l" .string "We did it!\l"
.string "Thank you!$" .string "Thank you!$"
gTVPokemonContestLiveUpdates2Text02:: @ 0828C45B ContestLadyShow_Text_Lost:: @ 0828C45B
.string "MC: Excuse me!\n" .string "MC: Excuse me!\n"
.string "Thanks for joining us on live TV!\p" .string "Thanks for joining us on live TV!\p"
.string "You must be disappointed by that turn\n" .string "You must be disappointed by that turn\n"
@@ -2979,7 +2979,7 @@ gTVPokemonContestLiveUpdates2Text02:: @ 0828C45B
.string "Uh… That's all the time we have today!\n" .string "Uh… That's all the time we have today!\n"
.string "Thanks for tuning in!$" .string "Thanks for tuning in!$"
gTVPokemonContestLiveUpdates2Text03:: @ 0828C662 ContestLadyShow_Text_LostBadly:: @ 0828C662
.string "MC: Excuse me!\n" .string "MC: Excuse me!\n"
.string "Thanks for joining us on live TV!\p" .string "Thanks for joining us on live TV!\p"
.string "How did your CONTEST appearance go?\p" .string "How did your CONTEST appearance go?\p"
+11 -10
View File
@@ -40,16 +40,17 @@
#define MAX_TRAINER_ITEMS 4 #define MAX_TRAINER_ITEMS 4
// array entries for battle communication // array entries for battle communication
#define MULTIUSE_STATE 0x0 #define MULTIUSE_STATE 0
#define CURSOR_POSITION 0x1 #define CURSOR_POSITION 1
#define TASK_ID 0x1 // task Id and cursor position share the same field #define TASK_ID 1 // task Id and cursor position share the same field
#define SPRITES_INIT_STATE1 0x1 // shares the Id as well #define SPRITES_INIT_STATE1 1 // shares the Id as well
#define SPRITES_INIT_STATE2 0x2 #define SPRITES_INIT_STATE2 2
#define MOVE_EFFECT_BYTE 0x3 #define MOVE_EFFECT_BYTE 3
#define ACTIONS_CONFIRMED_COUNT 0x4 #define ACTIONS_CONFIRMED_COUNT 4
#define MULTISTRING_CHOOSER 0x5 #define MULTISTRING_CHOOSER 5
#define MSG_DISPLAY 0x7 #define MISS_TYPE 6
#define BATTLE_COMMUNICATION_ENTRIES_COUNT 0x8 #define MSG_DISPLAY 7
#define BATTLE_COMMUNICATION_ENTRIES_COUNT 8
#define MOVE_TARGET_SELECTED 0x0 #define MOVE_TARGET_SELECTED 0x0
#define MOVE_TARGET_DEPENDS 0x1 #define MOVE_TARGET_DEPENDS 0x1
+21 -1
View File
@@ -7,10 +7,30 @@ enum
AI_ITEM_HEAL_HP, AI_ITEM_HEAL_HP,
AI_ITEM_CURE_CONDITION, AI_ITEM_CURE_CONDITION,
AI_ITEM_X_STAT, AI_ITEM_X_STAT,
AI_ITEM_GUARD_SPECS, AI_ITEM_GUARD_SPEC,
AI_ITEM_NOT_RECOGNIZABLE AI_ITEM_NOT_RECOGNIZABLE
}; };
enum {
AI_HEAL_CONFUSION,
AI_HEAL_PARALYSIS,
AI_HEAL_FREEZE,
AI_HEAL_BURN,
AI_HEAL_POISON,
AI_HEAL_SLEEP,
};
enum {
AI_X_ATTACK,
AI_X_DEFEND,
AI_X_SPEED,
AI_X_SPATK,
AI_X_SPDEF, // Unused
AI_X_ACCURACY,
AI_X_EVASION, // Unused
AI_DIRE_HIT,
};
void AI_TrySwitchOrUseItem(void); void AI_TrySwitchOrUseItem(void);
u8 GetMostSuitableMonToSwitchInto(void); u8 GetMostSuitableMonToSwitchInto(void);
+2 -2
View File
@@ -156,7 +156,7 @@ enum
CONTROLLER_CLEARUNKFLAG, CONTROLLER_CLEARUNKFLAG,
CONTROLLER_TOGGLEUNKFLAG, CONTROLLER_TOGGLEUNKFLAG,
CONTROLLER_HITANIMATION, CONTROLLER_HITANIMATION,
CONTROLLER_42, CONTROLLER_CANTSWITCH,
CONTROLLER_PLAYSE, CONTROLLER_PLAYSE,
CONTROLLER_PLAYFANFAREORBGM, CONTROLLER_PLAYFANFAREORBGM,
CONTROLLER_FAINTINGCRY, CONTROLLER_FAINTINGCRY,
@@ -227,7 +227,7 @@ void BtlController_EmitSetUnkVar(u8 bufferId, u8 b); // unused
void BtlController_EmitClearUnkFlag(u8 bufferId); // unused void BtlController_EmitClearUnkFlag(u8 bufferId); // unused
void BtlController_EmitToggleUnkFlag(u8 bufferId); // unused void BtlController_EmitToggleUnkFlag(u8 bufferId); // unused
void BtlController_EmitHitAnimation(u8 bufferId); void BtlController_EmitHitAnimation(u8 bufferId);
void BtlController_EmitCmd42(u8 bufferId); void BtlController_EmitCantSwitch(u8 bufferId);
void BtlController_EmitPlaySE(u8 bufferId, u16 songId); void BtlController_EmitPlaySE(u8 bufferId, u16 songId);
void BtlController_EmitPlayFanfareOrBGM(u8 bufferId, u16 songId, bool8 playBGM); void BtlController_EmitPlayFanfareOrBGM(u8 bufferId, u16 songId, bool8 playBGM);
void BtlController_EmitFaintingCry(u8 bufferId); void BtlController_EmitFaintingCry(u8 bufferId);
+1 -2
View File
@@ -223,7 +223,6 @@ extern const u8* const gBattleStringsTable[];
extern const u8* const gStatNamesTable[]; extern const u8* const gStatNamesTable[];
extern const u8* const gPokeblockWasTooXStringTable[]; extern const u8* const gPokeblockWasTooXStringTable[];
extern const u8* const gRefereeStringsTable[]; extern const u8* const gRefereeStringsTable[];
extern const u8* const gStatNamesTable2[];
extern const u8 *const gRoundsStringTable[]; extern const u8 *const gRoundsStringTable[];
extern const u8 gText_PkmnIsEvolving[]; extern const u8 gText_PkmnIsEvolving[];
@@ -269,7 +268,7 @@ extern const u8 gText_Win[];
extern const u8 gText_Loss[]; extern const u8 gText_Loss[];
extern const u8 gText_Draw[]; extern const u8 gText_Draw[];
extern const u8 gText_StatRose[]; extern const u8 gText_StatRose[];
extern const u8 gText_PkmnsStatChanged2[]; extern const u8 gText_DefendersStatRose[];
extern const u8 gText_PkmnGettingPumped[]; extern const u8 gText_PkmnGettingPumped[];
extern const u8 gText_PkmnShroudedInMist[]; extern const u8 gText_PkmnShroudedInMist[];
extern const u8 gText_PkmnsXPreventsSwitching[]; extern const u8 gText_PkmnsXPreventsSwitching[];
+4
View File
@@ -302,4 +302,8 @@
#define BATTLE_TERRAIN_BUILDING 8 #define BATTLE_TERRAIN_BUILDING 8
#define BATTLE_TERRAIN_PLAIN 9 #define BATTLE_TERRAIN_PLAIN 9
#define B_WAIT_TIME_LONG 64
#define B_WAIT_TIME_MED 48
#define B_WAIT_TIME_SHORT 32
#endif // GUARD_CONSTANTS_BATTLE_H #endif // GUARD_CONSTANTS_BATTLE_H
+27 -22
View File
@@ -32,14 +32,17 @@
#define cEFFECT_CHOOSER gBattleCommunication + 3 #define cEFFECT_CHOOSER gBattleCommunication + 3
#define cMULTISTRING_CHOOSER gBattleCommunication + 5 #define cMULTISTRING_CHOOSER gBattleCommunication + 5
#define cMISS_TYPE gBattleCommunication + 6
// Battle Script defines for getting the wanted battler // Battle Script defines for getting the wanted battler
#define BS_TARGET 0 #define BS_TARGET 0
#define BS_ATTACKER 1 #define BS_ATTACKER 1
#define BS_EFFECT_BATTLER 2 #define BS_EFFECT_BATTLER 2
#define BS_FAINTED 3 #define BS_FAINTED 3
#define BS_BATTLER_0 7
#define BS_ATTACKER_WITH_PARTNER 4 // for Cmd_updatestatusicon #define BS_ATTACKER_WITH_PARTNER 4 // for Cmd_updatestatusicon
#define BS_UNK_5 5
#define BS_UNK_6 6
#define BS_BATTLER_0 7
#define BS_ATTACKER_SIDE 8 // for Cmd_jumpifability #define BS_ATTACKER_SIDE 8 // for Cmd_jumpifability
#define BS_NOT_ATTACKER_SIDE 9 // for Cmd_jumpifability #define BS_NOT_ATTACKER_SIDE 9 // for Cmd_jumpifability
#define BS_SCRIPTING 10 #define BS_SCRIPTING 10
@@ -54,12 +57,12 @@
#define ACC_CURR_MOVE 0 #define ACC_CURR_MOVE 0
// compare operands // compare operands
#define CMP_EQUAL 0x0 #define CMP_EQUAL 0
#define CMP_NOT_EQUAL 0x1 #define CMP_NOT_EQUAL 1
#define CMP_GREATER_THAN 0x2 #define CMP_GREATER_THAN 2
#define CMP_LESS_THAN 0x3 #define CMP_LESS_THAN 3
#define CMP_COMMON_BITS 0x4 #define CMP_COMMON_BITS 4
#define CMP_NO_COMMON_BITS 0x5 #define CMP_NO_COMMON_BITS 5
// Cmd_various // Cmd_various
#define VARIOUS_CANCEL_MULTI_TURN_MOVES 0 #define VARIOUS_CANCEL_MULTI_TURN_MOVES 0
@@ -92,27 +95,29 @@
#define DMG_DOUBLED 2 #define DMG_DOUBLED 2
// Cmd_jumpifcantswitch // Cmd_jumpifcantswitch
#define SWITCH_IGNORE_ESCAPE_PREVENTION 0x80 #define SWITCH_IGNORE_ESCAPE_PREVENTION (1 << 7)
// Cmd_statbuffchange // Cmd_statbuffchange
#define STAT_BUFF_ALLOW_PTR 0x1 // If set, allow use of jumpptr. Set in every use of statbuffchange #define STAT_BUFF_ALLOW_PTR (1 << 0) // If set, allow use of jumpptr. Set in every use of statbuffchange
#define STAT_BUFF_NOT_PROTECT_AFFECTED 0x20 #define STAT_BUFF_NOT_PROTECT_AFFECTED (1 << 5)
// stat change flags for Cmd_playstatchangeanimation // stat change flags for Cmd_playstatchangeanimation
#define STAT_CHANGE_NEGATIVE 0x1 #define STAT_CHANGE_NEGATIVE (1 << 0)
#define STAT_CHANGE_BY_TWO 0x2 #define STAT_CHANGE_BY_TWO (1 << 1)
#define STAT_CHANGE_MULTIPLE_STATS 0x4 #define STAT_CHANGE_MULTIPLE_STATS (1 << 2)
#define STAT_CHANGE_CANT_PREVENT 0x8 #define STAT_CHANGE_CANT_PREVENT (1 << 3)
// stat flags for Cmd_playstatchangeanimation // stat flags for Cmd_playstatchangeanimation
#define BIT_HP 0x1 #define BIT_HP (1 << 0)
#define BIT_ATK 0x2 #define BIT_ATK (1 << 1)
#define BIT_DEF 0x4 #define BIT_DEF (1 << 2)
#define BIT_SPEED 0x8 #define BIT_SPEED (1 << 3)
#define BIT_SPATK 0x10 #define BIT_SPATK (1 << 4)
#define BIT_SPDEF 0x20 #define BIT_SPDEF (1 << 5)
#define BIT_ACC 0x40 #define BIT_ACC (1 << 6)
#define BIT_EVASION 0x80 #define BIT_EVASION (1 << 7)
#define PARTY_SCREEN_OPTIONAL (1 << 7) // Flag for first argument to openpartyscreen
// cases for Cmd_moveend // cases for Cmd_moveend
#define MOVEEND_RAGE 0 #define MOVEEND_RAGE 0
+219 -5
View File
@@ -214,10 +214,10 @@
#define STRINGID_STATROSE 210 #define STRINGID_STATROSE 210
#define STRINGID_STATHARSHLY 211 #define STRINGID_STATHARSHLY 211
#define STRINGID_STATFELL 212 #define STRINGID_STATFELL 212
#define STRINGID_PKMNSSTATCHANGED 213 #define STRINGID_ATTACKERSSTATROSE 213
#define STRINGID_PKMNSSTATCHANGED2 214 #define STRINGID_DEFENDERSSTATROSE 214
#define STRINGID_PKMNSSTATCHANGED3 215 #define STRINGID_ATTACKERSSTATFELL 215
#define STRINGID_PKMNSSTATCHANGED4 216 #define STRINGID_DEFENDERSSTATFELL 216
#define STRINGID_CRITICALHIT 217 #define STRINGID_CRITICALHIT 217
#define STRINGID_ONEHITKO 218 #define STRINGID_ONEHITKO 218
#define STRINGID_123POOF 219 #define STRINGID_123POOF 219
@@ -326,7 +326,7 @@
#define STRINGID_SOOTHINGAROMA 322 #define STRINGID_SOOTHINGAROMA 322
#define STRINGID_ITEMSCANTBEUSEDNOW 323 #define STRINGID_ITEMSCANTBEUSEDNOW 323
#define STRINGID_FORXCOMMAYZ 324 #define STRINGID_FORXCOMMAYZ 324
#define STRINGID_USINGXTHEYOFZN 325 #define STRINGID_USINGITEMSTATOFPKMNROSE 325
#define STRINGID_PKMNUSEDXTOGETPUMPED 326 #define STRINGID_PKMNUSEDXTOGETPUMPED 326
#define STRINGID_PKMNSXMADEYUSELESS 327 #define STRINGID_PKMNSXMADEYUSELESS 327
#define STRINGID_PKMNTRAPPEDBYSANDTOMB 328 #define STRINGID_PKMNTRAPPEDBYSANDTOMB 328
@@ -383,4 +383,218 @@
#define STRINGID_TRAINER1WINTEXT 379 #define STRINGID_TRAINER1WINTEXT 379
#define STRINGID_TRAINER2WINTEXT 380 #define STRINGID_TRAINER2WINTEXT 380
// The below IDs are all indexes into battle message tables,
// used to determine which of a set of messages to print.
// They are assigned to the MULTISTRING_CHOOSER byte of gBattleCommunication
// and read when e.g. the command printfromtable is used.
// gStatUpStringIds
#define B_MSG_ATTACKER_STAT_ROSE 0
#define B_MSG_DEFENDER_STAT_ROSE 1
#define B_MSG_STAT_WONT_INCREASE 2
#define B_MSG_STAT_ROSE_EMPTY 3
#define B_MSG_STAT_ROSE_ITEM 4
#define B_MSG_USED_DIRE_HIT 5
// gStatDownStringIds
#define B_MSG_ATTACKER_STAT_FELL 0
#define B_MSG_DEFENDER_STAT_FELL 1
#define B_MSG_STAT_WONT_DECREASE 2
#define B_MSG_STAT_FELL_EMPTY 3
// gMissStringIds
#define B_MSG_MISSED 0
#define B_MSG_PROTECTED 1
#define B_MSG_AVOIDED_ATK 2
#define B_MSG_AVOIDED_DMG 3
#define B_MSG_GROUND_MISS 4
// gAbsorbDrainStringIds
#define B_MSG_ABSORB 0
#define B_MSG_ABSORB_OOZE 1
// gLeechSeedStringIds
#define B_MSG_LEECH_SEED_SET 0
#define B_MSG_LEECH_SEED_MISS 1
#define B_MSG_LEECH_SEED_FAIL 2
#define B_MSG_LEECH_SEED_DRAIN 3
#define B_MSG_LEECH_SEED_OOZE 4
// gFirstTurnOfTwoStringIds
#define B_MSG_TURN1_RAZOR_WIND 0
#define B_MSG_TURN1_SOLAR_BEAM 1
#define B_MSG_TURN1_SKULL_BASH 2
#define B_MSG_TURN1_SKY_ATTACK 3
#define B_MSG_TURN1_FLY 4
#define B_MSG_TURN1_DIG 5
#define B_MSG_TURN1_DIVE 6
#define B_MSG_TURN1_BOUNCE 7
// gMoveWeatherChangeStringIds
#define B_MSG_STARTED_RAIN 0
#define B_MSG_STARTED_DOWNPOUR 1
#define B_MSG_WEATHER_FAILED 2
#define B_MSG_STARTED_SANDSTORM 3
#define B_MSG_STARTED_SUNLIGHT 4
#define B_MSG_STARTED_HAIL 5
// gRainContinuesStringIds
#define B_MSG_RAIN_CONTINUES 0
#define B_MSG_DOWNPOUR_CONTINUES 1
#define B_MSG_RAIN_STOPPED 2
// gSandStormHailContinuesStringIds / gSandStormHailDmgStringIds/ gSandStormHailEndStringIds
#define B_MSG_SANDSTORM 0
#define B_MSG_HAIL 1
// gReflectLightScreenSafeguardStringIds
#define B_MSG_SIDE_STATUS_FAILED 0
#define B_MSG_SET_REFLECT_SINGLE 1
#define B_MSG_SET_REFLECT_DOUBLE 2
#define B_MSG_SET_LIGHTSCREEN_SINGLE 3
#define B_MSG_SET_LIGHTSCREEN_DOUBLE 4
#define B_MSG_SET_SAFEGUARD 5
// gProtectLikeUsedStringIds
#define B_MSG_PROTECTED_ITSELF 0
#define B_MSG_BRACED_ITSELF 1
#define B_MSG_PROTECT_FAILED 2
// gRestUsedStringIds
#define B_MSG_REST 0
#define B_MSG_REST_STATUSED 1
// gWokeUpStringIds
#define B_MSG_WOKE_UP 0
#define B_MSG_WOKE_UP_UPROAR 1
// gUproarAwakeStringIds
#define B_MSG_CANT_SLEEP_UPROAR 0
#define B_MSG_UPROAR_KEPT_AWAKE 1
#define B_MSG_STAYED_AWAKE_USING 2
// gUproarOverTurnStringIds
#define B_MSG_UPROAR_CONTINUES 0
#define B_MSG_UPROAR_ENDS 1
// gStockpileUsedStringIds
#define B_MSG_STOCKPILED 0
#define B_MSG_CANT_STOCKPILE 1
// gSwallowFailStringIds
#define B_MSG_SWALLOW_FAILED 0
#define B_MSG_SWALLOW_FULL_HP 1
// gKOFailedStringIds
#define B_MSG_KO_MISS 0
#define B_MSG_KO_UNAFFECTED 1
// gMistUsedStringIds
#define B_MSG_SET_MIST 0
#define B_MSG_MIST_FAILED 1
// gFocusEnergyUsedStringIds
#define B_MSG_GETTING_PUMPED 0
#define B_MSG_FOCUS_ENERGY_FAILED 1
// gTransformUsedStringIds
#define B_MSG_TRANSFORMED 0
#define B_MSG_TRANSFORM_FAILED 1
// gSubsituteUsedStringIds
#define B_MSG_SET_SUBSTITUTE 0
#define B_MSG_SUBSTITUTE_FAILED 1
// gPartyStatusHealStringIds
#define B_MSG_BELL 0
#define B_MSG_BELL_SOUNDPROOF_ATTACKER 1
#define B_MSG_BELL_SOUNDPROOF_PARTNER 2
#define B_MSG_BELL_BOTH_SOUNDPROOF 3
#define B_MSG_SOOTHING_AROMA 4
// gFutureMoveUsedStringIds
#define B_MSG_FUTURE_SIGHT 0
#define B_MSG_DOOM_DESIRE 1
// gItemSwapStringIds
#define B_MSG_ITEM_SWAP_TAKEN 0
#define B_MSG_ITEM_SWAP_GIVEN 1
#define B_MSG_ITEM_SWAP_BOTH 2
// gSportsUsedStringIds
#define B_MSG_WEAKEN_ELECTRIC 0
#define B_MSG_WEAKEN_FIRE 1
// gCaughtMonStringIds
#define B_MSG_SENT_SOMEONES_PC 0
#define B_MSG_SENT_LANETTES_PC 1
#define B_MSG_SOMEONES_BOX_FULL 2
#define B_MSG_LANETTES_BOX_FULL 3
// gInobedientStringIds
#define B_MSG_LOAFING 0
#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
// 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
// gFlashFireStringIds
#define B_MSG_FLASH_FIRE_BOOST 0
#define B_MSG_FLASH_FIRE_NO_BOOST 1
// gBerryEffectStringIds
#define B_MSG_CURED_PROBLEM 0
#define B_MSG_NORMALIZED_STATUS 1
// gNoEscapeStringIds
#define B_MSG_CANT_ESCAPE 0
#define B_MSG_DONT_LEAVE_BIRCH 1
#define B_MSG_PREVENTS_ESCAPE 2
#define B_MSG_CANT_ESCAPE_2 3
#define B_MSG_ATTACKER_CANT_ESCAPE 4
// gGotPoisonedStringIds / gGotParalyzedStringIds / gFellAsleepStringIds
// gGotBurnedStringIds / gGotFrozenStringIds / gAttractUsedStringIds
#define B_MSG_STATUSED 0
#define B_MSG_STATUSED_BY_ABILITY 1
// gBRNPreventionStringIds / gPRLZPreventionStringIds / gPSNPreventionStringIds
#define B_MSG_ABILITY_PREVENTS_MOVE_STATUS 0
#define B_MSG_ABILITY_PREVENTS_ABILITY_STATUS 1
#define B_MSG_STATUS_HAD_NO_EFFECT 2
// gGotDefrostedStringIds
#define B_MSG_DEFROSTED 0
#define B_MSG_DEFROSTED_BY_MOVE 1
// gBattlePalaceFlavorTextTable
#define B_MSG_GLINT_IN_EYE 0
#define B_MSG_GETTING_IN_POS 1
#define B_MSG_GROWL_DEEPLY 2
#define B_MSG_EAGER_FOR_MORE 3
// gRefereeStringsTable
#define B_MSG_REF_NOTHING_IS_DECIDED 0
#define B_MSG_REF_THATS_IT 1
#define B_MSG_REF_JUDGE_MIND 2
#define B_MSG_REF_JUDGE_SKILL 3
#define B_MSG_REF_JUDGE_BODY 4
#define B_MSG_REF_PLAYER_WON 5
#define B_MSG_REF_OPPONENT_WON 6
#define B_MSG_REF_DRAW 7
#define B_MSG_REF_COMMENCE_BATTLE 8
#endif // GUARD_CONSTANTS_BATTLE_STRING_IDS_H #endif // GUARD_CONSTANTS_BATTLE_STRING_IDS_H
+7 -1
View File
@@ -23,4 +23,10 @@
#define QUIZ_QUESTION_LEN 9 #define QUIZ_QUESTION_LEN 9
#endif // Constants for how many good Pokéblocks the Contest Lady was given
// This determines how her performance is described when her TV show comes on
#define CONTEST_LADY_NORMAL 0
#define CONTEST_LADY_GOOD 1
#define CONTEST_LADY_BAD 2
#endif // GUARD_LILYCOVE_LADY_CONSTANTS_H
+7 -1
View File
@@ -19,7 +19,7 @@
#define TVSHOW_3_CHEERS_FOR_POKEBLOCKS 9 #define TVSHOW_3_CHEERS_FOR_POKEBLOCKS 9
#define TVSHOW_BATTLE_UPDATE 10 #define TVSHOW_BATTLE_UPDATE 10
#define TVSHOW_FAN_CLUB_SPECIAL 11 #define TVSHOW_FAN_CLUB_SPECIAL 11
#define TVSHOW_CONTEST_LIVE_UPDATES_2 12 #define TVSHOW_LILYCOVE_CONTEST_LADY 12
// // // //
#define TVSHOW_POKEMON_TODAY_CAUGHT 21 #define TVSHOW_POKEMON_TODAY_CAUGHT 21
#define TVSHOW_SMART_SHOPPER 22 #define TVSHOW_SMART_SHOPPER 22
@@ -215,4 +215,10 @@
#define TRENDWATCHER_STATE_BIGGER_FEMALE 5 #define TRENDWATCHER_STATE_BIGGER_FEMALE 5
#define TRENDWATCHER_STATE_OUTRO 6 #define TRENDWATCHER_STATE_OUTRO 6
// TV Show states for the Contest Lady's Live Updates show
#define CONTESTLADYLIVE_STATE_INTRO 0
#define CONTESTLADYLIVE_STATE_WON 1
#define CONTESTLADYLIVE_STATE_LOST 2
#define CONTESTLADYLIVE_STATE_LOST_BADLY 3
#endif //GUARD_CONSTANTS_TV_H #endif //GUARD_CONSTANTS_TV_H
+4 -4
View File
@@ -344,10 +344,10 @@ extern const u8 gTVInSearchOfTrainersText05[];
extern const u8 gTVInSearchOfTrainersText06[]; extern const u8 gTVInSearchOfTrainersText06[];
extern const u8 gTVInSearchOfTrainersText07[]; extern const u8 gTVInSearchOfTrainersText07[];
extern const u8 gTVInSearchOfTrainersText08[]; extern const u8 gTVInSearchOfTrainersText08[];
extern const u8 gTVPokemonContestLiveUpdates2Text00[]; extern const u8 ContestLadyShow_Text_Intro[];
extern const u8 gTVPokemonContestLiveUpdates2Text01[]; extern const u8 ContestLadyShow_Text_Won[];
extern const u8 gTVPokemonContestLiveUpdates2Text02[]; extern const u8 ContestLadyShow_Text_Lost[];
extern const u8 gTVPokemonContestLiveUpdates2Text03[]; extern const u8 ContestLadyShow_Text_LostBadly[];
extern const u8 gPokeNewsTextSlateport_Upcoming[]; extern const u8 gPokeNewsTextSlateport_Upcoming[];
extern const u8 gPokeNewsTextSlateport_Ongoing[]; extern const u8 gPokeNewsTextSlateport_Ongoing[];
extern const u8 gPokeNewsTextSlateport_Ending[]; extern const u8 gPokeNewsTextSlateport_Ending[];
+2 -2
View File
@@ -179,7 +179,7 @@ typedef union // size = 0x24
/*0x18*/ u8 idolNameLanguage; /*0x18*/ u8 idolNameLanguage;
} fanClubSpecial; } fanClubSpecial;
// TVSHOW_CONTEST_LIVE_UPDATES_2 // TVSHOW_LILYCOVE_CONTEST_LADY
struct { struct {
/*0x00*/ u8 kind; /*0x00*/ u8 kind;
/*0x01*/ bool8 active; /*0x01*/ bool8 active;
@@ -189,7 +189,7 @@ typedef union // size = 0x24
/*0x16*/ u8 pokeblockState; /*0x16*/ u8 pokeblockState;
/*0x17*/ u8 language; /*0x17*/ u8 language;
/*0x18*/ u8 pokemonNameLanguage; /*0x18*/ u8 pokemonNameLanguage;
} contestLiveUpdates2; } contestLady;
// Record Mixing Shows // Record Mixing Shows
// TVSHOW_POKEMON_TODAY_CAUGHT // TVSHOW_POKEMON_TODAY_CAUGHT
+1 -1
View File
@@ -12,6 +12,6 @@ void BufferContestLadyMonName(u8 *dest1, u8 *dest2);
void BufferContestLadyPlayerName(u8 *dest); void BufferContestLadyPlayerName(u8 *dest);
void BufferContestLadyLanguage(u8 *dest); void BufferContestLadyLanguage(u8 *dest);
void BufferContestName(u8 *dest, u8 category); void BufferContestName(u8 *dest, u8 category);
u8 sub_818E880(void); u8 GetContestLadyPokeblockState(void);
#endif //GUARD_LILYCOVE_LADY_H #endif //GUARD_LILYCOVE_LADY_H
+16 -15
View File
@@ -789,7 +789,7 @@ static u8 GetAI_ItemType(u8 itemId, const u8 *itemEffect) // NOTE: should take u
else if (itemEffect[0] & (ITEM0_DIRE_HIT | ITEM0_X_ATTACK) || itemEffect[1] != 0 || itemEffect[2] != 0) else if (itemEffect[0] & (ITEM0_DIRE_HIT | ITEM0_X_ATTACK) || itemEffect[1] != 0 || itemEffect[2] != 0)
return AI_ITEM_X_STAT; return AI_ITEM_X_STAT;
else if (itemEffect[3] & ITEM3_GUARD_SPEC) else if (itemEffect[3] & ITEM3_GUARD_SPEC)
return AI_ITEM_GUARD_SPECS; return AI_ITEM_GUARD_SPEC;
else else
return AI_ITEM_NOT_RECOGNIZABLE; return AI_ITEM_NOT_RECOGNIZABLE;
} }
@@ -863,32 +863,33 @@ static bool8 ShouldUseItem(void)
*(gBattleStruct->AI_itemFlags + gActiveBattler / 2) = 0; *(gBattleStruct->AI_itemFlags + gActiveBattler / 2) = 0;
if (itemEffects[3] & ITEM3_SLEEP && gBattleMons[gActiveBattler].status1 & STATUS1_SLEEP) if (itemEffects[3] & ITEM3_SLEEP && gBattleMons[gActiveBattler].status1 & STATUS1_SLEEP)
{ {
*(gBattleStruct->AI_itemFlags + gActiveBattler / 2) |= 0x20; *(gBattleStruct->AI_itemFlags + gActiveBattler / 2) |= (1 << AI_HEAL_SLEEP);
shouldUse = TRUE; shouldUse = TRUE;
} }
if (itemEffects[3] & ITEM3_POISON && (gBattleMons[gActiveBattler].status1 & STATUS1_POISON || gBattleMons[gActiveBattler].status1 & STATUS1_TOXIC_POISON)) if (itemEffects[3] & ITEM3_POISON && (gBattleMons[gActiveBattler].status1 & STATUS1_POISON
|| gBattleMons[gActiveBattler].status1 & STATUS1_TOXIC_POISON))
{ {
*(gBattleStruct->AI_itemFlags + gActiveBattler / 2) |= 0x10; *(gBattleStruct->AI_itemFlags + gActiveBattler / 2) |= (1 << AI_HEAL_POISON);
shouldUse = TRUE; shouldUse = TRUE;
} }
if (itemEffects[3] & ITEM3_BURN && gBattleMons[gActiveBattler].status1 & STATUS1_BURN) if (itemEffects[3] & ITEM3_BURN && gBattleMons[gActiveBattler].status1 & STATUS1_BURN)
{ {
*(gBattleStruct->AI_itemFlags + gActiveBattler / 2) |= 0x8; *(gBattleStruct->AI_itemFlags + gActiveBattler / 2) |= (1 << AI_HEAL_BURN);
shouldUse = TRUE; shouldUse = TRUE;
} }
if (itemEffects[3] & ITEM3_FREEZE && gBattleMons[gActiveBattler].status1 & STATUS1_FREEZE) if (itemEffects[3] & ITEM3_FREEZE && gBattleMons[gActiveBattler].status1 & STATUS1_FREEZE)
{ {
*(gBattleStruct->AI_itemFlags + gActiveBattler / 2) |= 0x4; *(gBattleStruct->AI_itemFlags + gActiveBattler / 2) |= (1 << AI_HEAL_FREEZE);
shouldUse = TRUE; shouldUse = TRUE;
} }
if (itemEffects[3] & ITEM3_PARALYSIS && gBattleMons[gActiveBattler].status1 & STATUS1_PARALYSIS) if (itemEffects[3] & ITEM3_PARALYSIS && gBattleMons[gActiveBattler].status1 & STATUS1_PARALYSIS)
{ {
*(gBattleStruct->AI_itemFlags + gActiveBattler / 2) |= 0x2; *(gBattleStruct->AI_itemFlags + gActiveBattler / 2) |= (1 << AI_HEAL_PARALYSIS);
shouldUse = TRUE; shouldUse = TRUE;
} }
if (itemEffects[3] & ITEM3_CONFUSION && gBattleMons[gActiveBattler].status2 & STATUS2_CONFUSION) if (itemEffects[3] & ITEM3_CONFUSION && gBattleMons[gActiveBattler].status2 & STATUS2_CONFUSION)
{ {
*(gBattleStruct->AI_itemFlags + gActiveBattler / 2) |= 0x1; *(gBattleStruct->AI_itemFlags + gActiveBattler / 2) |= (1 << AI_HEAL_CONFUSION);
shouldUse = TRUE; shouldUse = TRUE;
} }
break; break;
@@ -897,20 +898,20 @@ static bool8 ShouldUseItem(void)
if (gDisableStructs[gActiveBattler].isFirstTurn == 0) if (gDisableStructs[gActiveBattler].isFirstTurn == 0)
break; break;
if (itemEffects[0] & ITEM0_X_ATTACK) if (itemEffects[0] & ITEM0_X_ATTACK)
*(gBattleStruct->AI_itemFlags + gActiveBattler / 2) |= 0x1; *(gBattleStruct->AI_itemFlags + gActiveBattler / 2) |= (1 << AI_X_ATTACK);
if (itemEffects[1] & ITEM1_X_DEFEND) if (itemEffects[1] & ITEM1_X_DEFEND)
*(gBattleStruct->AI_itemFlags + gActiveBattler / 2) |= 0x2; *(gBattleStruct->AI_itemFlags + gActiveBattler / 2) |= (1 << AI_X_DEFEND);
if (itemEffects[1] & ITEM1_X_SPEED) if (itemEffects[1] & ITEM1_X_SPEED)
*(gBattleStruct->AI_itemFlags + gActiveBattler / 2) |= 0x4; *(gBattleStruct->AI_itemFlags + gActiveBattler / 2) |= (1 << AI_X_SPEED);
if (itemEffects[2] & ITEM2_X_SPATK) if (itemEffects[2] & ITEM2_X_SPATK)
*(gBattleStruct->AI_itemFlags + gActiveBattler / 2) |= 0x8; *(gBattleStruct->AI_itemFlags + gActiveBattler / 2) |= (1 << AI_X_SPATK);
if (itemEffects[2] & ITEM2_X_ACCURACY) if (itemEffects[2] & ITEM2_X_ACCURACY)
*(gBattleStruct->AI_itemFlags + gActiveBattler / 2) |= 0x20; *(gBattleStruct->AI_itemFlags + gActiveBattler / 2) |= (1 << AI_X_ACCURACY);
if (itemEffects[0] & ITEM0_DIRE_HIT) if (itemEffects[0] & ITEM0_DIRE_HIT)
*(gBattleStruct->AI_itemFlags + gActiveBattler / 2) |= 0x80; *(gBattleStruct->AI_itemFlags + gActiveBattler / 2) |= (1 << AI_DIRE_HIT);
shouldUse = TRUE; shouldUse = TRUE;
break; break;
case AI_ITEM_GUARD_SPECS: case AI_ITEM_GUARD_SPEC:
battlerSide = GetBattlerSide(gActiveBattler); battlerSide = GetBattlerSide(gActiveBattler);
if (gDisableStructs[gActiveBattler].isFirstTurn != 0 && gSideTimers[battlerSide].mistTimer == 0) if (gDisableStructs[gActiveBattler].isFirstTurn != 0 && gSideTimers[battlerSide].mistTimer == 0)
shouldUse = TRUE; shouldUse = TRUE;
+3 -3
View File
@@ -74,7 +74,7 @@ static void LinkOpponentHandleSetUnkVar(void);
static void LinkOpponentHandleClearUnkFlag(void); static void LinkOpponentHandleClearUnkFlag(void);
static void LinkOpponentHandleToggleUnkFlag(void); static void LinkOpponentHandleToggleUnkFlag(void);
static void LinkOpponentHandleHitAnimation(void); static void LinkOpponentHandleHitAnimation(void);
static void LinkOpponentHandleCmd42(void); static void LinkOpponentHandleCantSwitch(void);
static void LinkOpponentHandlePlaySE(void); static void LinkOpponentHandlePlaySE(void);
static void LinkOpponentHandlePlayFanfareOrBGM(void); static void LinkOpponentHandlePlayFanfareOrBGM(void);
static void LinkOpponentHandleFaintingCry(void); static void LinkOpponentHandleFaintingCry(void);
@@ -146,7 +146,7 @@ static void (*const sLinkOpponentBufferCommands[CONTROLLER_CMDS_COUNT])(void) =
[CONTROLLER_CLEARUNKFLAG] = LinkOpponentHandleClearUnkFlag, [CONTROLLER_CLEARUNKFLAG] = LinkOpponentHandleClearUnkFlag,
[CONTROLLER_TOGGLEUNKFLAG] = LinkOpponentHandleToggleUnkFlag, [CONTROLLER_TOGGLEUNKFLAG] = LinkOpponentHandleToggleUnkFlag,
[CONTROLLER_HITANIMATION] = LinkOpponentHandleHitAnimation, [CONTROLLER_HITANIMATION] = LinkOpponentHandleHitAnimation,
[CONTROLLER_42] = LinkOpponentHandleCmd42, [CONTROLLER_CANTSWITCH] = LinkOpponentHandleCantSwitch,
[CONTROLLER_PLAYSE] = LinkOpponentHandlePlaySE, [CONTROLLER_PLAYSE] = LinkOpponentHandlePlaySE,
[CONTROLLER_PLAYFANFAREORBGM] = LinkOpponentHandlePlayFanfareOrBGM, [CONTROLLER_PLAYFANFAREORBGM] = LinkOpponentHandlePlayFanfareOrBGM,
[CONTROLLER_FAINTINGCRY] = LinkOpponentHandleFaintingCry, [CONTROLLER_FAINTINGCRY] = LinkOpponentHandleFaintingCry,
@@ -1647,7 +1647,7 @@ static void LinkOpponentHandleHitAnimation(void)
} }
} }
static void LinkOpponentHandleCmd42(void) static void LinkOpponentHandleCantSwitch(void)
{ {
LinkOpponentBufferExecCompleted(); LinkOpponentBufferExecCompleted();
} }
+3 -3
View File
@@ -72,7 +72,7 @@ static void LinkPartnerHandleSetUnkVar(void);
static void LinkPartnerHandleClearUnkFlag(void); static void LinkPartnerHandleClearUnkFlag(void);
static void LinkPartnerHandleToggleUnkFlag(void); static void LinkPartnerHandleToggleUnkFlag(void);
static void LinkPartnerHandleHitAnimation(void); static void LinkPartnerHandleHitAnimation(void);
static void LinkPartnerHandleCmd42(void); static void LinkPartnerHandleCantSwitch(void);
static void LinkPartnerHandlePlaySE(void); static void LinkPartnerHandlePlaySE(void);
static void LinkPartnerHandlePlayFanfareOrBGM(void); static void LinkPartnerHandlePlayFanfareOrBGM(void);
static void LinkPartnerHandleFaintingCry(void); static void LinkPartnerHandleFaintingCry(void);
@@ -143,7 +143,7 @@ static void (*const sLinkPartnerBufferCommands[CONTROLLER_CMDS_COUNT])(void) =
[CONTROLLER_CLEARUNKFLAG] = LinkPartnerHandleClearUnkFlag, [CONTROLLER_CLEARUNKFLAG] = LinkPartnerHandleClearUnkFlag,
[CONTROLLER_TOGGLEUNKFLAG] = LinkPartnerHandleToggleUnkFlag, [CONTROLLER_TOGGLEUNKFLAG] = LinkPartnerHandleToggleUnkFlag,
[CONTROLLER_HITANIMATION] = LinkPartnerHandleHitAnimation, [CONTROLLER_HITANIMATION] = LinkPartnerHandleHitAnimation,
[CONTROLLER_42] = LinkPartnerHandleCmd42, [CONTROLLER_CANTSWITCH] = LinkPartnerHandleCantSwitch,
[CONTROLLER_PLAYSE] = LinkPartnerHandlePlaySE, [CONTROLLER_PLAYSE] = LinkPartnerHandlePlaySE,
[CONTROLLER_PLAYFANFAREORBGM] = LinkPartnerHandlePlayFanfareOrBGM, [CONTROLLER_PLAYFANFAREORBGM] = LinkPartnerHandlePlayFanfareOrBGM,
[CONTROLLER_FAINTINGCRY] = LinkPartnerHandleFaintingCry, [CONTROLLER_FAINTINGCRY] = LinkPartnerHandleFaintingCry,
@@ -1477,7 +1477,7 @@ static void LinkPartnerHandleHitAnimation(void)
} }
} }
static void LinkPartnerHandleCmd42(void) static void LinkPartnerHandleCantSwitch(void)
{ {
LinkPartnerBufferExecCompleted(); LinkPartnerBufferExecCompleted();
} }
+3 -3
View File
@@ -79,7 +79,7 @@ static void OpponentHandleSetUnkVar(void);
static void OpponentHandleClearUnkFlag(void); static void OpponentHandleClearUnkFlag(void);
static void OpponentHandleToggleUnkFlag(void); static void OpponentHandleToggleUnkFlag(void);
static void OpponentHandleHitAnimation(void); static void OpponentHandleHitAnimation(void);
static void OpponentHandleCmd42(void); static void OpponentHandleCantSwitch(void);
static void OpponentHandlePlaySE(void); static void OpponentHandlePlaySE(void);
static void OpponentHandlePlayFanfareOrBGM(void); static void OpponentHandlePlayFanfareOrBGM(void);
static void OpponentHandleFaintingCry(void); static void OpponentHandleFaintingCry(void);
@@ -151,7 +151,7 @@ static void (*const sOpponentBufferCommands[CONTROLLER_CMDS_COUNT])(void) =
[CONTROLLER_CLEARUNKFLAG] = OpponentHandleClearUnkFlag, [CONTROLLER_CLEARUNKFLAG] = OpponentHandleClearUnkFlag,
[CONTROLLER_TOGGLEUNKFLAG] = OpponentHandleToggleUnkFlag, [CONTROLLER_TOGGLEUNKFLAG] = OpponentHandleToggleUnkFlag,
[CONTROLLER_HITANIMATION] = OpponentHandleHitAnimation, [CONTROLLER_HITANIMATION] = OpponentHandleHitAnimation,
[CONTROLLER_42] = OpponentHandleCmd42, [CONTROLLER_CANTSWITCH] = OpponentHandleCantSwitch,
[CONTROLLER_PLAYSE] = OpponentHandlePlaySE, [CONTROLLER_PLAYSE] = OpponentHandlePlaySE,
[CONTROLLER_PLAYFANFAREORBGM] = OpponentHandlePlayFanfareOrBGM, [CONTROLLER_PLAYFANFAREORBGM] = OpponentHandlePlayFanfareOrBGM,
[CONTROLLER_FAINTINGCRY] = OpponentHandleFaintingCry, [CONTROLLER_FAINTINGCRY] = OpponentHandleFaintingCry,
@@ -1813,7 +1813,7 @@ static void OpponentHandleHitAnimation(void)
} }
} }
static void OpponentHandleCmd42(void) static void OpponentHandleCantSwitch(void)
{ {
OpponentBufferExecCompleted(); OpponentBufferExecCompleted();
} }
+3 -3
View File
@@ -80,7 +80,7 @@ static void PlayerHandleSetUnkVar(void);
static void PlayerHandleClearUnkFlag(void); static void PlayerHandleClearUnkFlag(void);
static void PlayerHandleToggleUnkFlag(void); static void PlayerHandleToggleUnkFlag(void);
static void PlayerHandleHitAnimation(void); static void PlayerHandleHitAnimation(void);
static void PlayerHandleCmd42(void); static void PlayerHandleCantSwitch(void);
static void PlayerHandlePlaySE(void); static void PlayerHandlePlaySE(void);
static void PlayerHandlePlayFanfareOrBGM(void); static void PlayerHandlePlayFanfareOrBGM(void);
static void PlayerHandleFaintingCry(void); static void PlayerHandleFaintingCry(void);
@@ -167,7 +167,7 @@ static void (*const sPlayerBufferCommands[CONTROLLER_CMDS_COUNT])(void) =
[CONTROLLER_CLEARUNKFLAG] = PlayerHandleClearUnkFlag, [CONTROLLER_CLEARUNKFLAG] = PlayerHandleClearUnkFlag,
[CONTROLLER_TOGGLEUNKFLAG] = PlayerHandleToggleUnkFlag, [CONTROLLER_TOGGLEUNKFLAG] = PlayerHandleToggleUnkFlag,
[CONTROLLER_HITANIMATION] = PlayerHandleHitAnimation, [CONTROLLER_HITANIMATION] = PlayerHandleHitAnimation,
[CONTROLLER_42] = PlayerHandleCmd42, [CONTROLLER_CANTSWITCH] = PlayerHandleCantSwitch,
[CONTROLLER_PLAYSE] = PlayerHandlePlaySE, [CONTROLLER_PLAYSE] = PlayerHandlePlaySE,
[CONTROLLER_PLAYFANFAREORBGM] = PlayerHandlePlayFanfareOrBGM, [CONTROLLER_PLAYFANFAREORBGM] = PlayerHandlePlayFanfareOrBGM,
[CONTROLLER_FAINTINGCRY] = PlayerHandleFaintingCry, [CONTROLLER_FAINTINGCRY] = PlayerHandleFaintingCry,
@@ -2890,7 +2890,7 @@ static void PlayerHandleHitAnimation(void)
} }
} }
static void PlayerHandleCmd42(void) static void PlayerHandleCantSwitch(void)
{ {
PlayerBufferExecCompleted(); PlayerBufferExecCompleted();
} }
+3 -3
View File
@@ -70,7 +70,7 @@ static void PlayerPartnerHandleSetUnkVar(void);
static void PlayerPartnerHandleClearUnkFlag(void); static void PlayerPartnerHandleClearUnkFlag(void);
static void PlayerPartnerHandleToggleUnkFlag(void); static void PlayerPartnerHandleToggleUnkFlag(void);
static void PlayerPartnerHandleHitAnimation(void); static void PlayerPartnerHandleHitAnimation(void);
static void PlayerPartnerHandleCmd42(void); static void PlayerPartnerHandleCantSwitch(void);
static void PlayerPartnerHandlePlaySE(void); static void PlayerPartnerHandlePlaySE(void);
static void PlayerPartnerHandlePlayFanfareOrBGM(void); static void PlayerPartnerHandlePlayFanfareOrBGM(void);
static void PlayerPartnerHandleFaintingCry(void); static void PlayerPartnerHandleFaintingCry(void);
@@ -146,7 +146,7 @@ static void (*const sPlayerPartnerBufferCommands[CONTROLLER_CMDS_COUNT])(void) =
[CONTROLLER_CLEARUNKFLAG] = PlayerPartnerHandleClearUnkFlag, [CONTROLLER_CLEARUNKFLAG] = PlayerPartnerHandleClearUnkFlag,
[CONTROLLER_TOGGLEUNKFLAG] = PlayerPartnerHandleToggleUnkFlag, [CONTROLLER_TOGGLEUNKFLAG] = PlayerPartnerHandleToggleUnkFlag,
[CONTROLLER_HITANIMATION] = PlayerPartnerHandleHitAnimation, [CONTROLLER_HITANIMATION] = PlayerPartnerHandleHitAnimation,
[CONTROLLER_42] = PlayerPartnerHandleCmd42, [CONTROLLER_CANTSWITCH] = PlayerPartnerHandleCantSwitch,
[CONTROLLER_PLAYSE] = PlayerPartnerHandlePlaySE, [CONTROLLER_PLAYSE] = PlayerPartnerHandlePlaySE,
[CONTROLLER_PLAYFANFAREORBGM] = PlayerPartnerHandlePlayFanfareOrBGM, [CONTROLLER_PLAYFANFAREORBGM] = PlayerPartnerHandlePlayFanfareOrBGM,
[CONTROLLER_FAINTINGCRY] = PlayerPartnerHandleFaintingCry, [CONTROLLER_FAINTINGCRY] = PlayerPartnerHandleFaintingCry,
@@ -1727,7 +1727,7 @@ static void PlayerPartnerHandleHitAnimation(void)
} }
} }
static void PlayerPartnerHandleCmd42(void) static void PlayerPartnerHandleCantSwitch(void)
{ {
PlayerPartnerBufferExecCompleted(); PlayerPartnerBufferExecCompleted();
} }
+3 -3
View File
@@ -74,7 +74,7 @@ static void RecordedOpponentHandleSetUnkVar(void);
static void RecordedOpponentHandleClearUnkFlag(void); static void RecordedOpponentHandleClearUnkFlag(void);
static void RecordedOpponentHandleToggleUnkFlag(void); static void RecordedOpponentHandleToggleUnkFlag(void);
static void RecordedOpponentHandleHitAnimation(void); static void RecordedOpponentHandleHitAnimation(void);
static void RecordedOpponentHandleCmd42(void); static void RecordedOpponentHandleCantSwitch(void);
static void RecordedOpponentHandlePlaySE(void); static void RecordedOpponentHandlePlaySE(void);
static void RecordedOpponentHandlePlayFanfareOrBGM(void); static void RecordedOpponentHandlePlayFanfareOrBGM(void);
static void RecordedOpponentHandleFaintingCry(void); static void RecordedOpponentHandleFaintingCry(void);
@@ -146,7 +146,7 @@ static void (*const sRecordedOpponentBufferCommands[CONTROLLER_CMDS_COUNT])(void
[CONTROLLER_CLEARUNKFLAG] = RecordedOpponentHandleClearUnkFlag, [CONTROLLER_CLEARUNKFLAG] = RecordedOpponentHandleClearUnkFlag,
[CONTROLLER_TOGGLEUNKFLAG] = RecordedOpponentHandleToggleUnkFlag, [CONTROLLER_TOGGLEUNKFLAG] = RecordedOpponentHandleToggleUnkFlag,
[CONTROLLER_HITANIMATION] = RecordedOpponentHandleHitAnimation, [CONTROLLER_HITANIMATION] = RecordedOpponentHandleHitAnimation,
[CONTROLLER_42] = RecordedOpponentHandleCmd42, [CONTROLLER_CANTSWITCH] = RecordedOpponentHandleCantSwitch,
[CONTROLLER_PLAYSE] = RecordedOpponentHandlePlaySE, [CONTROLLER_PLAYSE] = RecordedOpponentHandlePlaySE,
[CONTROLLER_PLAYFANFAREORBGM] = RecordedOpponentHandlePlayFanfareOrBGM, [CONTROLLER_PLAYFANFAREORBGM] = RecordedOpponentHandlePlayFanfareOrBGM,
[CONTROLLER_FAINTINGCRY] = RecordedOpponentHandleFaintingCry, [CONTROLLER_FAINTINGCRY] = RecordedOpponentHandleFaintingCry,
@@ -1587,7 +1587,7 @@ static void RecordedOpponentHandleHitAnimation(void)
} }
} }
static void RecordedOpponentHandleCmd42(void) static void RecordedOpponentHandleCantSwitch(void)
{ {
RecordedOpponentBufferExecCompleted(); RecordedOpponentBufferExecCompleted();
} }
+3 -3
View File
@@ -70,7 +70,7 @@ static void RecordedPlayerHandleSetUnkVar(void);
static void RecordedPlayerHandleClearUnkFlag(void); static void RecordedPlayerHandleClearUnkFlag(void);
static void RecordedPlayerHandleToggleUnkFlag(void); static void RecordedPlayerHandleToggleUnkFlag(void);
static void RecordedPlayerHandleHitAnimation(void); static void RecordedPlayerHandleHitAnimation(void);
static void RecordedPlayerHandleCmd42(void); static void RecordedPlayerHandleCantSwitch(void);
static void RecordedPlayerHandlePlaySE(void); static void RecordedPlayerHandlePlaySE(void);
static void RecordedPlayerHandlePlayFanfareOrBGM(void); static void RecordedPlayerHandlePlayFanfareOrBGM(void);
static void RecordedPlayerHandleFaintingCry(void); static void RecordedPlayerHandleFaintingCry(void);
@@ -141,7 +141,7 @@ static void (*const sRecordedPlayerBufferCommands[CONTROLLER_CMDS_COUNT])(void)
[CONTROLLER_CLEARUNKFLAG] = RecordedPlayerHandleClearUnkFlag, [CONTROLLER_CLEARUNKFLAG] = RecordedPlayerHandleClearUnkFlag,
[CONTROLLER_TOGGLEUNKFLAG] = RecordedPlayerHandleToggleUnkFlag, [CONTROLLER_TOGGLEUNKFLAG] = RecordedPlayerHandleToggleUnkFlag,
[CONTROLLER_HITANIMATION] = RecordedPlayerHandleHitAnimation, [CONTROLLER_HITANIMATION] = RecordedPlayerHandleHitAnimation,
[CONTROLLER_42] = RecordedPlayerHandleCmd42, [CONTROLLER_CANTSWITCH] = RecordedPlayerHandleCantSwitch,
[CONTROLLER_PLAYSE] = RecordedPlayerHandlePlaySE, [CONTROLLER_PLAYSE] = RecordedPlayerHandlePlaySE,
[CONTROLLER_PLAYFANFAREORBGM] = RecordedPlayerHandlePlayFanfareOrBGM, [CONTROLLER_PLAYFANFAREORBGM] = RecordedPlayerHandlePlayFanfareOrBGM,
[CONTROLLER_FAINTINGCRY] = RecordedPlayerHandleFaintingCry, [CONTROLLER_FAINTINGCRY] = RecordedPlayerHandleFaintingCry,
@@ -1610,7 +1610,7 @@ static void RecordedPlayerHandleHitAnimation(void)
} }
} }
static void RecordedPlayerHandleCmd42(void) static void RecordedPlayerHandleCantSwitch(void)
{ {
RecordedPlayerBufferExecCompleted(); RecordedPlayerBufferExecCompleted();
} }
+3 -3
View File
@@ -67,7 +67,7 @@ static void SafariHandleSetUnkVar(void);
static void SafariHandleClearUnkFlag(void); static void SafariHandleClearUnkFlag(void);
static void SafariHandleToggleUnkFlag(void); static void SafariHandleToggleUnkFlag(void);
static void SafariHandleHitAnimation(void); static void SafariHandleHitAnimation(void);
static void SafariHandleCmd42(void); static void SafariHandleCantSwitch(void);
static void SafariHandlePlaySE(void); static void SafariHandlePlaySE(void);
static void SafariHandlePlayFanfareOrBGM(void); static void SafariHandlePlayFanfareOrBGM(void);
static void SafariHandleFaintingCry(void); static void SafariHandleFaintingCry(void);
@@ -131,7 +131,7 @@ static void (*const sSafariBufferCommands[CONTROLLER_CMDS_COUNT])(void) =
[CONTROLLER_CLEARUNKFLAG] = SafariHandleClearUnkFlag, [CONTROLLER_CLEARUNKFLAG] = SafariHandleClearUnkFlag,
[CONTROLLER_TOGGLEUNKFLAG] = SafariHandleToggleUnkFlag, [CONTROLLER_TOGGLEUNKFLAG] = SafariHandleToggleUnkFlag,
[CONTROLLER_HITANIMATION] = SafariHandleHitAnimation, [CONTROLLER_HITANIMATION] = SafariHandleHitAnimation,
[CONTROLLER_42] = SafariHandleCmd42, [CONTROLLER_CANTSWITCH] = SafariHandleCantSwitch,
[CONTROLLER_PLAYSE] = SafariHandlePlaySE, [CONTROLLER_PLAYSE] = SafariHandlePlaySE,
[CONTROLLER_PLAYFANFAREORBGM] = SafariHandlePlayFanfareOrBGM, [CONTROLLER_PLAYFANFAREORBGM] = SafariHandlePlayFanfareOrBGM,
[CONTROLLER_FAINTINGCRY] = SafariHandleFaintingCry, [CONTROLLER_FAINTINGCRY] = SafariHandleFaintingCry,
@@ -580,7 +580,7 @@ static void SafariHandleHitAnimation(void)
SafariBufferExecCompleted(); SafariBufferExecCompleted();
} }
static void SafariHandleCmd42(void) static void SafariHandleCantSwitch(void)
{ {
SafariBufferExecCompleted(); SafariBufferExecCompleted();
} }
+9 -9
View File
@@ -75,7 +75,7 @@ static void WallyHandleSetUnkVar(void);
static void WallyHandleClearUnkFlag(void); static void WallyHandleClearUnkFlag(void);
static void WallyHandleToggleUnkFlag(void); static void WallyHandleToggleUnkFlag(void);
static void WallyHandleHitAnimation(void); static void WallyHandleHitAnimation(void);
static void WallyHandleCmd42(void); static void WallyHandleCantSwitch(void);
static void WallyHandlePlaySE(void); static void WallyHandlePlaySE(void);
static void WallyHandlePlayFanfareOrBGM(void); static void WallyHandlePlayFanfareOrBGM(void);
static void WallyHandleFaintingCry(void); static void WallyHandleFaintingCry(void);
@@ -144,7 +144,7 @@ static void (*const sWallyBufferCommands[CONTROLLER_CMDS_COUNT])(void) =
[CONTROLLER_CLEARUNKFLAG] = WallyHandleClearUnkFlag, [CONTROLLER_CLEARUNKFLAG] = WallyHandleClearUnkFlag,
[CONTROLLER_TOGGLEUNKFLAG] = WallyHandleToggleUnkFlag, [CONTROLLER_TOGGLEUNKFLAG] = WallyHandleToggleUnkFlag,
[CONTROLLER_HITANIMATION] = WallyHandleHitAnimation, [CONTROLLER_HITANIMATION] = WallyHandleHitAnimation,
[CONTROLLER_42] = WallyHandleCmd42, [CONTROLLER_CANTSWITCH] = WallyHandleCantSwitch,
[CONTROLLER_PLAYSE] = WallyHandlePlaySE, [CONTROLLER_PLAYSE] = WallyHandlePlaySE,
[CONTROLLER_PLAYFANFAREORBGM] = WallyHandlePlayFanfareOrBGM, [CONTROLLER_PLAYFANFAREORBGM] = WallyHandlePlayFanfareOrBGM,
[CONTROLLER_FAINTINGCRY] = WallyHandleFaintingCry, [CONTROLLER_FAINTINGCRY] = WallyHandleFaintingCry,
@@ -190,7 +190,7 @@ static void WallyHandleActions(void)
switch (gBattleStruct->wallyBattleState) switch (gBattleStruct->wallyBattleState)
{ {
case 0: case 0:
gBattleStruct->wallyWaitFrames = 64; gBattleStruct->wallyWaitFrames = B_WAIT_TIME_LONG;
gBattleStruct->wallyBattleState++; gBattleStruct->wallyBattleState++;
case 1: case 1:
if (--gBattleStruct->wallyWaitFrames == 0) if (--gBattleStruct->wallyWaitFrames == 0)
@@ -200,7 +200,7 @@ static void WallyHandleActions(void)
WallyBufferExecCompleted(); WallyBufferExecCompleted();
gBattleStruct->wallyBattleState++; gBattleStruct->wallyBattleState++;
gBattleStruct->wallyMovesState = 0; gBattleStruct->wallyMovesState = 0;
gBattleStruct->wallyWaitFrames = 64; gBattleStruct->wallyWaitFrames = B_WAIT_TIME_LONG;
} }
break; break;
case 2: case 2:
@@ -211,17 +211,17 @@ static void WallyHandleActions(void)
WallyBufferExecCompleted(); WallyBufferExecCompleted();
gBattleStruct->wallyBattleState++; gBattleStruct->wallyBattleState++;
gBattleStruct->wallyMovesState = 0; gBattleStruct->wallyMovesState = 0;
gBattleStruct->wallyWaitFrames = 64; gBattleStruct->wallyWaitFrames = B_WAIT_TIME_LONG;
} }
break; break;
case 3: case 3:
if (--gBattleStruct->wallyWaitFrames == 0) if (--gBattleStruct->wallyWaitFrames == 0)
{ {
BtlController_EmitTwoReturnValues(1, 9, 0); BtlController_EmitTwoReturnValues(1, B_ACTION_WALLY_THROW, 0);
WallyBufferExecCompleted(); WallyBufferExecCompleted();
gBattleStruct->wallyBattleState++; gBattleStruct->wallyBattleState++;
gBattleStruct->wallyMovesState = 0; gBattleStruct->wallyMovesState = 0;
gBattleStruct->wallyWaitFrames = 64; gBattleStruct->wallyWaitFrames = B_WAIT_TIME_LONG;
} }
break; break;
case 4: case 4:
@@ -230,7 +230,7 @@ static void WallyHandleActions(void)
PlaySE(SE_SELECT); PlaySE(SE_SELECT);
ActionSelectionDestroyCursorAt(0); ActionSelectionDestroyCursorAt(0);
ActionSelectionCreateCursorAt(1, 0); ActionSelectionCreateCursorAt(1, 0);
gBattleStruct->wallyWaitFrames = 64; gBattleStruct->wallyWaitFrames = B_WAIT_TIME_LONG;
gBattleStruct->wallyBattleState++; gBattleStruct->wallyBattleState++;
} }
break; break;
@@ -1385,7 +1385,7 @@ static void WallyHandleHitAnimation(void)
} }
} }
static void WallyHandleCmd42(void) static void WallyHandleCantSwitch(void)
{ {
WallyBufferExecCompleted(); WallyBufferExecCompleted();
} }
+5 -5
View File
@@ -1385,12 +1385,12 @@ void BtlController_EmitHitAnimation(u8 bufferId)
PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, 4); PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, 4);
} }
void BtlController_EmitCmd42(u8 bufferId) void BtlController_EmitCantSwitch(u8 bufferId)
{ {
sBattleBuffersTransferData[0] = CONTROLLER_42; sBattleBuffersTransferData[0] = CONTROLLER_CANTSWITCH;
sBattleBuffersTransferData[1] = CONTROLLER_42; sBattleBuffersTransferData[1] = CONTROLLER_CANTSWITCH;
sBattleBuffersTransferData[2] = CONTROLLER_42; sBattleBuffersTransferData[2] = CONTROLLER_CANTSWITCH;
sBattleBuffersTransferData[3] = CONTROLLER_42; sBattleBuffersTransferData[3] = CONTROLLER_CANTSWITCH;
PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, 4); PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, 4);
} }
+5 -5
View File
@@ -3959,7 +3959,7 @@ u8 IsRunningFromBattleImpossible(void)
{ {
gBattleScripting.battler = i; gBattleScripting.battler = i;
gLastUsedAbility = gBattleMons[i].ability; gLastUsedAbility = gBattleMons[i].ability;
gBattleCommunication[MULTISTRING_CHOOSER] = 2; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_PREVENTS_ESCAPE;
return 2; return 2;
} }
if (side != GetBattlerSide(i) if (side != GetBattlerSide(i)
@@ -3969,7 +3969,7 @@ u8 IsRunningFromBattleImpossible(void)
{ {
gBattleScripting.battler = i; gBattleScripting.battler = i;
gLastUsedAbility = gBattleMons[i].ability; gLastUsedAbility = gBattleMons[i].ability;
gBattleCommunication[MULTISTRING_CHOOSER] = 2; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_PREVENTS_ESCAPE;
return 2; return 2;
} }
} }
@@ -3978,18 +3978,18 @@ u8 IsRunningFromBattleImpossible(void)
{ {
gBattleScripting.battler = i - 1; gBattleScripting.battler = i - 1;
gLastUsedAbility = gBattleMons[i - 1].ability; gLastUsedAbility = gBattleMons[i - 1].ability;
gBattleCommunication[MULTISTRING_CHOOSER] = 2; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_PREVENTS_ESCAPE;
return 2; return 2;
} }
if ((gBattleMons[gActiveBattler].status2 & (STATUS2_ESCAPE_PREVENTION | STATUS2_WRAPPED)) if ((gBattleMons[gActiveBattler].status2 & (STATUS2_ESCAPE_PREVENTION | STATUS2_WRAPPED))
|| (gStatuses3[gActiveBattler] & STATUS3_ROOTED)) || (gStatuses3[gActiveBattler] & STATUS3_ROOTED))
{ {
gBattleCommunication[MULTISTRING_CHOOSER] = 0; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_CANT_ESCAPE;
return 1; return 1;
} }
if (gBattleTypeFlags & BATTLE_TYPE_FIRST_BATTLE) if (gBattleTypeFlags & BATTLE_TYPE_FIRST_BATTLE)
{ {
gBattleCommunication[MULTISTRING_CHOOSER] = 1; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_DONT_LEAVE_BIRCH;
return 1; return 1;
} }
return 0; return 0;
+174 -93
View File
@@ -305,11 +305,11 @@ static const u8 sText_StatSharply[] = _("sharply ");
const u8 gText_StatRose[] = _("rose!"); const u8 gText_StatRose[] = _("rose!");
static const u8 sText_StatHarshly[] = _("harshly "); static const u8 sText_StatHarshly[] = _("harshly ");
static const u8 sText_StatFell[] = _("fell!"); static const u8 sText_StatFell[] = _("fell!");
static const u8 sText_PkmnsStatChanged[] = _("{B_ATK_NAME_WITH_PREFIX}'s {B_BUFF1}\n{B_BUFF2}"); static const u8 sText_AttackersStatRose[] = _("{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_DefendersStatRose[] = _("{B_DEF_NAME_WITH_PREFIX}'s {B_BUFF1}\n{B_BUFF2}");
static const u8 sText_UsingXTheYOfZN[] = _("Using {B_LAST_ITEM}, the {B_BUFF1}\nof {B_SCR_ACTIVE_NAME_WITH_PREFIX} {B_BUFF2}"); static const u8 sText_UsingItemTheStatOfPkmnRose[] = _("Using {B_LAST_ITEM}, the {B_BUFF1}\nof {B_SCR_ACTIVE_NAME_WITH_PREFIX} {B_BUFF2}");
static const u8 sText_PkmnsStatChanged3[] = _("{B_ATK_NAME_WITH_PREFIX}'s {B_BUFF1}\n{B_BUFF2}"); static const u8 sText_AttackersStatFell[] = _("{B_ATK_NAME_WITH_PREFIX}'s {B_BUFF1}\n{B_BUFF2}");
static const u8 sText_PkmnsStatChanged4[] = _("{B_DEF_NAME_WITH_PREFIX}'s {B_BUFF1}\n{B_BUFF2}"); static const u8 sText_DefendersStatFell[] = _("{B_DEF_NAME_WITH_PREFIX}'s {B_BUFF1}\n{B_BUFF2}");
static const u8 sText_StatsWontIncrease2[] = _("{B_ATK_NAME_WITH_PREFIX}'s stats won't\ngo any higher!"); static const u8 sText_StatsWontIncrease2[] = _("{B_ATK_NAME_WITH_PREFIX}'s stats won't\ngo any higher!");
static const u8 sText_StatsWontDecrease2[] = _("{B_DEF_NAME_WITH_PREFIX}'s stats won't\ngo any lower!"); static const u8 sText_StatsWontDecrease2[] = _("{B_DEF_NAME_WITH_PREFIX}'s stats won't\ngo any lower!");
static const u8 sText_CriticalHit[] = _("A critical hit!"); static const u8 sText_CriticalHit[] = _("A critical hit!");
@@ -721,10 +721,10 @@ const u8 * const gBattleStringsTable[BATTLESTRINGS_COUNT] =
[STRINGID_STATROSE - 12] = gText_StatRose, [STRINGID_STATROSE - 12] = gText_StatRose,
[STRINGID_STATHARSHLY - 12] = sText_StatHarshly, [STRINGID_STATHARSHLY - 12] = sText_StatHarshly,
[STRINGID_STATFELL - 12] = sText_StatFell, [STRINGID_STATFELL - 12] = sText_StatFell,
[STRINGID_PKMNSSTATCHANGED - 12] = sText_PkmnsStatChanged, [STRINGID_ATTACKERSSTATROSE - 12] = sText_AttackersStatRose,
[STRINGID_PKMNSSTATCHANGED2 - 12] = gText_PkmnsStatChanged2, [STRINGID_DEFENDERSSTATROSE - 12] = gText_DefendersStatRose,
[STRINGID_PKMNSSTATCHANGED3 - 12] = sText_PkmnsStatChanged3, [STRINGID_ATTACKERSSTATFELL - 12] = sText_AttackersStatFell,
[STRINGID_PKMNSSTATCHANGED4 - 12] = sText_PkmnsStatChanged4, [STRINGID_DEFENDERSSTATFELL - 12] = sText_DefendersStatFell,
[STRINGID_CRITICALHIT - 12] = sText_CriticalHit, [STRINGID_CRITICALHIT - 12] = sText_CriticalHit,
[STRINGID_ONEHITKO - 12] = sText_OneHitKO, [STRINGID_ONEHITKO - 12] = sText_OneHitKO,
[STRINGID_123POOF - 12] = sText_123Poof, [STRINGID_123POOF - 12] = sText_123Poof,
@@ -833,7 +833,7 @@ const u8 * const gBattleStringsTable[BATTLESTRINGS_COUNT] =
[STRINGID_SOOTHINGAROMA - 12] = sText_SoothingAroma, [STRINGID_SOOTHINGAROMA - 12] = sText_SoothingAroma,
[STRINGID_ITEMSCANTBEUSEDNOW - 12] = sText_ItemsCantBeUsedNow, [STRINGID_ITEMSCANTBEUSEDNOW - 12] = sText_ItemsCantBeUsedNow,
[STRINGID_FORXCOMMAYZ - 12] = sText_ForXCommaYZ, [STRINGID_FORXCOMMAYZ - 12] = sText_ForXCommaYZ,
[STRINGID_USINGXTHEYOFZN - 12] = sText_UsingXTheYOfZN, [STRINGID_USINGITEMSTATOFPKMNROSE - 12] = sText_UsingItemTheStatOfPkmnRose,
[STRINGID_PKMNUSEDXTOGETPUMPED - 12] = sText_PkmnUsedXToGetPumped, [STRINGID_PKMNUSEDXTOGETPUMPED - 12] = sText_PkmnUsedXToGetPumped,
[STRINGID_PKMNSXMADEYUSELESS - 12] = sText_PkmnsXMadeYUseless, [STRINGID_PKMNSXMADEYUSELESS - 12] = sText_PkmnsXMadeYUseless,
[STRINGID_PKMNTRAPPEDBYSANDTOMB - 12] = sText_PkmnTrappedBySandTomb, [STRINGID_PKMNTRAPPEDBYSANDTOMB - 12] = sText_PkmnTrappedBySandTomb,
@@ -893,112 +893,149 @@ const u8 * const gBattleStringsTable[BATTLESTRINGS_COUNT] =
const u16 gMissStringIds[] = const u16 gMissStringIds[] =
{ {
STRINGID_ATTACKMISSED, STRINGID_PKMNPROTECTEDITSELF, [B_MSG_MISSED] = STRINGID_ATTACKMISSED,
STRINGID_PKMNAVOIDEDATTACK, STRINGID_AVOIDEDDAMAGE, [B_MSG_PROTECTED] = STRINGID_PKMNPROTECTEDITSELF,
STRINGID_PKMNMAKESGROUNDMISS [B_MSG_AVOIDED_ATK] = STRINGID_PKMNAVOIDEDATTACK,
[B_MSG_AVOIDED_DMG] = STRINGID_AVOIDEDDAMAGE,
[B_MSG_GROUND_MISS] = STRINGID_PKMNMAKESGROUNDMISS
}; };
const u16 gNoEscapeStringIds[] = const u16 gNoEscapeStringIds[] =
{ {
STRINGID_CANTESCAPE, STRINGID_DONTLEAVEBIRCH, STRINGID_PREVENTSESCAPE, [B_MSG_CANT_ESCAPE] = STRINGID_CANTESCAPE,
STRINGID_CANTESCAPE2, STRINGID_ATTACKERCANTESCAPE [B_MSG_DONT_LEAVE_BIRCH] = STRINGID_DONTLEAVEBIRCH,
[B_MSG_PREVENTS_ESCAPE] = STRINGID_PREVENTSESCAPE,
[B_MSG_CANT_ESCAPE_2] = STRINGID_CANTESCAPE2,
[B_MSG_ATTACKER_CANT_ESCAPE] = STRINGID_ATTACKERCANTESCAPE
}; };
const u16 gMoveWeatherChangeStringIds[] = const u16 gMoveWeatherChangeStringIds[] =
{ {
STRINGID_STARTEDTORAIN, STRINGID_DOWNPOURSTARTED, STRINGID_BUTITFAILED, [B_MSG_STARTED_RAIN] = STRINGID_STARTEDTORAIN,
STRINGID_SANDSTORMBREWED, STRINGID_SUNLIGHTGOTBRIGHT, STRINGID_STARTEDHAIL [B_MSG_STARTED_DOWNPOUR] = STRINGID_DOWNPOURSTARTED, // Unused
[B_MSG_WEATHER_FAILED] = STRINGID_BUTITFAILED,
[B_MSG_STARTED_SANDSTORM] = STRINGID_SANDSTORMBREWED,
[B_MSG_STARTED_SUNLIGHT] = STRINGID_SUNLIGHTGOTBRIGHT,
[B_MSG_STARTED_HAIL] = STRINGID_STARTEDHAIL,
}; };
const u16 gSandStormHailContinuesStringIds[] = const u16 gSandStormHailContinuesStringIds[] =
{ {
STRINGID_SANDSTORMRAGES, STRINGID_HAILCONTINUES [B_MSG_SANDSTORM] = STRINGID_SANDSTORMRAGES,
[B_MSG_HAIL] = STRINGID_HAILCONTINUES
}; };
const u16 gSandStormHailDmgStringIds[] = const u16 gSandStormHailDmgStringIds[] =
{ {
STRINGID_PKMNBUFFETEDBYSANDSTORM, STRINGID_PKMNPELTEDBYHAIL [B_MSG_SANDSTORM] = STRINGID_PKMNBUFFETEDBYSANDSTORM,
[B_MSG_HAIL] = STRINGID_PKMNPELTEDBYHAIL
}; };
const u16 gSandStormHailEndStringIds[] = const u16 gSandStormHailEndStringIds[] =
{ {
STRINGID_SANDSTORMSUBSIDED, STRINGID_HAILSTOPPED [B_MSG_SANDSTORM] = STRINGID_SANDSTORMSUBSIDED,
[B_MSG_HAIL] = STRINGID_HAILSTOPPED
}; };
const u16 gRainContinuesStringIds[] = const u16 gRainContinuesStringIds[] =
{ {
STRINGID_RAINCONTINUES, STRINGID_DOWNPOURCONTINUES, STRINGID_RAINSTOPPED [B_MSG_RAIN_CONTINUES] = STRINGID_RAINCONTINUES,
[B_MSG_DOWNPOUR_CONTINUES] = STRINGID_DOWNPOURCONTINUES,
[B_MSG_RAIN_STOPPED] = STRINGID_RAINSTOPPED
}; };
const u16 gProtectLikeUsedStringIds[] = const u16 gProtectLikeUsedStringIds[] =
{ {
STRINGID_PKMNPROTECTEDITSELF2, STRINGID_PKMNBRACEDITSELF, STRINGID_BUTITFAILED [B_MSG_PROTECTED_ITSELF] = STRINGID_PKMNPROTECTEDITSELF2,
[B_MSG_BRACED_ITSELF] = STRINGID_PKMNBRACEDITSELF,
[B_MSG_PROTECT_FAILED] = STRINGID_BUTITFAILED,
}; };
const u16 gReflectLightScreenSafeguardStringIds[] = const u16 gReflectLightScreenSafeguardStringIds[] =
{ {
STRINGID_BUTITFAILED, STRINGID_PKMNRAISEDDEF, STRINGID_PKMNRAISEDDEFALITTLE, [B_MSG_SIDE_STATUS_FAILED] = STRINGID_BUTITFAILED,
STRINGID_PKMNRAISEDSPDEF, STRINGID_PKMNRAISEDSPDEFALITTLE, STRINGID_PKMNCOVEREDBYVEIL [B_MSG_SET_REFLECT_SINGLE] = STRINGID_PKMNRAISEDDEF,
[B_MSG_SET_REFLECT_DOUBLE] = STRINGID_PKMNRAISEDDEFALITTLE,
[B_MSG_SET_LIGHTSCREEN_SINGLE] = STRINGID_PKMNRAISEDSPDEF,
[B_MSG_SET_LIGHTSCREEN_DOUBLE] = STRINGID_PKMNRAISEDSPDEFALITTLE,
[B_MSG_SET_SAFEGUARD] = STRINGID_PKMNCOVEREDBYVEIL,
}; };
const u16 gLeechSeedStringIds[] = const u16 gLeechSeedStringIds[] =
{ {
STRINGID_PKMNSEEDED, STRINGID_PKMNEVADEDATTACK, [B_MSG_LEECH_SEED_SET] = STRINGID_PKMNSEEDED,
STRINGID_ITDOESNTAFFECT, STRINGID_PKMNSAPPEDBYLEECHSEED, STRINGID_ITSUCKEDLIQUIDOOZE, [B_MSG_LEECH_SEED_MISS] = STRINGID_PKMNEVADEDATTACK,
[B_MSG_LEECH_SEED_FAIL] = STRINGID_ITDOESNTAFFECT,
[B_MSG_LEECH_SEED_DRAIN] = STRINGID_PKMNSAPPEDBYLEECHSEED,
[B_MSG_LEECH_SEED_OOZE] = STRINGID_ITSUCKEDLIQUIDOOZE,
}; };
const u16 gRestUsedStringIds[] = const u16 gRestUsedStringIds[] =
{ {
STRINGID_PKMNWENTTOSLEEP, STRINGID_PKMNSLEPTHEALTHY [B_MSG_REST] = STRINGID_PKMNWENTTOSLEEP,
[B_MSG_REST_STATUSED] = STRINGID_PKMNSLEPTHEALTHY
}; };
const u16 gUproarOverTurnStringIds[] = const u16 gUproarOverTurnStringIds[] =
{ {
STRINGID_PKMNMAKINGUPROAR, STRINGID_PKMNCALMEDDOWN [B_MSG_UPROAR_CONTINUES] = STRINGID_PKMNMAKINGUPROAR,
[B_MSG_UPROAR_ENDS] = STRINGID_PKMNCALMEDDOWN
}; };
const u16 gStockpileUsedStringIds[] = const u16 gStockpileUsedStringIds[] =
{ {
STRINGID_PKMNSTOCKPILED, STRINGID_PKMNCANTSTOCKPILE, [B_MSG_STOCKPILED] = STRINGID_PKMNSTOCKPILED,
[B_MSG_CANT_STOCKPILE] = STRINGID_PKMNCANTSTOCKPILE,
}; };
const u16 gWokeUpStringIds[] = const u16 gWokeUpStringIds[] =
{ {
STRINGID_PKMNWOKEUP, STRINGID_PKMNWOKEUPINUPROAR [B_MSG_WOKE_UP] = STRINGID_PKMNWOKEUP,
[B_MSG_WOKE_UP_UPROAR] = STRINGID_PKMNWOKEUPINUPROAR
}; };
const u16 gSwallowFailStringIds[] = const u16 gSwallowFailStringIds[] =
{ {
STRINGID_FAILEDTOSWALLOW, STRINGID_PKMNHPFULL [B_MSG_SWALLOW_FAILED] = STRINGID_FAILEDTOSWALLOW,
[B_MSG_SWALLOW_FULL_HP] = STRINGID_PKMNHPFULL
}; };
const u16 gUproarAwakeStringIds[] = const u16 gUproarAwakeStringIds[] =
{ {
STRINGID_PKMNCANTSLEEPINUPROAR2, STRINGID_UPROARKEPTPKMNAWAKE, STRINGID_PKMNSTAYEDAWAKEUSING [B_MSG_CANT_SLEEP_UPROAR] = STRINGID_PKMNCANTSLEEPINUPROAR2,
[B_MSG_UPROAR_KEPT_AWAKE] = STRINGID_UPROARKEPTPKMNAWAKE,
[B_MSG_STAYED_AWAKE_USING] = STRINGID_PKMNSTAYEDAWAKEUSING,
}; };
const u16 gStatUpStringIds[] = const u16 gStatUpStringIds[] =
{ {
STRINGID_PKMNSSTATCHANGED, STRINGID_PKMNSSTATCHANGED2, STRINGID_STATSWONTINCREASE, [B_MSG_ATTACKER_STAT_ROSE] = STRINGID_ATTACKERSSTATROSE,
STRINGID_EMPTYSTRING3, STRINGID_USINGXTHEYOFZN, STRINGID_PKMNUSEDXTOGETPUMPED [B_MSG_DEFENDER_STAT_ROSE] = STRINGID_DEFENDERSSTATROSE,
[B_MSG_STAT_WONT_INCREASE] = STRINGID_STATSWONTINCREASE,
[B_MSG_STAT_ROSE_EMPTY] = STRINGID_EMPTYSTRING3,
[B_MSG_STAT_ROSE_ITEM] = STRINGID_USINGITEMSTATOFPKMNROSE,
[B_MSG_USED_DIRE_HIT] = STRINGID_PKMNUSEDXTOGETPUMPED,
}; };
const u16 gStatDownStringIds[] = const u16 gStatDownStringIds[] =
{ {
STRINGID_PKMNSSTATCHANGED3, STRINGID_PKMNSSTATCHANGED4, STRINGID_STATSWONTDECREASE, STRINGID_EMPTYSTRING3 [B_MSG_ATTACKER_STAT_FELL] = STRINGID_ATTACKERSSTATFELL,
[B_MSG_DEFENDER_STAT_FELL] = STRINGID_DEFENDERSSTATFELL,
[B_MSG_STAT_WONT_DECREASE] = STRINGID_STATSWONTDECREASE,
[B_MSG_STAT_FELL_EMPTY] = STRINGID_EMPTYSTRING3,
}; };
// Index read from sTWOTURN_STRINGID // Index read from sTWOTURN_STRINGID
const u16 gFirstTurnOfTwoStringIds[] = const u16 gFirstTurnOfTwoStringIds[] =
{ {
STRINGID_PKMNWHIPPEDWHIRLWIND, // MOVE_RAZOR_WIND [B_MSG_TURN1_RAZOR_WIND] = STRINGID_PKMNWHIPPEDWHIRLWIND,
STRINGID_PKMNTOOKSUNLIGHT, // MOVE_SOLAR_BEAM [B_MSG_TURN1_SOLAR_BEAM] = STRINGID_PKMNTOOKSUNLIGHT,
STRINGID_PKMNLOWEREDHEAD, // MOVE_SKULL_BASH [B_MSG_TURN1_SKULL_BASH] = STRINGID_PKMNLOWEREDHEAD,
STRINGID_PKMNISGLOWING, // MOVE_SKY_ATTACK [B_MSG_TURN1_SKY_ATTACK] = STRINGID_PKMNISGLOWING,
STRINGID_PKMNFLEWHIGH, // MOVE_FLY [B_MSG_TURN1_FLY] = STRINGID_PKMNFLEWHIGH,
STRINGID_PKMNDUGHOLE, // MOVE_DIG [B_MSG_TURN1_DIG] = STRINGID_PKMNDUGHOLE,
STRINGID_PKMNHIDUNDERWATER, // MOVE_DIVE [B_MSG_TURN1_DIVE] = STRINGID_PKMNHIDUNDERWATER,
STRINGID_PKMNSPRANGUP // MOVE_BOUNCE [B_MSG_TURN1_BOUNCE] = STRINGID_PKMNSPRANGUP,
}; };
// Index copied from move's index in gTrappingMoves // Index copied from move's index in gTrappingMoves
@@ -1014,89 +1051,109 @@ const u16 gWrappedStringIds[] =
const u16 gMistUsedStringIds[] = const u16 gMistUsedStringIds[] =
{ {
STRINGID_PKMNSHROUDEDINMIST, STRINGID_BUTITFAILED [B_MSG_SET_MIST] = STRINGID_PKMNSHROUDEDINMIST,
[B_MSG_MIST_FAILED] = STRINGID_BUTITFAILED
}; };
const u16 gFocusEnergyUsedStringIds[] = const u16 gFocusEnergyUsedStringIds[] =
{ {
STRINGID_PKMNGETTINGPUMPED, STRINGID_BUTITFAILED [B_MSG_GETTING_PUMPED] = STRINGID_PKMNGETTINGPUMPED,
[B_MSG_FOCUS_ENERGY_FAILED] = STRINGID_BUTITFAILED
}; };
const u16 gTransformUsedStringIds[] = const u16 gTransformUsedStringIds[] =
{ {
STRINGID_PKMNTRANSFORMEDINTO, STRINGID_BUTITFAILED [B_MSG_TRANSFORMED] = STRINGID_PKMNTRANSFORMEDINTO,
[B_MSG_TRANSFORM_FAILED] = STRINGID_BUTITFAILED
}; };
const u16 gSubsituteUsedStringIds[] = const u16 gSubsituteUsedStringIds[] =
{ {
STRINGID_PKMNMADESUBSTITUTE, STRINGID_TOOWEAKFORSUBSTITUTE [B_MSG_SET_SUBSTITUTE] = STRINGID_PKMNMADESUBSTITUTE,
[B_MSG_SUBSTITUTE_FAILED] = STRINGID_TOOWEAKFORSUBSTITUTE
}; };
const u16 gGotPoisonedStringIds[] = const u16 gGotPoisonedStringIds[] =
{ {
STRINGID_PKMNWASPOISONED, STRINGID_PKMNPOISONEDBY [B_MSG_STATUSED] = STRINGID_PKMNWASPOISONED,
[B_MSG_STATUSED_BY_ABILITY] = STRINGID_PKMNPOISONEDBY
}; };
const u16 gGotParalyzedStringIds[] = const u16 gGotParalyzedStringIds[] =
{ {
STRINGID_PKMNWASPARALYZED, STRINGID_PKMNWASPARALYZEDBY [B_MSG_STATUSED] = STRINGID_PKMNWASPARALYZED,
[B_MSG_STATUSED_BY_ABILITY] = STRINGID_PKMNWASPARALYZEDBY
}; };
const u16 gFellAsleepStringIds[] = const u16 gFellAsleepStringIds[] =
{ {
STRINGID_PKMNFELLASLEEP, STRINGID_PKMNMADESLEEP, [B_MSG_STATUSED] = STRINGID_PKMNFELLASLEEP,
[B_MSG_STATUSED_BY_ABILITY] = STRINGID_PKMNMADESLEEP,
}; };
const u16 gGotBurnedStringIds[] = const u16 gGotBurnedStringIds[] =
{ {
STRINGID_PKMNWASBURNED, STRINGID_PKMNBURNEDBY [B_MSG_STATUSED] = STRINGID_PKMNWASBURNED,
[B_MSG_STATUSED_BY_ABILITY] = STRINGID_PKMNBURNEDBY
}; };
const u16 gGotFrozenStringIds[] = const u16 gGotFrozenStringIds[] =
{ {
STRINGID_PKMNWASFROZEN, STRINGID_PKMNFROZENBY [B_MSG_STATUSED] = STRINGID_PKMNWASFROZEN,
[B_MSG_STATUSED_BY_ABILITY] = STRINGID_PKMNFROZENBY
}; };
const u16 gGotDefrostedStringIds[] = const u16 gGotDefrostedStringIds[] =
{ {
STRINGID_PKMNWASDEFROSTED2, STRINGID_PKMNWASDEFROSTEDBY [B_MSG_DEFROSTED] = STRINGID_PKMNWASDEFROSTED2,
[B_MSG_DEFROSTED_BY_MOVE] = STRINGID_PKMNWASDEFROSTEDBY
}; };
const u16 gKOFailedStringIds[] = const u16 gKOFailedStringIds[] =
{ {
STRINGID_ATTACKMISSED, STRINGID_PKMNUNAFFECTED [B_MSG_KO_MISS] = STRINGID_ATTACKMISSED,
[B_MSG_KO_UNAFFECTED] = STRINGID_PKMNUNAFFECTED
}; };
const u16 gAttractUsedStringIds[] = const u16 gAttractUsedStringIds[] =
{ {
STRINGID_PKMNFELLINLOVE, STRINGID_PKMNSXINFATUATEDY [B_MSG_STATUSED] = STRINGID_PKMNFELLINLOVE,
[B_MSG_STATUSED_BY_ABILITY] = STRINGID_PKMNSXINFATUATEDY
}; };
const u16 gLeechSeedDrainStringIds[] = const u16 gAbsorbDrainStringIds[] =
{ {
STRINGID_PKMNENERGYDRAINED, STRINGID_ITSUCKEDLIQUIDOOZE [B_MSG_ABSORB] = STRINGID_PKMNENERGYDRAINED,
[B_MSG_ABSORB_OOZE] = STRINGID_ITSUCKEDLIQUIDOOZE
}; };
const u16 gSportsUsedStringIds[] = const u16 gSportsUsedStringIds[] =
{ {
STRINGID_ELECTRICITYWEAKENED, STRINGID_FIREWEAKENED [B_MSG_WEAKEN_ELECTRIC] = STRINGID_ELECTRICITYWEAKENED,
[B_MSG_WEAKEN_FIRE] = STRINGID_FIREWEAKENED
}; };
const u16 gPartyStatusHealStringIds[] = const u16 gPartyStatusHealStringIds[] =
{ {
STRINGID_BELLCHIMED, STRINGID_BELLCHIMED, STRINGID_BELLCHIMED, STRINGID_BELLCHIMED, [B_MSG_BELL] = STRINGID_BELLCHIMED,
// interesting how there are four instances of the same string [B_MSG_BELL_SOUNDPROOF_ATTACKER] = STRINGID_BELLCHIMED,
STRINGID_SOOTHINGAROMA [B_MSG_BELL_SOUNDPROOF_PARTNER] = STRINGID_BELLCHIMED,
[B_MSG_BELL_BOTH_SOUNDPROOF] = STRINGID_BELLCHIMED,
[B_MSG_SOOTHING_AROMA] = STRINGID_SOOTHINGAROMA
}; };
const u16 gFutureMoveUsedStringIds[] = const u16 gFutureMoveUsedStringIds[] =
{ {
STRINGID_PKMNFORESAWATTACK, STRINGID_PKMNCHOSEXASDESTINY [B_MSG_FUTURE_SIGHT] = STRINGID_PKMNFORESAWATTACK,
[B_MSG_DOOM_DESIRE] = STRINGID_PKMNCHOSEXASDESTINY
}; };
const u16 gBallEscapeStringIds[] = const u16 gBallEscapeStringIds[] =
{ {
STRINGID_PKMNBROKEFREE, STRINGID_ITAPPEAREDCAUGHT, STRINGID_AARGHALMOSTHADIT, STRINGID_SHOOTSOCLOSE [BALL_NO_SHAKES] = STRINGID_PKMNBROKEFREE,
[BALL_1_SHAKE] = STRINGID_ITAPPEAREDCAUGHT,
[BALL_2_SHAKES] = STRINGID_AARGHALMOSTHADIT,
[BALL_3_SHAKES_FAIL] = STRINGID_SHOOTSOCLOSE
}; };
// Overworld weathers that don't have an associated battle weather default to "It is raining." // Overworld weathers that don't have an associated battle weather default to "It is raining."
@@ -1122,59 +1179,82 @@ const u16 gWeatherStartsStringIds[] =
const u16 gInobedientStringIds[] = const u16 gInobedientStringIds[] =
{ {
STRINGID_PKMNLOAFING, STRINGID_PKMNWONTOBEY, STRINGID_PKMNTURNEDAWAY, [B_MSG_LOAFING] = STRINGID_PKMNLOAFING,
STRINGID_PKMNPRETENDNOTNOTICE, STRINGID_PKMNINCAPABLEOFPOWER [B_MSG_WONT_OBEY] = STRINGID_PKMNWONTOBEY,
[B_MSG_TURNED_AWAY] = STRINGID_PKMNTURNEDAWAY,
[B_MSG_PRETEND_NOT_NOTICE] = STRINGID_PKMNPRETENDNOTNOTICE,
[B_MSG_INCAPABLE_OF_POWER] = STRINGID_PKMNINCAPABLEOFPOWER
}; };
const u16 gSafariGetNearStringIds[] = const u16 gSafariGetNearStringIds[] =
{ {
STRINGID_CREPTCLOSER, STRINGID_CANTGETCLOSER [B_MSG_CREPT_CLOSER] = STRINGID_CREPTCLOSER,
[B_MSG_CANT_GET_CLOSER] = STRINGID_CANTGETCLOSER
}; };
const u16 gSafariPokeblockResultStringIds[] = const u16 gSafariPokeblockResultStringIds[] =
{ {
STRINGID_PKMNCURIOUSABOUTX, STRINGID_PKMNENTHRALLEDBYX, STRINGID_PKMNIGNOREDX [B_MSG_MON_CURIOUS] = STRINGID_PKMNCURIOUSABOUTX,
[B_MSG_MON_ENTHRALLED] = STRINGID_PKMNENTHRALLEDBYX,
[B_MSG_MON_IGNORED] = STRINGID_PKMNIGNOREDX
}; };
const u16 gTrainerItemCuredStatusStringIds[] = const u16 gTrainerItemCuredStatusStringIds[] =
{ {
STRINGID_PKMNSITEMSNAPPEDOUT, STRINGID_PKMNSITEMCUREDPARALYSIS, STRINGID_PKMNSITEMDEFROSTEDIT, [AI_HEAL_CONFUSION] = STRINGID_PKMNSITEMSNAPPEDOUT,
STRINGID_PKMNSITEMHEALEDBURN, STRINGID_PKMNSITEMCUREDPOISON, STRINGID_PKMNSITEMWOKEIT [AI_HEAL_PARALYSIS] = STRINGID_PKMNSITEMCUREDPARALYSIS,
[AI_HEAL_FREEZE] = STRINGID_PKMNSITEMDEFROSTEDIT,
[AI_HEAL_BURN] = STRINGID_PKMNSITEMHEALEDBURN,
[AI_HEAL_POISON] = STRINGID_PKMNSITEMCUREDPOISON,
[AI_HEAL_SLEEP] = STRINGID_PKMNSITEMWOKEIT
}; };
const u16 gBerryEffectStringIds[] = const u16 gBerryEffectStringIds[] =
{ {
STRINGID_PKMNSITEMCUREDPROBLEM, STRINGID_PKMNSITEMNORMALIZEDSTATUS [B_MSG_CURED_PROBLEM] = STRINGID_PKMNSITEMCUREDPROBLEM,
[B_MSG_NORMALIZED_STATUS] = STRINGID_PKMNSITEMNORMALIZEDSTATUS
}; };
const u16 gBRNPreventionStringIds[] = const u16 gBRNPreventionStringIds[] =
{ {
STRINGID_PKMNSXPREVENTSBURNS, STRINGID_PKMNSXPREVENTSYSZ, STRINGID_PKMNSXHADNOEFFECTONY [B_MSG_ABILITY_PREVENTS_MOVE_STATUS] = STRINGID_PKMNSXPREVENTSBURNS,
[B_MSG_ABILITY_PREVENTS_ABILITY_STATUS] = STRINGID_PKMNSXPREVENTSYSZ,
[B_MSG_STATUS_HAD_NO_EFFECT] = STRINGID_PKMNSXHADNOEFFECTONY
}; };
const u16 gPRLZPreventionStringIds[] = const u16 gPRLZPreventionStringIds[] =
{ {
STRINGID_PKMNPREVENTSPARALYSISWITH, STRINGID_PKMNSXPREVENTSYSZ, STRINGID_PKMNSXHADNOEFFECTONY [B_MSG_ABILITY_PREVENTS_MOVE_STATUS] = STRINGID_PKMNPREVENTSPARALYSISWITH,
[B_MSG_ABILITY_PREVENTS_ABILITY_STATUS] = STRINGID_PKMNSXPREVENTSYSZ,
[B_MSG_STATUS_HAD_NO_EFFECT] = STRINGID_PKMNSXHADNOEFFECTONY
}; };
const u16 gPSNPreventionStringIds[] = const u16 gPSNPreventionStringIds[] =
{ {
STRINGID_PKMNPREVENTSPOISONINGWITH, STRINGID_PKMNSXPREVENTSYSZ, STRINGID_PKMNSXHADNOEFFECTONY [B_MSG_ABILITY_PREVENTS_MOVE_STATUS] = STRINGID_PKMNPREVENTSPOISONINGWITH,
[B_MSG_ABILITY_PREVENTS_ABILITY_STATUS] = STRINGID_PKMNSXPREVENTSYSZ,
[B_MSG_STATUS_HAD_NO_EFFECT] = STRINGID_PKMNSXHADNOEFFECTONY
}; };
const u16 gItemSwapStringIds[] = const u16 gItemSwapStringIds[] =
{ {
STRINGID_PKMNOBTAINEDX, STRINGID_PKMNOBTAINEDX2, STRINGID_PKMNOBTAINEDXYOBTAINEDZ [B_MSG_ITEM_SWAP_TAKEN] = STRINGID_PKMNOBTAINEDX,
[B_MSG_ITEM_SWAP_GIVEN] = STRINGID_PKMNOBTAINEDX2,
[B_MSG_ITEM_SWAP_BOTH] = STRINGID_PKMNOBTAINEDXYOBTAINEDZ
}; };
const u16 gFlashFireStringIds[] = const u16 gFlashFireStringIds[] =
{ {
STRINGID_PKMNRAISEDFIREPOWERWITH, STRINGID_PKMNSXMADEYINEFFECTIVE [B_MSG_FLASH_FIRE_BOOST] = STRINGID_PKMNRAISEDFIREPOWERWITH,
[B_MSG_FLASH_FIRE_NO_BOOST] = STRINGID_PKMNSXMADEYINEFFECTIVE
}; };
const u16 gCaughtMonStringIds[] = const u16 gCaughtMonStringIds[] =
{ {
STRINGID_PKMNTRANSFERREDSOMEONESPC, STRINGID_PKMNTRANSFERREDLANETTESPC, STRINGID_PKMNBOXSOMEONESPCFULL, STRINGID_PKMNBOXLANETTESPCFULL, [B_MSG_SENT_SOMEONES_PC] = STRINGID_PKMNTRANSFERREDSOMEONESPC,
[B_MSG_SENT_LANETTES_PC] = STRINGID_PKMNTRANSFERREDLANETTESPC,
[B_MSG_SOMEONES_BOX_FULL] = STRINGID_PKMNBOXSOMEONESPCFULL,
[B_MSG_LANETTES_BOX_FULL] = STRINGID_PKMNBOXLANETTESPCFULL,
}; };
const u16 gTrappingMoves[] = const u16 gTrappingMoves[] =
@@ -1216,7 +1296,8 @@ static const u8 sText_Defense[] = _("DEFENSE");
static const u8 sText_SpAtk[] = _("SP. ATK"); static const u8 sText_SpAtk[] = _("SP. ATK");
static const u8 sText_SpDef[] = _("SP. DEF"); static const u8 sText_SpDef[] = _("SP. DEF");
const u8 * const gStatNamesTable2[] = // Unused
static const u8 * const sStatNamesTable2[] =
{ {
sText_HP, sText_SpAtk, sText_Attack, sText_HP, sText_SpAtk, sText_Attack,
sText_SpDef, sText_Defense, sText_Speed sText_SpDef, sText_Defense, sText_Speed
@@ -1309,10 +1390,10 @@ static const u8 sText_PkmnEagerForMore[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX} is
const u16 gBattlePalaceFlavorTextTable[] = const u16 gBattlePalaceFlavorTextTable[] =
{ {
STRINGID_GLINTAPPEARSINEYE, [B_MSG_GLINT_IN_EYE] = STRINGID_GLINTAPPEARSINEYE,
STRINGID_PKMNGETTINGINTOPOSITION, [B_MSG_GETTING_IN_POS] = STRINGID_PKMNGETTINGINTOPOSITION,
STRINGID_PKMNBEGANGROWLINGDEEPLY, [B_MSG_GROWL_DEEPLY] = STRINGID_PKMNBEGANGROWLINGDEEPLY,
STRINGID_PKMNEAGERFORMORE [B_MSG_EAGER_FOR_MORE] = STRINGID_PKMNEAGERFORMORE,
}; };
static const u8 sText_RefIfNothingIsDecided[] = _("REFEREE: If nothing is decided in\n3 turns, we will go to judging!"); static const u8 sText_RefIfNothingIsDecided[] = _("REFEREE: If nothing is decided in\n3 turns, we will go to judging!");
@@ -1320,9 +1401,9 @@ static const u8 sText_RefThatsIt[] = _("REFEREE: That's it! We will now go to\nj
static const u8 sText_RefJudgeMind[] = _("REFEREE: Judging category 1, Mind!\nThe POKéMON showing the most guts!\p"); static const u8 sText_RefJudgeMind[] = _("REFEREE: Judging category 1, Mind!\nThe POKéMON showing the most guts!\p");
static const u8 sText_RefJudgeSkill[] = _("REFEREE: Judging category 2, Skill!\nThe POKéMON using moves the best!\p"); static const u8 sText_RefJudgeSkill[] = _("REFEREE: Judging category 2, Skill!\nThe POKéMON using moves the best!\p");
static const u8 sText_RefJudgeBody[] = _("REFEREE: Judging category 3, Body!\nThe POKéMON with the most vitality!\p"); static const u8 sText_RefJudgeBody[] = _("REFEREE: Judging category 3, Body!\nThe POKéMON with the most vitality!\p");
static const u8 sText_RefJudgement1[] = _("REFEREE: Judgment: {B_BUFF1} to {B_BUFF2}!\nThe winner is {B_PLAYER_NAME}'s {B_PLAYER_MON1_NAME}!\p"); static const u8 sText_RefPlayerWon[] = _("REFEREE: Judgment: {B_BUFF1} to {B_BUFF2}!\nThe winner is {B_PLAYER_NAME}'s {B_PLAYER_MON1_NAME}!\p");
static const u8 sText_RefJudgement2[] = _("REFEREE: Judgment: {B_BUFF1} to {B_BUFF2}!\nThe winner is {B_TRAINER1_NAME}'s {B_OPPONENT_MON1_NAME}!\p"); static const u8 sText_RefOpponentWon[] = _("REFEREE: Judgment: {B_BUFF1} to {B_BUFF2}!\nThe winner is {B_TRAINER1_NAME}'s {B_OPPONENT_MON1_NAME}!\p");
static const u8 sText_RefJudgement3[] = _("REFEREE: Judgment: 3 to 3!\nWe have a draw!\p"); static const u8 sText_RefDraw[] = _("REFEREE: Judgment: 3 to 3!\nWe have a draw!\p");
static const u8 sText_DefeatedOpponentByReferee[] = _("{B_PLAYER_MON1_NAME} defeated the opponent\n{B_OPPONENT_MON1_NAME} in a REFEREE's decision!"); static const u8 sText_DefeatedOpponentByReferee[] = _("{B_PLAYER_MON1_NAME} defeated the opponent\n{B_OPPONENT_MON1_NAME} in a REFEREE's decision!");
static const u8 sText_LostToOpponentByReferee[] = _("{B_PLAYER_MON1_NAME} lost to the opponent\n{B_OPPONENT_MON1_NAME} in a REFEREE's decision!"); static const u8 sText_LostToOpponentByReferee[] = _("{B_PLAYER_MON1_NAME} lost to the opponent\n{B_OPPONENT_MON1_NAME} in a REFEREE's decision!");
static const u8 sText_TiedOpponentByReferee[] = _("{B_PLAYER_MON1_NAME} tied the opponent\n{B_OPPONENT_MON1_NAME} in a REFEREE's decision!"); static const u8 sText_TiedOpponentByReferee[] = _("{B_PLAYER_MON1_NAME} tied the opponent\n{B_OPPONENT_MON1_NAME} in a REFEREE's decision!");
@@ -1330,15 +1411,15 @@ static const u8 sText_RefCommenceBattle[] = _("REFEREE: {B_PLAYER_MON1_NAME} VS
const u8 * const gRefereeStringsTable[] = const u8 * const gRefereeStringsTable[] =
{ {
sText_RefIfNothingIsDecided, [B_MSG_REF_NOTHING_IS_DECIDED] = sText_RefIfNothingIsDecided,
sText_RefThatsIt, [B_MSG_REF_THATS_IT] = sText_RefThatsIt,
sText_RefJudgeMind, [B_MSG_REF_JUDGE_MIND] = sText_RefJudgeMind,
sText_RefJudgeSkill, [B_MSG_REF_JUDGE_SKILL] = sText_RefJudgeSkill,
sText_RefJudgeBody, [B_MSG_REF_JUDGE_BODY] = sText_RefJudgeBody,
sText_RefJudgement1, [B_MSG_REF_PLAYER_WON] = sText_RefPlayerWon,
sText_RefJudgement2, [B_MSG_REF_OPPONENT_WON] = sText_RefOpponentWon,
sText_RefJudgement3, [B_MSG_REF_DRAW] = sText_RefDraw,
sText_RefCommenceBattle, [B_MSG_REF_COMMENCE_BATTLE] = sText_RefCommenceBattle,
}; };
static const u8 sText_QuestionForfeitMatch[] = _("Would you like to forfeit the match\nand quit now?"); static const u8 sText_QuestionForfeitMatch[] = _("Would you like to forfeit the match\nand quit now?");
+150 -147
View File
@@ -876,34 +876,33 @@ const ALIGNED(4) u8 gBattlePalaceNatureToMoveGroupLikelihood[NUM_NATURES][4] =
[NATURE_QUIRKY] = PALACE_STYLE(56, 22, 56, 22) // 22%, 22% [NATURE_QUIRKY] = PALACE_STYLE(56, 22, 56, 22) // 22%, 22%
}; };
// Indices into gBattlePalaceFlavorTextTable
static const u8 sBattlePalaceNatureToFlavorTextId[NUM_NATURES] = static const u8 sBattlePalaceNatureToFlavorTextId[NUM_NATURES] =
{ {
[NATURE_HARDY] = 3, [NATURE_HARDY] = B_MSG_EAGER_FOR_MORE,
[NATURE_LONELY] = 0, [NATURE_LONELY] = B_MSG_GLINT_IN_EYE,
[NATURE_BRAVE] = 1, [NATURE_BRAVE] = B_MSG_GETTING_IN_POS,
[NATURE_ADAMANT] = 0, [NATURE_ADAMANT] = B_MSG_GLINT_IN_EYE,
[NATURE_NAUGHTY] = 0, [NATURE_NAUGHTY] = B_MSG_GLINT_IN_EYE,
[NATURE_BOLD] = 1, [NATURE_BOLD] = B_MSG_GETTING_IN_POS,
[NATURE_DOCILE] = 3, [NATURE_DOCILE] = B_MSG_EAGER_FOR_MORE,
[NATURE_RELAXED] = 0, [NATURE_RELAXED] = B_MSG_GLINT_IN_EYE,
[NATURE_IMPISH] = 1, [NATURE_IMPISH] = B_MSG_GETTING_IN_POS,
[NATURE_LAX] = 2, [NATURE_LAX] = B_MSG_GROWL_DEEPLY,
[NATURE_TIMID] = 2, [NATURE_TIMID] = B_MSG_GROWL_DEEPLY,
[NATURE_HASTY] = 0, [NATURE_HASTY] = B_MSG_GLINT_IN_EYE,
[NATURE_SERIOUS] = 3, [NATURE_SERIOUS] = B_MSG_EAGER_FOR_MORE,
[NATURE_JOLLY] = 1, [NATURE_JOLLY] = B_MSG_GETTING_IN_POS,
[NATURE_NAIVE] = 3, [NATURE_NAIVE] = B_MSG_EAGER_FOR_MORE,
[NATURE_MODEST] = 1, [NATURE_MODEST] = B_MSG_GETTING_IN_POS,
[NATURE_MILD] = 2, [NATURE_MILD] = B_MSG_GROWL_DEEPLY,
[NATURE_QUIET] = 3, [NATURE_QUIET] = B_MSG_EAGER_FOR_MORE,
[NATURE_BASHFUL] = 3, [NATURE_BASHFUL] = B_MSG_EAGER_FOR_MORE,
[NATURE_RASH] = 2, [NATURE_RASH] = B_MSG_GROWL_DEEPLY,
[NATURE_CALM] = 1, [NATURE_CALM] = B_MSG_GETTING_IN_POS,
[NATURE_GENTLE] = 0, [NATURE_GENTLE] = B_MSG_GLINT_IN_EYE,
[NATURE_SASSY] = 2, [NATURE_SASSY] = B_MSG_GROWL_DEEPLY,
[NATURE_CAREFUL] = 2, [NATURE_CAREFUL] = B_MSG_GROWL_DEEPLY,
[NATURE_QUIRKY] = 3, [NATURE_QUIRKY] = B_MSG_EAGER_FOR_MORE,
}; };
static void Cmd_attackcanceler(void) static void Cmd_attackcanceler(void)
@@ -991,7 +990,7 @@ static void Cmd_attackcanceler(void)
gMoveResultFlags |= MOVE_RESULT_MISSED; gMoveResultFlags |= MOVE_RESULT_MISSED;
gLastLandedMoves[gBattlerTarget] = 0; gLastLandedMoves[gBattlerTarget] = 0;
gLastHitByType[gBattlerTarget] = 0; gLastHitByType[gBattlerTarget] = 0;
gBattleCommunication[6] = 1; gBattleCommunication[MISS_TYPE] = B_MSG_PROTECTED;
gBattlescriptCurrInstr++; gBattlescriptCurrInstr++;
} }
else else
@@ -1024,7 +1023,7 @@ static void Cmd_jumpifaffectedbyprotect(void)
{ {
gMoveResultFlags |= MOVE_RESULT_MISSED; gMoveResultFlags |= MOVE_RESULT_MISSED;
JumpIfMoveFailed(5, 0); JumpIfMoveFailed(5, 0);
gBattleCommunication[6] = 1; gBattleCommunication[MISS_TYPE] = B_MSG_PROTECTED;
} }
else else
{ {
@@ -1039,7 +1038,7 @@ bool8 JumpIfMoveAffectedByProtect(u16 move)
{ {
gMoveResultFlags |= MOVE_RESULT_MISSED; gMoveResultFlags |= MOVE_RESULT_MISSED;
JumpIfMoveFailed(7, move); JumpIfMoveFailed(7, move);
gBattleCommunication[6] = 1; gBattleCommunication[MISS_TYPE] = B_MSG_PROTECTED;
affected = TRUE; affected = TRUE;
} }
return affected; return affected;
@@ -1172,9 +1171,9 @@ static void Cmd_accuracycheck(void)
gMoveResultFlags |= MOVE_RESULT_MISSED; gMoveResultFlags |= MOVE_RESULT_MISSED;
if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE && if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE &&
(gBattleMoves[move].target == MOVE_TARGET_BOTH || gBattleMoves[move].target == MOVE_TARGET_FOES_AND_ALLY)) (gBattleMoves[move].target == MOVE_TARGET_BOTH || gBattleMoves[move].target == MOVE_TARGET_FOES_AND_ALLY))
gBattleCommunication[6] = 2; gBattleCommunication[MISS_TYPE] = B_MSG_AVOIDED_ATK;
else else
gBattleCommunication[6] = 0; gBattleCommunication[MISS_TYPE] = B_MSG_MISSED;
CheckWonderGuardAndLevitate(); CheckWonderGuardAndLevitate();
} }
@@ -1370,7 +1369,7 @@ static void Cmd_typecalc(void)
gMoveResultFlags |= (MOVE_RESULT_MISSED | MOVE_RESULT_DOESNT_AFFECT_FOE); gMoveResultFlags |= (MOVE_RESULT_MISSED | MOVE_RESULT_DOESNT_AFFECT_FOE);
gLastLandedMoves[gBattlerTarget] = 0; gLastLandedMoves[gBattlerTarget] = 0;
gLastHitByType[gBattlerTarget] = 0; gLastHitByType[gBattlerTarget] = 0;
gBattleCommunication[6] = moveType; gBattleCommunication[MISS_TYPE] = B_MSG_GROUND_MISS;
RecordAbilityBattle(gBattlerTarget, gLastUsedAbility); RecordAbilityBattle(gBattlerTarget, gLastUsedAbility);
} }
else else
@@ -1406,7 +1405,7 @@ static void Cmd_typecalc(void)
gMoveResultFlags |= MOVE_RESULT_MISSED; gMoveResultFlags |= MOVE_RESULT_MISSED;
gLastLandedMoves[gBattlerTarget] = 0; gLastLandedMoves[gBattlerTarget] = 0;
gLastHitByType[gBattlerTarget] = 0; gLastHitByType[gBattlerTarget] = 0;
gBattleCommunication[6] = 3; gBattleCommunication[MISS_TYPE] = B_MSG_AVOIDED_DMG;
RecordAbilityBattle(gBattlerTarget, gLastUsedAbility); RecordAbilityBattle(gBattlerTarget, gLastUsedAbility);
} }
if (gMoveResultFlags & MOVE_RESULT_DOESNT_AFFECT_FOE) if (gMoveResultFlags & MOVE_RESULT_DOESNT_AFFECT_FOE)
@@ -1429,7 +1428,7 @@ static void CheckWonderGuardAndLevitate(void)
if (gBattleMons[gBattlerTarget].ability == ABILITY_LEVITATE && moveType == TYPE_GROUND) if (gBattleMons[gBattlerTarget].ability == ABILITY_LEVITATE && moveType == TYPE_GROUND)
{ {
gLastUsedAbility = ABILITY_LEVITATE; gLastUsedAbility = ABILITY_LEVITATE;
gBattleCommunication[6] = moveType; gBattleCommunication[MISS_TYPE] = B_MSG_GROUND_MISS;
RecordAbilityBattle(gBattlerTarget, ABILITY_LEVITATE); RecordAbilityBattle(gBattlerTarget, ABILITY_LEVITATE);
return; return;
} }
@@ -1484,7 +1483,7 @@ static void CheckWonderGuardAndLevitate(void)
if (((flags & 2) || !(flags & 1)) && gBattleMoves[gCurrentMove].power) if (((flags & 2) || !(flags & 1)) && gBattleMoves[gCurrentMove].power)
{ {
gLastUsedAbility = ABILITY_WONDER_GUARD; gLastUsedAbility = ABILITY_WONDER_GUARD;
gBattleCommunication[6] = 3; gBattleCommunication[MISS_TYPE] = B_MSG_AVOIDED_DMG;
RecordAbilityBattle(gBattlerTarget, ABILITY_WONDER_GUARD); RecordAbilityBattle(gBattlerTarget, ABILITY_WONDER_GUARD);
} }
} }
@@ -2019,9 +2018,9 @@ static void Cmd_resultmessage(void)
if (gBattleControllerExecFlags) if (gBattleControllerExecFlags)
return; return;
if (gMoveResultFlags & MOVE_RESULT_MISSED && (!(gMoveResultFlags & MOVE_RESULT_DOESNT_AFFECT_FOE) || gBattleCommunication[6] > 2)) if (gMoveResultFlags & MOVE_RESULT_MISSED && (!(gMoveResultFlags & MOVE_RESULT_DOESNT_AFFECT_FOE) || gBattleCommunication[MISS_TYPE] > B_MSG_AVOIDED_ATK))
{ {
stringId = gMissStringIds[gBattleCommunication[6]]; stringId = gMissStringIds[gBattleCommunication[MISS_TYPE]];
gBattleCommunication[MSG_DISPLAY] = 1; gBattleCommunication[MSG_DISPLAY] = 1;
} }
else else
@@ -2273,12 +2272,12 @@ void SetMoveEffect(bool8 primary, u8 certain)
if (gHitMarker & HITMARKER_IGNORE_SAFEGUARD) if (gHitMarker & HITMARKER_IGNORE_SAFEGUARD)
{ {
gBattleCommunication[MULTISTRING_CHOOSER] = 1; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_ABILITY_PREVENTS_ABILITY_STATUS;
gHitMarker &= ~(HITMARKER_IGNORE_SAFEGUARD); gHitMarker &= ~(HITMARKER_IGNORE_SAFEGUARD);
} }
else else
{ {
gBattleCommunication[MULTISTRING_CHOOSER] = 0; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_ABILITY_PREVENTS_MOVE_STATUS;
} }
RESET_RETURN RESET_RETURN
} }
@@ -2289,7 +2288,7 @@ void SetMoveEffect(bool8 primary, u8 certain)
BattleScriptPush(gBattlescriptCurrInstr + 1); BattleScriptPush(gBattlescriptCurrInstr + 1);
gBattlescriptCurrInstr = BattleScript_PSNPrevention; gBattlescriptCurrInstr = BattleScript_PSNPrevention;
gBattleCommunication[MULTISTRING_CHOOSER] = 2; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_STATUS_HAD_NO_EFFECT;
RESET_RETURN RESET_RETURN
} }
if (IS_BATTLER_OF_TYPE(gEffectBattler, TYPE_POISON)) if (IS_BATTLER_OF_TYPE(gEffectBattler, TYPE_POISON))
@@ -2314,12 +2313,12 @@ void SetMoveEffect(bool8 primary, u8 certain)
gBattlescriptCurrInstr = BattleScript_BRNPrevention; gBattlescriptCurrInstr = BattleScript_BRNPrevention;
if (gHitMarker & HITMARKER_IGNORE_SAFEGUARD) if (gHitMarker & HITMARKER_IGNORE_SAFEGUARD)
{ {
gBattleCommunication[MULTISTRING_CHOOSER] = 1; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_ABILITY_PREVENTS_ABILITY_STATUS;
gHitMarker &= ~(HITMARKER_IGNORE_SAFEGUARD); gHitMarker &= ~(HITMARKER_IGNORE_SAFEGUARD);
} }
else else
{ {
gBattleCommunication[MULTISTRING_CHOOSER] = 0; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_ABILITY_PREVENTS_MOVE_STATUS;
} }
RESET_RETURN RESET_RETURN
} }
@@ -2330,7 +2329,7 @@ void SetMoveEffect(bool8 primary, u8 certain)
BattleScriptPush(gBattlescriptCurrInstr + 1); BattleScriptPush(gBattlescriptCurrInstr + 1);
gBattlescriptCurrInstr = BattleScript_BRNPrevention; gBattlescriptCurrInstr = BattleScript_BRNPrevention;
gBattleCommunication[MULTISTRING_CHOOSER] = 2; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_STATUS_HAD_NO_EFFECT;
RESET_RETURN RESET_RETURN
} }
if (IS_BATTLER_OF_TYPE(gEffectBattler, TYPE_FIRE)) if (IS_BATTLER_OF_TYPE(gEffectBattler, TYPE_FIRE))
@@ -2370,12 +2369,12 @@ void SetMoveEffect(bool8 primary, u8 certain)
if (gHitMarker & HITMARKER_IGNORE_SAFEGUARD) if (gHitMarker & HITMARKER_IGNORE_SAFEGUARD)
{ {
gBattleCommunication[MULTISTRING_CHOOSER] = 1; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_ABILITY_PREVENTS_ABILITY_STATUS;
gHitMarker &= ~(HITMARKER_IGNORE_SAFEGUARD); gHitMarker &= ~(HITMARKER_IGNORE_SAFEGUARD);
} }
else else
{ {
gBattleCommunication[MULTISTRING_CHOOSER] = 0; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_ABILITY_PREVENTS_MOVE_STATUS;
} }
RESET_RETURN RESET_RETURN
} }
@@ -2398,12 +2397,12 @@ void SetMoveEffect(bool8 primary, u8 certain)
if (gHitMarker & HITMARKER_IGNORE_SAFEGUARD) if (gHitMarker & HITMARKER_IGNORE_SAFEGUARD)
{ {
gBattleCommunication[MULTISTRING_CHOOSER] = 1; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_ABILITY_PREVENTS_ABILITY_STATUS;
gHitMarker &= ~(HITMARKER_IGNORE_SAFEGUARD); gHitMarker &= ~(HITMARKER_IGNORE_SAFEGUARD);
} }
else else
{ {
gBattleCommunication[MULTISTRING_CHOOSER] = 0; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_ABILITY_PREVENTS_MOVE_STATUS;
} }
RESET_RETURN RESET_RETURN
} }
@@ -2414,7 +2413,7 @@ void SetMoveEffect(bool8 primary, u8 certain)
BattleScriptPush(gBattlescriptCurrInstr + 1); BattleScriptPush(gBattlescriptCurrInstr + 1);
gBattlescriptCurrInstr = BattleScript_PSNPrevention; gBattlescriptCurrInstr = BattleScript_PSNPrevention;
gBattleCommunication[MULTISTRING_CHOOSER] = 2; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_STATUS_HAD_NO_EFFECT;
RESET_RETURN RESET_RETURN
} }
if (gBattleMons[gEffectBattler].status1) if (gBattleMons[gEffectBattler].status1)
@@ -2453,12 +2452,12 @@ void SetMoveEffect(bool8 primary, u8 certain)
if (gHitMarker & HITMARKER_IGNORE_SAFEGUARD) if (gHitMarker & HITMARKER_IGNORE_SAFEGUARD)
{ {
gBattleCommunication[MULTISTRING_CHOOSER] = 1; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_STATUSED_BY_ABILITY;
gHitMarker &= ~(HITMARKER_IGNORE_SAFEGUARD); gHitMarker &= ~(HITMARKER_IGNORE_SAFEGUARD);
} }
else else
{ {
gBattleCommunication[MULTISTRING_CHOOSER] = 0; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_STATUSED;
} }
// for synchronize // for synchronize
@@ -3579,7 +3578,7 @@ static void MoveValuesCleanUp(void)
gBattleScripting.dmgMultiplier = 1; gBattleScripting.dmgMultiplier = 1;
gCritMultiplier = 1; gCritMultiplier = 1;
gBattleCommunication[MOVE_EFFECT_BYTE] = 0; gBattleCommunication[MOVE_EFFECT_BYTE] = 0;
gBattleCommunication[6] = 0; gBattleCommunication[MISS_TYPE] = 0;
gHitMarker &= ~(HITMARKER_DESTINYBOND); gHitMarker &= ~(HITMARKER_DESTINYBOND);
gHitMarker &= ~(HITMARKER_SYNCHRONISE_EFFECT); gHitMarker &= ~(HITMARKER_SYNCHRONISE_EFFECT);
} }
@@ -4459,7 +4458,7 @@ static void Cmd_typecalc2(void)
gLastUsedAbility = gBattleMons[gBattlerTarget].ability; gLastUsedAbility = gBattleMons[gBattlerTarget].ability;
gMoveResultFlags |= (MOVE_RESULT_MISSED | MOVE_RESULT_DOESNT_AFFECT_FOE); gMoveResultFlags |= (MOVE_RESULT_MISSED | MOVE_RESULT_DOESNT_AFFECT_FOE);
gLastLandedMoves[gBattlerTarget] = 0; gLastLandedMoves[gBattlerTarget] = 0;
gBattleCommunication[6] = moveType; gBattleCommunication[MISS_TYPE] = B_MSG_GROUND_MISS;
RecordAbilityBattle(gBattlerTarget, gLastUsedAbility); RecordAbilityBattle(gBattlerTarget, gLastUsedAbility);
} }
else else
@@ -4534,7 +4533,7 @@ static void Cmd_typecalc2(void)
gLastUsedAbility = ABILITY_WONDER_GUARD; gLastUsedAbility = ABILITY_WONDER_GUARD;
gMoveResultFlags |= MOVE_RESULT_MISSED; gMoveResultFlags |= MOVE_RESULT_MISSED;
gLastLandedMoves[gBattlerTarget] = 0; gLastLandedMoves[gBattlerTarget] = 0;
gBattleCommunication[6] = 3; gBattleCommunication[MISS_TYPE] = B_MSG_AVOIDED_DMG;
RecordAbilityBattle(gBattlerTarget, gLastUsedAbility); RecordAbilityBattle(gBattlerTarget, gLastUsedAbility);
} }
if (gMoveResultFlags & MOVE_RESULT_DOESNT_AFFECT_FOE) if (gMoveResultFlags & MOVE_RESULT_DOESNT_AFFECT_FOE)
@@ -4802,7 +4801,9 @@ static void Cmd_jumpifcantswitch(void)
} }
} }
static void sub_804CF10(u8 slotId) // Opens the party screen to choose a new Pokémon to send out
// slotId is the Pokémon to replace
static void ChooseMonToSendOut(u8 slotId)
{ {
*(gBattleStruct->field_58 + gActiveBattler) = gBattlerPartyIndexes[gActiveBattler]; *(gBattleStruct->field_58 + gActiveBattler) = gBattlerPartyIndexes[gActiveBattler];
*(gBattleStruct->monToSwitchIntoId + gActiveBattler) = PARTY_SIZE; *(gBattleStruct->monToSwitchIntoId + gActiveBattler) = PARTY_SIZE;
@@ -4823,7 +4824,7 @@ static void Cmd_openpartyscreen(void)
flags = 0; flags = 0;
jumpPtr = T1_READ_PTR(gBattlescriptCurrInstr + 2); jumpPtr = T1_READ_PTR(gBattlescriptCurrInstr + 2);
if (gBattlescriptCurrInstr[1] == 5) if (gBattlescriptCurrInstr[1] == BS_UNK_5)
{ {
if ((gBattleTypeFlags & (BATTLE_TYPE_DOUBLE | BATTLE_TYPE_MULTI)) != BATTLE_TYPE_DOUBLE) if ((gBattleTypeFlags & (BATTLE_TYPE_DOUBLE | BATTLE_TYPE_MULTI)) != BATTLE_TYPE_DOUBLE)
{ {
@@ -4831,7 +4832,7 @@ static void Cmd_openpartyscreen(void)
{ {
if (gHitMarker & HITMARKER_FAINTED(gActiveBattler)) if (gHitMarker & HITMARKER_FAINTED(gActiveBattler))
{ {
if (HasNoMonsToSwitch(gActiveBattler, 6, 6)) if (HasNoMonsToSwitch(gActiveBattler, PARTY_SIZE, PARTY_SIZE))
{ {
gAbsentBattlerFlags |= gBitTable[gActiveBattler]; gAbsentBattlerFlags |= gBitTable[gActiveBattler];
gHitMarker &= ~(HITMARKER_FAINTED(gActiveBattler)); gHitMarker &= ~(HITMARKER_FAINTED(gActiveBattler));
@@ -4840,7 +4841,7 @@ static void Cmd_openpartyscreen(void)
} }
else if (!gSpecialStatuses[gActiveBattler].flag40) else if (!gSpecialStatuses[gActiveBattler].flag40)
{ {
sub_804CF10(PARTY_SIZE); ChooseMonToSendOut(PARTY_SIZE);
gSpecialStatuses[gActiveBattler].flag40 = 1; gSpecialStatuses[gActiveBattler].flag40 = 1;
} }
} }
@@ -4860,16 +4861,16 @@ static void Cmd_openpartyscreen(void)
if (gBitTable[0] & hitmarkerFaintBits) if (gBitTable[0] & hitmarkerFaintBits)
{ {
gActiveBattler = 0; gActiveBattler = 0;
if (HasNoMonsToSwitch(0, 6, 6)) if (HasNoMonsToSwitch(0, PARTY_SIZE, PARTY_SIZE))
{ {
gAbsentBattlerFlags |= gBitTable[gActiveBattler]; gAbsentBattlerFlags |= gBitTable[gActiveBattler];
gHitMarker &= ~(HITMARKER_FAINTED(gActiveBattler)); gHitMarker &= ~(HITMARKER_FAINTED(gActiveBattler));
BtlController_EmitCmd42(0); BtlController_EmitCantSwitch(0);
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
} }
else if (!gSpecialStatuses[gActiveBattler].flag40) else if (!gSpecialStatuses[gActiveBattler].flag40)
{ {
sub_804CF10(gBattleStruct->monToSwitchIntoId[2]); ChooseMonToSendOut(gBattleStruct->monToSwitchIntoId[2]);
gSpecialStatuses[gActiveBattler].flag40 = 1; gSpecialStatuses[gActiveBattler].flag40 = 1;
} }
else else
@@ -4882,16 +4883,16 @@ static void Cmd_openpartyscreen(void)
if (gBitTable[2] & hitmarkerFaintBits && !(gBitTable[0] & hitmarkerFaintBits)) if (gBitTable[2] & hitmarkerFaintBits && !(gBitTable[0] & hitmarkerFaintBits))
{ {
gActiveBattler = 2; gActiveBattler = 2;
if (HasNoMonsToSwitch(2, 6, 6)) if (HasNoMonsToSwitch(2, PARTY_SIZE, PARTY_SIZE))
{ {
gAbsentBattlerFlags |= gBitTable[gActiveBattler]; gAbsentBattlerFlags |= gBitTable[gActiveBattler];
gHitMarker &= ~(HITMARKER_FAINTED(gActiveBattler)); gHitMarker &= ~(HITMARKER_FAINTED(gActiveBattler));
BtlController_EmitCmd42(0); BtlController_EmitCantSwitch(0);
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
} }
else if (!gSpecialStatuses[gActiveBattler].flag40) else if (!gSpecialStatuses[gActiveBattler].flag40)
{ {
sub_804CF10(gBattleStruct->monToSwitchIntoId[0]); ChooseMonToSendOut(gBattleStruct->monToSwitchIntoId[0]);
gSpecialStatuses[gActiveBattler].flag40 = 1; gSpecialStatuses[gActiveBattler].flag40 = 1;
} }
else if (!(flags & 1)) else if (!(flags & 1))
@@ -4903,16 +4904,16 @@ static void Cmd_openpartyscreen(void)
if (gBitTable[1] & hitmarkerFaintBits) if (gBitTable[1] & hitmarkerFaintBits)
{ {
gActiveBattler = 1; gActiveBattler = 1;
if (HasNoMonsToSwitch(1, 6, 6)) if (HasNoMonsToSwitch(1, PARTY_SIZE, PARTY_SIZE))
{ {
gAbsentBattlerFlags |= gBitTable[gActiveBattler]; gAbsentBattlerFlags |= gBitTable[gActiveBattler];
gHitMarker &= ~(HITMARKER_FAINTED(gActiveBattler)); gHitMarker &= ~(HITMARKER_FAINTED(gActiveBattler));
BtlController_EmitCmd42(0); BtlController_EmitCantSwitch(0);
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
} }
else if (!gSpecialStatuses[gActiveBattler].flag40) else if (!gSpecialStatuses[gActiveBattler].flag40)
{ {
sub_804CF10(gBattleStruct->monToSwitchIntoId[3]); ChooseMonToSendOut(gBattleStruct->monToSwitchIntoId[3]);
gSpecialStatuses[gActiveBattler].flag40 = 1; gSpecialStatuses[gActiveBattler].flag40 = 1;
} }
else else
@@ -4925,16 +4926,16 @@ static void Cmd_openpartyscreen(void)
if (gBitTable[3] & hitmarkerFaintBits && !(gBitTable[1] & hitmarkerFaintBits)) if (gBitTable[3] & hitmarkerFaintBits && !(gBitTable[1] & hitmarkerFaintBits))
{ {
gActiveBattler = 3; gActiveBattler = 3;
if (HasNoMonsToSwitch(3, 6, 6)) if (HasNoMonsToSwitch(3, PARTY_SIZE, PARTY_SIZE))
{ {
gAbsentBattlerFlags |= gBitTable[gActiveBattler]; gAbsentBattlerFlags |= gBitTable[gActiveBattler];
gHitMarker &= ~(HITMARKER_FAINTED(gActiveBattler)); gHitMarker &= ~(HITMARKER_FAINTED(gActiveBattler));
BtlController_EmitCmd42(0); BtlController_EmitCantSwitch(0);
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
} }
else if (!gSpecialStatuses[gActiveBattler].flag40) else if (!gSpecialStatuses[gActiveBattler].flag40)
{ {
sub_804CF10(gBattleStruct->monToSwitchIntoId[1]); ChooseMonToSendOut(gBattleStruct->monToSwitchIntoId[1]);
gSpecialStatuses[gActiveBattler].flag40 = 1; gSpecialStatuses[gActiveBattler].flag40 = 1;
} }
else if (!(flags & 2)) else if (!(flags & 2))
@@ -4978,7 +4979,7 @@ static void Cmd_openpartyscreen(void)
} }
gBattlescriptCurrInstr += 6; gBattlescriptCurrInstr += 6;
} }
else if (gBattlescriptCurrInstr[1] == 6) else if (gBattlescriptCurrInstr[1] == BS_UNK_6)
{ {
if (!(gBattleTypeFlags & BATTLE_TYPE_MULTI)) if (!(gBattleTypeFlags & BATTLE_TYPE_MULTI))
{ {
@@ -4988,32 +4989,32 @@ static void Cmd_openpartyscreen(void)
if (gBitTable[2] & hitmarkerFaintBits && gBitTable[0] & hitmarkerFaintBits) if (gBitTable[2] & hitmarkerFaintBits && gBitTable[0] & hitmarkerFaintBits)
{ {
gActiveBattler = 2; gActiveBattler = 2;
if (HasNoMonsToSwitch(2, gBattleBufferB[0][1], 6)) if (HasNoMonsToSwitch(2, gBattleBufferB[0][1], PARTY_SIZE))
{ {
gAbsentBattlerFlags |= gBitTable[gActiveBattler]; gAbsentBattlerFlags |= gBitTable[gActiveBattler];
gHitMarker &= ~(HITMARKER_FAINTED(gActiveBattler)); gHitMarker &= ~(HITMARKER_FAINTED(gActiveBattler));
BtlController_EmitCmd42(0); BtlController_EmitCantSwitch(0);
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
} }
else if (!gSpecialStatuses[gActiveBattler].flag40) else if (!gSpecialStatuses[gActiveBattler].flag40)
{ {
sub_804CF10(gBattleStruct->monToSwitchIntoId[0]); ChooseMonToSendOut(gBattleStruct->monToSwitchIntoId[0]);
gSpecialStatuses[gActiveBattler].flag40 = 1; gSpecialStatuses[gActiveBattler].flag40 = 1;
} }
} }
if (gBitTable[3] & hitmarkerFaintBits && hitmarkerFaintBits & gBitTable[1]) if (gBitTable[3] & hitmarkerFaintBits && hitmarkerFaintBits & gBitTable[1])
{ {
gActiveBattler = 3; gActiveBattler = 3;
if (HasNoMonsToSwitch(3, gBattleBufferB[1][1], 6)) if (HasNoMonsToSwitch(3, gBattleBufferB[1][1], PARTY_SIZE))
{ {
gAbsentBattlerFlags |= gBitTable[gActiveBattler]; gAbsentBattlerFlags |= gBitTable[gActiveBattler];
gHitMarker &= ~(HITMARKER_FAINTED(gActiveBattler)); gHitMarker &= ~(HITMARKER_FAINTED(gActiveBattler));
BtlController_EmitCmd42(0); BtlController_EmitCantSwitch(0);
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
} }
else if (!gSpecialStatuses[gActiveBattler].flag40) else if (!gSpecialStatuses[gActiveBattler].flag40)
{ {
sub_804CF10(gBattleStruct->monToSwitchIntoId[1]); ChooseMonToSendOut(gBattleStruct->monToSwitchIntoId[1]);
gSpecialStatuses[gActiveBattler].flag40 = 1; gSpecialStatuses[gActiveBattler].flag40 = 1;
} }
} }
@@ -5041,17 +5042,17 @@ static void Cmd_openpartyscreen(void)
} }
else else
{ {
if (gBattlescriptCurrInstr[1] & 0x80) if (gBattlescriptCurrInstr[1] & PARTY_SCREEN_OPTIONAL)
hitmarkerFaintBits = PARTY_ACTION_CHOOSE_MON; // Used here as the caseId for the EmitChoose function. hitmarkerFaintBits = PARTY_ACTION_CHOOSE_MON; // Used here as the caseId for the EmitChoose function.
else else
hitmarkerFaintBits = PARTY_ACTION_SEND_OUT; hitmarkerFaintBits = PARTY_ACTION_SEND_OUT;
battlerId = GetBattlerForBattleScript(gBattlescriptCurrInstr[1] & ~(0x80)); battlerId = GetBattlerForBattleScript(gBattlescriptCurrInstr[1] & ~(PARTY_SCREEN_OPTIONAL));
if (gSpecialStatuses[battlerId].flag40) if (gSpecialStatuses[battlerId].flag40)
{ {
gBattlescriptCurrInstr += 6; gBattlescriptCurrInstr += 6;
} }
else if (HasNoMonsToSwitch(battlerId, 6, 6)) else if (HasNoMonsToSwitch(battlerId, PARTY_SIZE, PARTY_SIZE))
{ {
gActiveBattler = battlerId; gActiveBattler = battlerId;
gAbsentBattlerFlags |= gBitTable[gActiveBattler]; gAbsentBattlerFlags |= gBitTable[gActiveBattler];
@@ -6373,10 +6374,10 @@ static void Cmd_various(void)
break; break;
case VARIOUS_ARENA_JUDGMENT_STRING: case VARIOUS_ARENA_JUDGMENT_STRING:
BattleStringExpandPlaceholdersToDisplayedString(gRefereeStringsTable[gBattlescriptCurrInstr[1]]); BattleStringExpandPlaceholdersToDisplayedString(gRefereeStringsTable[gBattlescriptCurrInstr[1]]);
BattlePutTextOnWindow(gDisplayedStringBattle, 0x16); BattlePutTextOnWindow(gDisplayedStringBattle, 22);
break; break;
case VARIOUS_ARENA_WAIT_STRING: case VARIOUS_ARENA_WAIT_STRING:
if (IsTextPrinterActive(0x16)) if (IsTextPrinterActive(22))
return; return;
break; break;
case VARIOUS_WAIT_CRY: case VARIOUS_WAIT_CRY:
@@ -6446,19 +6447,19 @@ static void Cmd_setprotectlike(void) // protect and endure
if (gBattleMoves[gCurrentMove].effect == EFFECT_PROTECT) if (gBattleMoves[gCurrentMove].effect == EFFECT_PROTECT)
{ {
gProtectStructs[gBattlerAttacker].protected = 1; gProtectStructs[gBattlerAttacker].protected = 1;
gBattleCommunication[MULTISTRING_CHOOSER] = 0; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_PROTECTED_ITSELF;
} }
if (gBattleMoves[gCurrentMove].effect == EFFECT_ENDURE) if (gBattleMoves[gCurrentMove].effect == EFFECT_ENDURE)
{ {
gProtectStructs[gBattlerAttacker].endured = 1; gProtectStructs[gBattlerAttacker].endured = 1;
gBattleCommunication[MULTISTRING_CHOOSER] = 1; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_BRACED_ITSELF;
} }
gDisableStructs[gBattlerAttacker].protectUses++; gDisableStructs[gBattlerAttacker].protectUses++;
} }
else else
{ {
gDisableStructs[gBattlerAttacker].protectUses = 0; gDisableStructs[gBattlerAttacker].protectUses = 0;
gBattleCommunication[MULTISTRING_CHOOSER] = 2; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_PROTECT_FAILED;
gMoveResultFlags |= MOVE_RESULT_MISSED; gMoveResultFlags |= MOVE_RESULT_MISSED;
} }
@@ -6611,12 +6612,12 @@ static void Cmd_setrain(void)
if (gBattleWeather & WEATHER_RAIN_ANY) if (gBattleWeather & WEATHER_RAIN_ANY)
{ {
gMoveResultFlags |= MOVE_RESULT_MISSED; gMoveResultFlags |= MOVE_RESULT_MISSED;
gBattleCommunication[MULTISTRING_CHOOSER] = 2; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_WEATHER_FAILED;
} }
else else
{ {
gBattleWeather = WEATHER_RAIN_TEMPORARY; gBattleWeather = WEATHER_RAIN_TEMPORARY;
gBattleCommunication[MULTISTRING_CHOOSER] = 0; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_STARTED_RAIN;
gWishFutureKnock.weatherDuration = 5; gWishFutureKnock.weatherDuration = 5;
} }
gBattlescriptCurrInstr++; gBattlescriptCurrInstr++;
@@ -6627,7 +6628,7 @@ static void Cmd_setreflect(void)
if (gSideStatuses[GET_BATTLER_SIDE(gBattlerAttacker)] & SIDE_STATUS_REFLECT) if (gSideStatuses[GET_BATTLER_SIDE(gBattlerAttacker)] & SIDE_STATUS_REFLECT)
{ {
gMoveResultFlags |= MOVE_RESULT_MISSED; gMoveResultFlags |= MOVE_RESULT_MISSED;
gBattleCommunication[MULTISTRING_CHOOSER] = 0; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SIDE_STATUS_FAILED;
} }
else else
{ {
@@ -6636,9 +6637,9 @@ static void Cmd_setreflect(void)
gSideTimers[GET_BATTLER_SIDE(gBattlerAttacker)].reflectBattlerId = gBattlerAttacker; gSideTimers[GET_BATTLER_SIDE(gBattlerAttacker)].reflectBattlerId = gBattlerAttacker;
if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE && CountAliveMonsInBattle(BATTLE_ALIVE_ATK_SIDE) == 2) if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE && CountAliveMonsInBattle(BATTLE_ALIVE_ATK_SIDE) == 2)
gBattleCommunication[MULTISTRING_CHOOSER] = 2; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SET_REFLECT_DOUBLE;
else else
gBattleCommunication[MULTISTRING_CHOOSER] = 1; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SET_REFLECT_SINGLE;
} }
gBattlescriptCurrInstr++; gBattlescriptCurrInstr++;
} }
@@ -6648,18 +6649,18 @@ static void Cmd_setseeded(void)
if (gMoveResultFlags & MOVE_RESULT_NO_EFFECT || gStatuses3[gBattlerTarget] & STATUS3_LEECHSEED) if (gMoveResultFlags & MOVE_RESULT_NO_EFFECT || gStatuses3[gBattlerTarget] & STATUS3_LEECHSEED)
{ {
gMoveResultFlags |= MOVE_RESULT_MISSED; gMoveResultFlags |= MOVE_RESULT_MISSED;
gBattleCommunication[MULTISTRING_CHOOSER] = 1; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_LEECH_SEED_MISS;
} }
else if (IS_BATTLER_OF_TYPE(gBattlerTarget, TYPE_GRASS)) else if (IS_BATTLER_OF_TYPE(gBattlerTarget, TYPE_GRASS))
{ {
gMoveResultFlags |= MOVE_RESULT_MISSED; gMoveResultFlags |= MOVE_RESULT_MISSED;
gBattleCommunication[MULTISTRING_CHOOSER] = 2; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_LEECH_SEED_FAIL;
} }
else else
{ {
gStatuses3[gBattlerTarget] |= gBattlerAttacker; gStatuses3[gBattlerTarget] |= gBattlerAttacker;
gStatuses3[gBattlerTarget] |= STATUS3_LEECHSEED; gStatuses3[gBattlerTarget] |= STATUS3_LEECHSEED;
gBattleCommunication[MULTISTRING_CHOOSER] = 0; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_LEECH_SEED_SET;
} }
gBattlescriptCurrInstr++; gBattlescriptCurrInstr++;
@@ -6700,11 +6701,11 @@ static void Cmd_trysetrest(void)
else else
{ {
if (gBattleMons[gBattlerTarget].status1 & ((u8)(~STATUS1_SLEEP))) if (gBattleMons[gBattlerTarget].status1 & ((u8)(~STATUS1_SLEEP)))
gBattleCommunication[MULTISTRING_CHOOSER] = 1; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_REST_STATUSED;
else else
gBattleCommunication[MULTISTRING_CHOOSER] = 0; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_REST;
gBattleMons[gBattlerTarget].status1 = 3; gBattleMons[gBattlerTarget].status1 = STATUS1_SLEEP_TURN(3);
BtlController_EmitSetMonData(0, REQUEST_STATUS_BATTLE, 0, 4, &gBattleMons[gActiveBattler].status1); BtlController_EmitSetMonData(0, REQUEST_STATUS_BATTLE, 0, 4, &gBattleMons[gActiveBattler].status1);
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
gBattlescriptCurrInstr += 5; gBattlescriptCurrInstr += 5;
@@ -6740,9 +6741,9 @@ bool8 UproarWakeUpCheck(u8 battlerId)
if (gBattlerTarget == 0xFF) if (gBattlerTarget == 0xFF)
gBattlerTarget = i; gBattlerTarget = i;
else if (gBattlerTarget == i) else if (gBattlerTarget == i)
gBattleCommunication[MULTISTRING_CHOOSER] = 0; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_CANT_SLEEP_UPROAR;
else else
gBattleCommunication[MULTISTRING_CHOOSER] = 1; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_UPROAR_KEPT_AWAKE;
break; break;
} }
@@ -6765,7 +6766,7 @@ static void Cmd_jumpifcantmakeasleep(void)
|| gBattleMons[gBattlerTarget].ability == ABILITY_VITAL_SPIRIT) || gBattleMons[gBattlerTarget].ability == ABILITY_VITAL_SPIRIT)
{ {
gLastUsedAbility = gBattleMons[gBattlerTarget].ability; gLastUsedAbility = gBattleMons[gBattlerTarget].ability;
gBattleCommunication[MULTISTRING_CHOOSER] = 2; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_STAYED_AWAKE_USING;
gBattlescriptCurrInstr = jumpPtr; gBattlescriptCurrInstr = jumpPtr;
RecordAbilityBattle(gBattlerTarget, gLastUsedAbility); RecordAbilityBattle(gBattlerTarget, gLastUsedAbility);
} }
@@ -6780,7 +6781,7 @@ static void Cmd_stockpile(void)
if (gDisableStructs[gBattlerAttacker].stockpileCounter == 3) if (gDisableStructs[gBattlerAttacker].stockpileCounter == 3)
{ {
gMoveResultFlags |= MOVE_RESULT_MISSED; gMoveResultFlags |= MOVE_RESULT_MISSED;
gBattleCommunication[MULTISTRING_CHOOSER] = 1; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_CANT_STOCKPILE;
} }
else else
{ {
@@ -6788,7 +6789,7 @@ static void Cmd_stockpile(void)
PREPARE_BYTE_NUMBER_BUFFER(gBattleTextBuff1, 1, gDisableStructs[gBattlerAttacker].stockpileCounter) PREPARE_BYTE_NUMBER_BUFFER(gBattleTextBuff1, 1, gDisableStructs[gBattlerAttacker].stockpileCounter)
gBattleCommunication[MULTISTRING_CHOOSER] = 0; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_STOCKPILED;
} }
gBattlescriptCurrInstr++; gBattlescriptCurrInstr++;
} }
@@ -6802,7 +6803,7 @@ static void Cmd_stockpiletobasedamage(void)
} }
else else
{ {
if (gBattleCommunication[6] != 1) if (gBattleCommunication[MISS_TYPE] != B_MSG_PROTECTED)
{ {
gBattleMoveDamage = CalculateBaseDamage(&gBattleMons[gBattlerAttacker], &gBattleMons[gBattlerTarget], gCurrentMove, gBattleMoveDamage = CalculateBaseDamage(&gBattleMons[gBattlerAttacker], &gBattleMons[gBattlerTarget], gCurrentMove,
gSideStatuses[GET_BATTLER_SIDE(gBattlerTarget)], 0, gSideStatuses[GET_BATTLER_SIDE(gBattlerTarget)], 0,
@@ -6826,14 +6827,14 @@ static void Cmd_stockpiletohpheal(void)
if (gDisableStructs[gBattlerAttacker].stockpileCounter == 0) if (gDisableStructs[gBattlerAttacker].stockpileCounter == 0)
{ {
gBattlescriptCurrInstr = jumpPtr; gBattlescriptCurrInstr = jumpPtr;
gBattleCommunication[MULTISTRING_CHOOSER] = 0; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SWALLOW_FAILED;
} }
else if (gBattleMons[gBattlerAttacker].maxHP == gBattleMons[gBattlerAttacker].hp) else if (gBattleMons[gBattlerAttacker].maxHP == gBattleMons[gBattlerAttacker].hp)
{ {
gDisableStructs[gBattlerAttacker].stockpileCounter = 0; gDisableStructs[gBattlerAttacker].stockpileCounter = 0;
gBattlescriptCurrInstr = jumpPtr; gBattlescriptCurrInstr = jumpPtr;
gBattlerTarget = gBattlerAttacker; gBattlerTarget = gBattlerAttacker;
gBattleCommunication[MULTISTRING_CHOOSER] = 1; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SWALLOW_FULL_HP;
} }
else else
{ {
@@ -6985,9 +6986,9 @@ static u8 ChangeStatBuffs(s8 statValue, u8 statId, u8 flags, const u8 *BS_ptr)
gBattleTextBuff2[index] = B_BUFF_EOS; gBattleTextBuff2[index] = B_BUFF_EOS;
if (gBattleMons[gActiveBattler].statStages[statId] == MIN_STAT_STAGE) if (gBattleMons[gActiveBattler].statStages[statId] == MIN_STAT_STAGE)
gBattleCommunication[MULTISTRING_CHOOSER] = 2; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_STAT_WONT_DECREASE;
else else
gBattleCommunication[MULTISTRING_CHOOSER] = (gBattlerTarget == gActiveBattler); gBattleCommunication[MULTISTRING_CHOOSER] = (gBattlerTarget == gActiveBattler); // B_MSG_ATTACKER_STAT_FELL or B_MSG_DEFENDER_STAT_FELL
} }
} }
@@ -7012,9 +7013,9 @@ static u8 ChangeStatBuffs(s8 statValue, u8 statId, u8 flags, const u8 *BS_ptr)
gBattleTextBuff2[index] = B_BUFF_EOS; gBattleTextBuff2[index] = B_BUFF_EOS;
if (gBattleMons[gActiveBattler].statStages[statId] == MAX_STAT_STAGE) if (gBattleMons[gActiveBattler].statStages[statId] == MAX_STAT_STAGE)
gBattleCommunication[MULTISTRING_CHOOSER] = 2; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_STAT_WONT_INCREASE;
else else
gBattleCommunication[MULTISTRING_CHOOSER] = (gBattlerTarget == gActiveBattler); gBattleCommunication[MULTISTRING_CHOOSER] = (gBattlerTarget == gActiveBattler); // B_MSG_ATTACKER_STAT_ROSE or B_MSG_DEFENDER_STAT_ROSE
} }
gBattleMons[gActiveBattler].statStages[statId] += statValue; gBattleMons[gActiveBattler].statStages[statId] += statValue;
@@ -7023,10 +7024,10 @@ static u8 ChangeStatBuffs(s8 statValue, u8 statId, u8 flags, const u8 *BS_ptr)
if (gBattleMons[gActiveBattler].statStages[statId] > MAX_STAT_STAGE) if (gBattleMons[gActiveBattler].statStages[statId] > MAX_STAT_STAGE)
gBattleMons[gActiveBattler].statStages[statId] = MAX_STAT_STAGE; gBattleMons[gActiveBattler].statStages[statId] = MAX_STAT_STAGE;
if (gBattleCommunication[MULTISTRING_CHOOSER] == 2 && flags & STAT_BUFF_ALLOW_PTR) if (gBattleCommunication[MULTISTRING_CHOOSER] == B_MSG_STAT_WONT_INCREASE && flags & STAT_BUFF_ALLOW_PTR)
gMoveResultFlags |= MOVE_RESULT_MISSED; gMoveResultFlags |= MOVE_RESULT_MISSED;
if (gBattleCommunication[MULTISTRING_CHOOSER] == 2 && !(flags & STAT_BUFF_ALLOW_PTR)) if (gBattleCommunication[MULTISTRING_CHOOSER] == B_MSG_STAT_WONT_INCREASE && !(flags & STAT_BUFF_ALLOW_PTR))
return STAT_BUFF_DIDNT_WORK; return STAT_BUFF_DIDNT_WORK;
return STAT_BUFF_WORKED; return STAT_BUFF_WORKED;
@@ -7314,7 +7315,7 @@ static void Cmd_tryconversiontypechange(void) // randomly changes user's type to
do do
{ {
while ((moveChecked = Random() & 3) >= validMoves); while ((moveChecked = Random() & (MAX_MON_MOVES - 1)) >= validMoves);
moveType = gBattleMoves[gBattleMons[gBattlerAttacker].moves[moveChecked]].type; moveType = gBattleMoves[gBattleMons[gBattlerAttacker].moves[moveChecked]].type;
@@ -7358,7 +7359,7 @@ static void Cmd_setlightscreen(void)
if (gSideStatuses[GET_BATTLER_SIDE(gBattlerAttacker)] & SIDE_STATUS_LIGHTSCREEN) if (gSideStatuses[GET_BATTLER_SIDE(gBattlerAttacker)] & SIDE_STATUS_LIGHTSCREEN)
{ {
gMoveResultFlags |= MOVE_RESULT_MISSED; gMoveResultFlags |= MOVE_RESULT_MISSED;
gBattleCommunication[MULTISTRING_CHOOSER] = 0; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SIDE_STATUS_FAILED;
} }
else else
{ {
@@ -7367,9 +7368,9 @@ static void Cmd_setlightscreen(void)
gSideTimers[GET_BATTLER_SIDE(gBattlerAttacker)].lightscreenBattlerId = gBattlerAttacker; gSideTimers[GET_BATTLER_SIDE(gBattlerAttacker)].lightscreenBattlerId = gBattlerAttacker;
if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE && CountAliveMonsInBattle(BATTLE_ALIVE_ATK_SIDE) == 2) if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE && CountAliveMonsInBattle(BATTLE_ALIVE_ATK_SIDE) == 2)
gBattleCommunication[MULTISTRING_CHOOSER] = 4; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SET_LIGHTSCREEN_DOUBLE;
else else
gBattleCommunication[MULTISTRING_CHOOSER] = 3; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SET_LIGHTSCREEN_SINGLE;
} }
gBattlescriptCurrInstr++; gBattlescriptCurrInstr++;
@@ -7453,9 +7454,9 @@ static void Cmd_tryKO(void)
{ {
gMoveResultFlags |= MOVE_RESULT_MISSED; gMoveResultFlags |= MOVE_RESULT_MISSED;
if (gBattleMons[gBattlerAttacker].level >= gBattleMons[gBattlerTarget].level) if (gBattleMons[gBattlerAttacker].level >= gBattleMons[gBattlerTarget].level)
gBattleCommunication[MULTISTRING_CHOOSER] = 0; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_KO_MISS;
else else
gBattleCommunication[MULTISTRING_CHOOSER] = 1; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_KO_UNAFFECTED;
gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1);
} }
} }
@@ -7475,12 +7476,12 @@ static void Cmd_setsandstorm(void)
if (gBattleWeather & WEATHER_SANDSTORM_ANY) if (gBattleWeather & WEATHER_SANDSTORM_ANY)
{ {
gMoveResultFlags |= MOVE_RESULT_MISSED; gMoveResultFlags |= MOVE_RESULT_MISSED;
gBattleCommunication[MULTISTRING_CHOOSER] = 2; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_WEATHER_FAILED;
} }
else else
{ {
gBattleWeather = WEATHER_SANDSTORM_TEMPORARY; gBattleWeather = WEATHER_SANDSTORM_TEMPORARY;
gBattleCommunication[MULTISTRING_CHOOSER] = 3; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_STARTED_SANDSTORM;
gWishFutureKnock.weatherDuration = 5; gWishFutureKnock.weatherDuration = 5;
} }
gBattlescriptCurrInstr++; gBattlescriptCurrInstr++;
@@ -7621,14 +7622,14 @@ static void Cmd_setmist(void)
if (gSideTimers[GET_BATTLER_SIDE(gBattlerAttacker)].mistTimer) if (gSideTimers[GET_BATTLER_SIDE(gBattlerAttacker)].mistTimer)
{ {
gMoveResultFlags |= MOVE_RESULT_FAILED; gMoveResultFlags |= MOVE_RESULT_FAILED;
gBattleCommunication[MULTISTRING_CHOOSER] = 1; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_MIST_FAILED;
} }
else else
{ {
gSideTimers[GET_BATTLER_SIDE(gBattlerAttacker)].mistTimer = 5; gSideTimers[GET_BATTLER_SIDE(gBattlerAttacker)].mistTimer = 5;
gSideTimers[GET_BATTLER_SIDE(gBattlerAttacker)].mistBattlerId = gBattlerAttacker; gSideTimers[GET_BATTLER_SIDE(gBattlerAttacker)].mistBattlerId = gBattlerAttacker;
gSideStatuses[GET_BATTLER_SIDE(gBattlerAttacker)] |= SIDE_STATUS_MIST; gSideStatuses[GET_BATTLER_SIDE(gBattlerAttacker)] |= SIDE_STATUS_MIST;
gBattleCommunication[MULTISTRING_CHOOSER] = 0; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SET_MIST;
} }
gBattlescriptCurrInstr++; gBattlescriptCurrInstr++;
} }
@@ -7638,12 +7639,12 @@ static void Cmd_setfocusenergy(void)
if (gBattleMons[gBattlerAttacker].status2 & STATUS2_FOCUS_ENERGY) if (gBattleMons[gBattlerAttacker].status2 & STATUS2_FOCUS_ENERGY)
{ {
gMoveResultFlags |= MOVE_RESULT_FAILED; gMoveResultFlags |= MOVE_RESULT_FAILED;
gBattleCommunication[MULTISTRING_CHOOSER] = 1; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_FOCUS_ENERGY_FAILED;
} }
else else
{ {
gBattleMons[gBattlerAttacker].status2 |= STATUS2_FOCUS_ENERGY; gBattleMons[gBattlerAttacker].status2 |= STATUS2_FOCUS_ENERGY;
gBattleCommunication[MULTISTRING_CHOOSER] = 0; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_GETTING_PUMPED;
} }
gBattlescriptCurrInstr++; gBattlescriptCurrInstr++;
} }
@@ -7656,7 +7657,7 @@ static void Cmd_transformdataexecution(void)
|| gStatuses3[gBattlerTarget] & STATUS3_SEMI_INVULNERABLE) || gStatuses3[gBattlerTarget] & STATUS3_SEMI_INVULNERABLE)
{ {
gMoveResultFlags |= MOVE_RESULT_FAILED; gMoveResultFlags |= MOVE_RESULT_FAILED;
gBattleCommunication[MULTISTRING_CHOOSER] = 1; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_TRANSFORM_FAILED;
} }
else else
{ {
@@ -7688,7 +7689,7 @@ static void Cmd_transformdataexecution(void)
gActiveBattler = gBattlerAttacker; gActiveBattler = gBattlerAttacker;
BtlController_EmitResetActionMoveSelection(0, RESET_MOVE_SELECTION); BtlController_EmitResetActionMoveSelection(0, RESET_MOVE_SELECTION);
MarkBattlerForControllerExec(gActiveBattler); MarkBattlerForControllerExec(gActiveBattler);
gBattleCommunication[MULTISTRING_CHOOSER] = 0; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_TRANSFORMED;
} }
} }
@@ -7701,7 +7702,7 @@ static void Cmd_setsubstitute(void)
if (gBattleMons[gBattlerAttacker].hp <= hp) if (gBattleMons[gBattlerAttacker].hp <= hp)
{ {
gBattleMoveDamage = 0; gBattleMoveDamage = 0;
gBattleCommunication[MULTISTRING_CHOOSER] = 1; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SUBSTITUTE_FAILED;
} }
else else
{ {
@@ -7712,7 +7713,7 @@ static void Cmd_setsubstitute(void)
gBattleMons[gBattlerAttacker].status2 |= STATUS2_SUBSTITUTE; gBattleMons[gBattlerAttacker].status2 |= STATUS2_SUBSTITUTE;
gBattleMons[gBattlerAttacker].status2 &= ~(STATUS2_WRAPPED); gBattleMons[gBattlerAttacker].status2 &= ~(STATUS2_WRAPPED);
gDisableStructs[gBattlerAttacker].substituteHP = gBattleMoveDamage; gDisableStructs[gBattlerAttacker].substituteHP = gBattleMoveDamage;
gBattleCommunication[MULTISTRING_CHOOSER] = 0; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SET_SUBSTITUTE;
gHitMarker |= HITMARKER_IGNORE_SUBSTITUTE; gHitMarker |= HITMARKER_IGNORE_SUBSTITUTE;
} }
@@ -8139,7 +8140,7 @@ static void Cmd_trychoosesleeptalkmove(void)
do do
{ {
movePosition = Random() & 3; movePosition = Random() & (MAX_MON_MOVES - 1);
} while ((gBitTable[movePosition] & unusableMovesBits)); } while ((gBitTable[movePosition] & unusableMovesBits));
gCalledMove = gBattleMons[gBattlerAttacker].moves[movePosition]; gCalledMove = gBattleMons[gBattlerAttacker].moves[movePosition];
@@ -8250,7 +8251,7 @@ static void Cmd_healpartystatus(void)
struct Pokemon *party; struct Pokemon *party;
s32 i; s32 i;
gBattleCommunication[MULTISTRING_CHOOSER] = 0; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_BELL;
if (GetBattlerSide(gBattlerAttacker) == B_SIDE_PLAYER) if (GetBattlerSide(gBattlerAttacker) == B_SIDE_PLAYER)
party = gPlayerParty; party = gPlayerParty;
@@ -8265,7 +8266,7 @@ static void Cmd_healpartystatus(void)
else else
{ {
RecordAbilityBattle(gBattlerAttacker, gBattleMons[gBattlerAttacker].ability); RecordAbilityBattle(gBattlerAttacker, gBattleMons[gBattlerAttacker].ability);
gBattleCommunication[MULTISTRING_CHOOSER] |= 1; gBattleCommunication[MULTISTRING_CHOOSER] |= B_MSG_BELL_SOUNDPROOF_ATTACKER;
} }
gActiveBattler = gBattleScripting.battler = GetBattlerAtPosition(GetBattlerPosition(gBattlerAttacker) ^ BIT_FLANK); gActiveBattler = gBattleScripting.battler = GetBattlerAtPosition(GetBattlerPosition(gBattlerAttacker) ^ BIT_FLANK);
@@ -8281,10 +8282,12 @@ static void Cmd_healpartystatus(void)
else else
{ {
RecordAbilityBattle(gActiveBattler, gBattleMons[gActiveBattler].ability); RecordAbilityBattle(gActiveBattler, gBattleMons[gActiveBattler].ability);
gBattleCommunication[MULTISTRING_CHOOSER] |= 2; gBattleCommunication[MULTISTRING_CHOOSER] |= B_MSG_BELL_SOUNDPROOF_PARTNER;
} }
} }
// Because the above MULTISTRING_CHOOSER are ORd, if both are set then it will be B_MSG_BELL_BOTH_SOUNDPROOF
for (i = 0; i < PARTY_SIZE; i++) for (i = 0; i < PARTY_SIZE; i++)
{ {
u16 species = GetMonData(&party[i], MON_DATA_SPECIES2); u16 species = GetMonData(&party[i], MON_DATA_SPECIES2);
@@ -8310,7 +8313,7 @@ static void Cmd_healpartystatus(void)
} }
else // Aromatherapy else // Aromatherapy
{ {
gBattleCommunication[MULTISTRING_CHOOSER] = 4; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SOOTHING_AROMA;
toHeal = 0x3F; toHeal = 0x3F;
gBattleMons[gBattlerAttacker].status1 = 0; gBattleMons[gBattlerAttacker].status1 = 0;
@@ -8514,14 +8517,14 @@ static void Cmd_setsafeguard(void)
if (gSideStatuses[GET_BATTLER_SIDE(gBattlerAttacker)] & SIDE_STATUS_SAFEGUARD) if (gSideStatuses[GET_BATTLER_SIDE(gBattlerAttacker)] & SIDE_STATUS_SAFEGUARD)
{ {
gMoveResultFlags |= MOVE_RESULT_MISSED; gMoveResultFlags |= MOVE_RESULT_MISSED;
gBattleCommunication[MULTISTRING_CHOOSER] = 0; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SIDE_STATUS_FAILED;
} }
else else
{ {
gSideStatuses[GET_BATTLER_SIDE(gBattlerAttacker)] |= SIDE_STATUS_SAFEGUARD; gSideStatuses[GET_BATTLER_SIDE(gBattlerAttacker)] |= SIDE_STATUS_SAFEGUARD;
gSideTimers[GET_BATTLER_SIDE(gBattlerAttacker)].safeguardTimer = 5; gSideTimers[GET_BATTLER_SIDE(gBattlerAttacker)].safeguardTimer = 5;
gSideTimers[GET_BATTLER_SIDE(gBattlerAttacker)].safeguardBattlerId = gBattlerAttacker; gSideTimers[GET_BATTLER_SIDE(gBattlerAttacker)].safeguardBattlerId = gBattlerAttacker;
gBattleCommunication[MULTISTRING_CHOOSER] = 5; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SET_SAFEGUARD;
} }
gBattlescriptCurrInstr++; gBattlescriptCurrInstr++;
@@ -8630,12 +8633,12 @@ static void Cmd_setsunny(void)
if (gBattleWeather & WEATHER_SUN_ANY) if (gBattleWeather & WEATHER_SUN_ANY)
{ {
gMoveResultFlags |= MOVE_RESULT_MISSED; gMoveResultFlags |= MOVE_RESULT_MISSED;
gBattleCommunication[MULTISTRING_CHOOSER] = 2; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_WEATHER_FAILED;
} }
else else
{ {
gBattleWeather = WEATHER_SUN_TEMPORARY; gBattleWeather = WEATHER_SUN_TEMPORARY;
gBattleCommunication[MULTISTRING_CHOOSER] = 4; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_STARTED_SUNLIGHT;
gWishFutureKnock.weatherDuration = 5; gWishFutureKnock.weatherDuration = 5;
} }
@@ -8806,9 +8809,9 @@ static void Cmd_trysetfutureattack(void)
gWishFutureKnock.futureSightDmg[gBattlerTarget] = gWishFutureKnock.futureSightDmg[gBattlerTarget] * 15 / 10; gWishFutureKnock.futureSightDmg[gBattlerTarget] = gWishFutureKnock.futureSightDmg[gBattlerTarget] * 15 / 10;
if (gCurrentMove == MOVE_DOOM_DESIRE) if (gCurrentMove == MOVE_DOOM_DESIRE)
gBattleCommunication[MULTISTRING_CHOOSER] = 1; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_DOOM_DESIRE;
else else
gBattleCommunication[MULTISTRING_CHOOSER] = 0; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_FUTURE_SIGHT;
gBattlescriptCurrInstr += 5; gBattlescriptCurrInstr += 5;
} }
@@ -8912,12 +8915,12 @@ static void Cmd_sethail(void)
if (gBattleWeather & WEATHER_HAIL_ANY) if (gBattleWeather & WEATHER_HAIL_ANY)
{ {
gMoveResultFlags |= MOVE_RESULT_MISSED; gMoveResultFlags |= MOVE_RESULT_MISSED;
gBattleCommunication[MULTISTRING_CHOOSER] = 2; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_WEATHER_FAILED;
} }
else else
{ {
gBattleWeather = WEATHER_HAIL; gBattleWeather = WEATHER_HAIL;
gBattleCommunication[MULTISTRING_CHOOSER] = 5; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_STARTED_HAIL;
gWishFutureKnock.weatherDuration = 5; gWishFutureKnock.weatherDuration = 5;
} }
@@ -8928,7 +8931,7 @@ static void Cmd_jumpifattackandspecialattackcannotfall(void) // memento
{ {
if (gBattleMons[gBattlerTarget].statStages[STAT_ATK] == MIN_STAT_STAGE if (gBattleMons[gBattlerTarget].statStages[STAT_ATK] == MIN_STAT_STAGE
&& gBattleMons[gBattlerTarget].statStages[STAT_SPATK] == MIN_STAT_STAGE && gBattleMons[gBattlerTarget].statStages[STAT_SPATK] == MIN_STAT_STAGE
&& gBattleCommunication[6] != 1) && gBattleCommunication[MISS_TYPE] != B_MSG_PROTECTED)
{ {
gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1);
} }
@@ -9113,11 +9116,11 @@ static void Cmd_tryswapitems(void) // trick
PREPARE_ITEM_BUFFER(gBattleTextBuff2, oldItemAtk) PREPARE_ITEM_BUFFER(gBattleTextBuff2, oldItemAtk)
if (oldItemAtk != 0 && *newItemAtk != 0) if (oldItemAtk != 0 && *newItemAtk != 0)
gBattleCommunication[MULTISTRING_CHOOSER] = 2; // attacker's item -> <- target's item gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_ITEM_SWAP_BOTH; // attacker's item -> <- target's item
else if (oldItemAtk == 0 && *newItemAtk != 0) else if (oldItemAtk == 0 && *newItemAtk != 0)
gBattleCommunication[MULTISTRING_CHOOSER] = 0; // nothing -> <- target's item gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_ITEM_SWAP_TAKEN; // nothing -> <- target's item
else else
gBattleCommunication[MULTISTRING_CHOOSER] = 1; // attacker's item -> <- nothing gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_ITEM_SWAP_GIVEN; // attacker's item -> <- nothing
} }
} }
} }
@@ -9605,7 +9608,7 @@ static void Cmd_settypebasedhalvers(void) // water and mud sport
if (!(gStatuses3[gBattlerAttacker] & STATUS3_MUDSPORT)) if (!(gStatuses3[gBattlerAttacker] & STATUS3_MUDSPORT))
{ {
gStatuses3[gBattlerAttacker] |= STATUS3_MUDSPORT; gStatuses3[gBattlerAttacker] |= STATUS3_MUDSPORT;
gBattleCommunication[MULTISTRING_CHOOSER] = 0; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_WEAKEN_ELECTRIC;
worked = TRUE; worked = TRUE;
} }
} }
@@ -9614,7 +9617,7 @@ static void Cmd_settypebasedhalvers(void) // water and mud sport
if (!(gStatuses3[gBattlerAttacker] & STATUS3_WATERSPORT)) if (!(gStatuses3[gBattlerAttacker] & STATUS3_WATERSPORT))
{ {
gStatuses3[gBattlerAttacker] |= STATUS3_WATERSPORT; gStatuses3[gBattlerAttacker] |= STATUS3_WATERSPORT;
gBattleCommunication[MULTISTRING_CHOOSER] = 1; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_WEAKEN_FIRE;
worked = TRUE; worked = TRUE;
} }
} }
@@ -9883,7 +9886,6 @@ static void Cmd_handleballthrow(void)
else // not caught else // not caught
{ {
gBattleCommunication[MULTISTRING_CHOOSER] = shakes; gBattleCommunication[MULTISTRING_CHOOSER] = shakes;
// Maybe inject SpriteCB_TestBallThrow here
gBattlescriptCurrInstr = BattleScript_ShakeBallThrow; gBattlescriptCurrInstr = BattleScript_ShakeBallThrow;
} }
} }
@@ -9896,7 +9898,7 @@ static void Cmd_givecaughtmon(void)
{ {
if (!ShouldShowBoxWasFullMessage()) if (!ShouldShowBoxWasFullMessage())
{ {
gBattleCommunication[MULTISTRING_CHOOSER] = 0; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SENT_SOMEONES_PC;
StringCopy(gStringVar1, GetBoxNamePtr(VarGet(VAR_PC_BOX_TO_SEND_MON))); StringCopy(gStringVar1, GetBoxNamePtr(VarGet(VAR_PC_BOX_TO_SEND_MON)));
GetMonData(&gEnemyParty[gBattlerPartyIndexes[gBattlerAttacker ^ BIT_SIDE]], MON_DATA_NICKNAME, gStringVar2); GetMonData(&gEnemyParty[gBattlerPartyIndexes[gBattlerAttacker ^ BIT_SIDE]], MON_DATA_NICKNAME, gStringVar2);
} }
@@ -9905,9 +9907,10 @@ static void Cmd_givecaughtmon(void)
StringCopy(gStringVar1, GetBoxNamePtr(VarGet(VAR_PC_BOX_TO_SEND_MON))); // box the mon was sent to StringCopy(gStringVar1, GetBoxNamePtr(VarGet(VAR_PC_BOX_TO_SEND_MON))); // box the mon was sent to
GetMonData(&gEnemyParty[gBattlerPartyIndexes[gBattlerAttacker ^ BIT_SIDE]], MON_DATA_NICKNAME, gStringVar2); GetMonData(&gEnemyParty[gBattlerPartyIndexes[gBattlerAttacker ^ BIT_SIDE]], MON_DATA_NICKNAME, gStringVar2);
StringCopy(gStringVar3, GetBoxNamePtr(GetPCBoxToSendMon())); //box the mon was going to be sent to StringCopy(gStringVar3, GetBoxNamePtr(GetPCBoxToSendMon())); //box the mon was going to be sent to
gBattleCommunication[MULTISTRING_CHOOSER] = 2; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SOMEONES_BOX_FULL;
} }
// Change to B_MSG_SENT_LANETTES_PC or B_MSG_LANETTES_BOX_FULL
if (FlagGet(FLAG_SYS_PC_LANETTE)) if (FlagGet(FLAG_SYS_PC_LANETTE))
gBattleCommunication[MULTISTRING_CHOOSER]++; gBattleCommunication[MULTISTRING_CHOOSER]++;
} }
+4 -4
View File
@@ -666,7 +666,7 @@ void BattleTv_SetDataBasedOnString(u16 stringId)
case STRINGID_CRITICALHIT: case STRINGID_CRITICALHIT:
AddMovePoints(PTS_CRITICAL_HIT, moveSlot, 0, 0); AddMovePoints(PTS_CRITICAL_HIT, moveSlot, 0, 0);
break; break;
case STRINGID_PKMNSSTATCHANGED: case STRINGID_ATTACKERSSTATROSE:
if (gBattleTextBuff1[2] != 0) if (gBattleTextBuff1[2] != 0)
{ {
if (*statStringId == STRINGID_STATSHARPLY) if (*statStringId == STRINGID_STATSHARPLY)
@@ -675,7 +675,7 @@ void BattleTv_SetDataBasedOnString(u16 stringId)
AddMovePoints(PTS_STAT_INCREASE_1, moveSlot, gBattleTextBuff1[2] - 1, 0); AddMovePoints(PTS_STAT_INCREASE_1, moveSlot, gBattleTextBuff1[2] - 1, 0);
} }
break; break;
case STRINGID_PKMNSSTATCHANGED2: case STRINGID_DEFENDERSSTATROSE:
if (gBattleTextBuff1[2] != 0) if (gBattleTextBuff1[2] != 0)
{ {
if (gBattlerAttacker == gBattlerTarget) if (gBattlerAttacker == gBattlerTarget)
@@ -691,11 +691,11 @@ void BattleTv_SetDataBasedOnString(u16 stringId)
} }
} }
break; break;
case STRINGID_PKMNSSTATCHANGED3: case STRINGID_ATTACKERSSTATFELL:
if (gBattleTextBuff1[2] != 0) if (gBattleTextBuff1[2] != 0)
AddMovePoints(PTS_STAT_DECREASE_SELF, moveSlot, gBattleTextBuff1[2] - 1, 0); AddMovePoints(PTS_STAT_DECREASE_SELF, moveSlot, gBattleTextBuff1[2] - 1, 0);
break; break;
case STRINGID_PKMNSSTATCHANGED4: case STRINGID_DEFENDERSSTATFELL:
if (gBattleTextBuff1[2] != 0) if (gBattleTextBuff1[2] != 0)
{ {
if (*statStringId == STRINGID_STATHARSHLY) if (*statStringId == STRINGID_STATHARSHLY)
+93 -54
View File
@@ -49,7 +49,29 @@ extern const u8 *const gBattlescriptsForRunningByItem[];
extern const u8 *const gBattlescriptsForUsingItem[]; extern const u8 *const gBattlescriptsForUsingItem[];
extern const u8 *const gBattlescriptsForSafariActions[]; extern const u8 *const gBattlescriptsForSafariActions[];
static const u8 sPkblToEscapeFactor[][3] = {{0, 0, 0}, {3, 5, 0}, {2, 3, 0}, {1, 2, 0}, {1, 1, 0}}; static const u8 sPkblToEscapeFactor[][3] = {
{
[B_MSG_MON_CURIOUS] = 0,
[B_MSG_MON_ENTHRALLED] = 0,
[B_MSG_MON_IGNORED] = 0
},{
[B_MSG_MON_CURIOUS] = 3,
[B_MSG_MON_ENTHRALLED] = 5,
[B_MSG_MON_IGNORED] = 0
},{
[B_MSG_MON_CURIOUS] = 2,
[B_MSG_MON_ENTHRALLED] = 3,
[B_MSG_MON_IGNORED] = 0
},{
[B_MSG_MON_CURIOUS] = 1,
[B_MSG_MON_ENTHRALLED] = 2,
[B_MSG_MON_IGNORED] = 0
},{
[B_MSG_MON_CURIOUS] = 1,
[B_MSG_MON_ENTHRALLED] = 1,
[B_MSG_MON_IGNORED] = 0
}
};
static const u8 sGoNearCounterToCatchFactor[] = {4, 3, 2, 1}; static const u8 sGoNearCounterToCatchFactor[] = {4, 3, 2, 1};
static const u8 sGoNearCounterToEscapeFactor[] = {4, 4, 4, 4}; static const u8 sGoNearCounterToEscapeFactor[] = {4, 4, 4, 4};
@@ -238,10 +260,9 @@ void HandleAction_UseMove(void)
} }
} }
// choose battlescript if (gBattleTypeFlags & BATTLE_TYPE_PALACE && gProtectStructs[gBattlerAttacker].palaceUnableToUseMove)
if (gBattleTypeFlags & BATTLE_TYPE_PALACE
&& gProtectStructs[gBattlerAttacker].palaceUnableToUseMove)
{ {
// Battle Palace, select battle script for failure to use move
if (gBattleMons[gBattlerAttacker].hp == 0) if (gBattleMons[gBattlerAttacker].hp == 0)
{ {
gCurrentActionFuncId = B_ACTION_FINISHED; gCurrentActionFuncId = B_ACTION_FINISHED;
@@ -249,13 +270,13 @@ void HandleAction_UseMove(void)
} }
else if (gPalaceSelectionBattleScripts[gBattlerAttacker] != NULL) else if (gPalaceSelectionBattleScripts[gBattlerAttacker] != NULL)
{ {
gBattleCommunication[MULTISTRING_CHOOSER] = 4; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_INCAPABLE_OF_POWER;
gBattlescriptCurrInstr = gPalaceSelectionBattleScripts[gBattlerAttacker]; gBattlescriptCurrInstr = gPalaceSelectionBattleScripts[gBattlerAttacker];
gPalaceSelectionBattleScripts[gBattlerAttacker] = NULL; gPalaceSelectionBattleScripts[gBattlerAttacker] = NULL;
} }
else else
{ {
gBattleCommunication[MULTISTRING_CHOOSER] = 4; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_INCAPABLE_OF_POWER;
gBattlescriptCurrInstr = BattleScript_MoveUsedLoafingAround; gBattlescriptCurrInstr = BattleScript_MoveUsedLoafingAround;
} }
} }
@@ -318,26 +339,29 @@ void HandleAction_UseItem(void)
case AI_ITEM_HEAL_HP: case AI_ITEM_HEAL_HP:
break; break;
case AI_ITEM_CURE_CONDITION: case AI_ITEM_CURE_CONDITION:
gBattleCommunication[MULTISTRING_CHOOSER] = 0; gBattleCommunication[MULTISTRING_CHOOSER] = AI_HEAL_CONFUSION;
if (*(gBattleStruct->AI_itemFlags + gBattlerAttacker / 2) & 1) if (*(gBattleStruct->AI_itemFlags + gBattlerAttacker / 2) & (1 << AI_HEAL_CONFUSION))
{ {
if (*(gBattleStruct->AI_itemFlags + gBattlerAttacker / 2) & 0x3E) if (*(gBattleStruct->AI_itemFlags + gBattlerAttacker / 2) & 0x3E)
gBattleCommunication[MULTISTRING_CHOOSER] = 5; gBattleCommunication[MULTISTRING_CHOOSER] = AI_HEAL_SLEEP;
} }
else else
{ {
// Check for other statuses, stopping at first (shouldn't be more than one)
while (!(*(gBattleStruct->AI_itemFlags + gBattlerAttacker / 2) & 1)) while (!(*(gBattleStruct->AI_itemFlags + gBattlerAttacker / 2) & 1))
{ {
*(gBattleStruct->AI_itemFlags + gBattlerAttacker / 2) >>= 1; *(gBattleStruct->AI_itemFlags + gBattlerAttacker / 2) >>= 1;
gBattleCommunication[MULTISTRING_CHOOSER]++; gBattleCommunication[MULTISTRING_CHOOSER]++;
// MULTISTRING_CHOOSER will be either AI_HEAL_PARALYSIS, AI_HEAL_FREEZE,
// AI_HEAL_BURN, AI_HEAL_POISON, or AI_HEAL_SLEEP
} }
} }
break; break;
case AI_ITEM_X_STAT: case AI_ITEM_X_STAT:
gBattleCommunication[MULTISTRING_CHOOSER] = 4; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_STAT_ROSE_ITEM;
if (*(gBattleStruct->AI_itemFlags + (gBattlerAttacker >> 1)) & 0x80) if (*(gBattleStruct->AI_itemFlags + (gBattlerAttacker >> 1)) & (1 << AI_DIRE_HIT))
{ {
gBattleCommunication[MULTISTRING_CHOOSER] = 5; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_USED_DIRE_HIT;
} }
else else
{ {
@@ -354,11 +378,20 @@ void HandleAction_UseItem(void)
gBattleScripting.animArg2 = 0; gBattleScripting.animArg2 = 0;
} }
break; break;
case AI_ITEM_GUARD_SPECS: case AI_ITEM_GUARD_SPEC:
// It seems probable that at some point there was a special message for
// an AI trainer using Guard Spec in a double battle.
// There isn't now however, and the assignment to 2 below goes out of
// bounds for gMistUsedStringIds and instead prints "{mon} is getting pumped"
// from the next table, gFocusEnergyUsedStringIds.
// In any case this isn't an issue in the retail version, as no trainers
// are ever given any Guard Spec to use.
#ifndef UBFIX
if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE) if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE)
gBattleCommunication[MULTISTRING_CHOOSER] = 2; gBattleCommunication[MULTISTRING_CHOOSER] = 2;
else else
gBattleCommunication[MULTISTRING_CHOOSER] = 0; #endif
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SET_MIST;
break; break;
} }
@@ -479,7 +512,7 @@ void HandleAction_Run(void)
if (!TryRunFromBattle(gBattlerAttacker)) // failed to run away if (!TryRunFromBattle(gBattlerAttacker)) // failed to run away
{ {
ClearFuryCutterDestinyBondGrudge(gBattlerAttacker); ClearFuryCutterDestinyBondGrudge(gBattlerAttacker);
gBattleCommunication[MULTISTRING_CHOOSER] = 3; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_CANT_ESCAPE_2;
gBattlescriptCurrInstr = BattleScript_PrintFailedToRunString; gBattlescriptCurrInstr = BattleScript_PrintFailedToRunString;
gCurrentActionFuncId = B_ACTION_EXEC_SCRIPT; gCurrentActionFuncId = B_ACTION_EXEC_SCRIPT;
} }
@@ -488,7 +521,7 @@ void HandleAction_Run(void)
{ {
if (gBattleMons[gBattlerAttacker].status2 & (STATUS2_WRAPPED | STATUS2_ESCAPE_PREVENTION)) if (gBattleMons[gBattlerAttacker].status2 & (STATUS2_WRAPPED | STATUS2_ESCAPE_PREVENTION))
{ {
gBattleCommunication[MULTISTRING_CHOOSER] = 4; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_ATTACKER_CANT_ESCAPE;
gBattlescriptCurrInstr = BattleScript_PrintFailedToRunString; gBattlescriptCurrInstr = BattleScript_PrintFailedToRunString;
gCurrentActionFuncId = B_ACTION_EXEC_SCRIPT; gCurrentActionFuncId = B_ACTION_EXEC_SCRIPT;
} }
@@ -567,11 +600,11 @@ void HandleAction_GoNear(void)
if (gBattleStruct->safariGoNearCounter < 3) if (gBattleStruct->safariGoNearCounter < 3)
{ {
gBattleStruct->safariGoNearCounter++; gBattleStruct->safariGoNearCounter++;
gBattleCommunication[MULTISTRING_CHOOSER] = 0; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_CREPT_CLOSER;
} }
else else
{ {
gBattleCommunication[MULTISTRING_CHOOSER] = 1; // Can't get closer. gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_CANT_GET_CLOSER;
} }
gBattlescriptCurrInstr = gBattlescriptsForSafariActions[1]; gBattlescriptCurrInstr = gBattlescriptsForSafariActions[1];
gCurrentActionFuncId = B_ACTION_EXEC_SCRIPT; gCurrentActionFuncId = B_ACTION_EXEC_SCRIPT;
@@ -1295,20 +1328,20 @@ u8 DoFieldEndTurnEffects(void)
{ {
gBattleWeather &= ~WEATHER_RAIN_TEMPORARY; gBattleWeather &= ~WEATHER_RAIN_TEMPORARY;
gBattleWeather &= ~WEATHER_RAIN_DOWNPOUR; gBattleWeather &= ~WEATHER_RAIN_DOWNPOUR;
gBattleCommunication[MULTISTRING_CHOOSER] = 2; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_RAIN_STOPPED;
} }
else if (gBattleWeather & WEATHER_RAIN_DOWNPOUR) else if (gBattleWeather & WEATHER_RAIN_DOWNPOUR)
gBattleCommunication[MULTISTRING_CHOOSER] = 1; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_DOWNPOUR_CONTINUES;
else else
gBattleCommunication[MULTISTRING_CHOOSER] = 0; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_RAIN_CONTINUES;
} }
else if (gBattleWeather & WEATHER_RAIN_DOWNPOUR) else if (gBattleWeather & WEATHER_RAIN_DOWNPOUR)
{ {
gBattleCommunication[MULTISTRING_CHOOSER] = 1; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_DOWNPOUR_CONTINUES;
} }
else else
{ {
gBattleCommunication[MULTISTRING_CHOOSER] = 0; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_RAIN_CONTINUES;
} }
BattleScriptExecute(BattleScript_RainContinuesOrEnds); BattleScriptExecute(BattleScript_RainContinuesOrEnds);
@@ -1330,7 +1363,7 @@ u8 DoFieldEndTurnEffects(void)
} }
gBattleScripting.animArg1 = B_ANIM_SANDSTORM_CONTINUES; gBattleScripting.animArg1 = B_ANIM_SANDSTORM_CONTINUES;
gBattleCommunication[MULTISTRING_CHOOSER] = 0; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SANDSTORM;
BattleScriptExecute(gBattlescriptCurrInstr); BattleScriptExecute(gBattlescriptCurrInstr);
effect++; effect++;
} }
@@ -1368,7 +1401,7 @@ u8 DoFieldEndTurnEffects(void)
} }
gBattleScripting.animArg1 = B_ANIM_HAIL_CONTINUES; gBattleScripting.animArg1 = B_ANIM_HAIL_CONTINUES;
gBattleCommunication[MULTISTRING_CHOOSER] = 1; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_HAIL;
BattleScriptExecute(gBattlescriptCurrInstr); BattleScriptExecute(gBattlescriptCurrInstr);
effect++; effect++;
} }
@@ -1597,16 +1630,16 @@ u8 DoBattlerEndTurnEffects(void)
if (WasUnableToUseMove(gActiveBattler)) if (WasUnableToUseMove(gActiveBattler))
{ {
CancelMultiTurnMoves(gActiveBattler); CancelMultiTurnMoves(gActiveBattler);
gBattleCommunication[MULTISTRING_CHOOSER] = 1; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_UPROAR_ENDS;
} }
else if (gBattleMons[gActiveBattler].status2 & STATUS2_UPROAR) else if (gBattleMons[gActiveBattler].status2 & STATUS2_UPROAR)
{ {
gBattleCommunication[MULTISTRING_CHOOSER] = 0; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_UPROAR_CONTINUES;
gBattleMons[gActiveBattler].status2 |= STATUS2_MULTIPLETURNS; gBattleMons[gActiveBattler].status2 |= STATUS2_MULTIPLETURNS;
} }
else else
{ {
gBattleCommunication[MULTISTRING_CHOOSER] = 1; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_UPROAR_ENDS;
CancelMultiTurnMoves(gActiveBattler); CancelMultiTurnMoves(gActiveBattler);
} }
BattleScriptExecute(BattleScript_PrintUproarOverTurns); BattleScriptExecute(BattleScript_PrintUproarOverTurns);
@@ -1749,9 +1782,9 @@ bool8 HandleWishPerishSongOnTurnEnd(void)
&& gBattleMons[gActiveBattler].hp != 0) && gBattleMons[gActiveBattler].hp != 0)
{ {
if (gWishFutureKnock.futureSightMove[gActiveBattler] == MOVE_FUTURE_SIGHT) if (gWishFutureKnock.futureSightMove[gActiveBattler] == MOVE_FUTURE_SIGHT)
gBattleCommunication[MULTISTRING_CHOOSER] = 0; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_FUTURE_SIGHT;
else else
gBattleCommunication[MULTISTRING_CHOOSER] = 1; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_DOOM_DESIRE;
PREPARE_MOVE_BUFFER(gBattleTextBuff1, gWishFutureKnock.futureSightMove[gActiveBattler]); PREPARE_MOVE_BUFFER(gBattleTextBuff1, gWishFutureKnock.futureSightMove[gActiveBattler]);
@@ -1850,7 +1883,7 @@ bool8 HandleFaintedMonActions(void)
gBattleStruct->faintedActionsState++; gBattleStruct->faintedActionsState++;
for (i = 0; i < gBattlersCount; i++) for (i = 0; i < gBattlersCount; i++)
{ {
if (gAbsentBattlerFlags & gBitTable[i] && !HasNoMonsToSwitch(i, 6, 6)) if (gAbsentBattlerFlags & gBitTable[i] && !HasNoMonsToSwitch(i, PARTY_SIZE, PARTY_SIZE))
gAbsentBattlerFlags &= ~(gBitTable[i]); gAbsentBattlerFlags &= ~(gBitTable[i]);
} }
// fall through // fall through
@@ -1962,7 +1995,7 @@ u8 AtkCanceller_UnableToUseMove(void)
gBattleMons[gBattlerAttacker].status1 &= ~(STATUS1_SLEEP); gBattleMons[gBattlerAttacker].status1 &= ~(STATUS1_SLEEP);
gBattleMons[gBattlerAttacker].status2 &= ~(STATUS2_NIGHTMARE); gBattleMons[gBattlerAttacker].status2 &= ~(STATUS2_NIGHTMARE);
BattleScriptPushCursor(); BattleScriptPushCursor();
gBattleCommunication[MULTISTRING_CHOOSER] = 1; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_WOKE_UP_UPROAR;
gBattlescriptCurrInstr = BattleScript_MoveUsedWokeUp; gBattlescriptCurrInstr = BattleScript_MoveUsedWokeUp;
effect = 2; effect = 2;
} }
@@ -1990,7 +2023,7 @@ u8 AtkCanceller_UnableToUseMove(void)
{ {
gBattleMons[gBattlerAttacker].status2 &= ~(STATUS2_NIGHTMARE); gBattleMons[gBattlerAttacker].status2 &= ~(STATUS2_NIGHTMARE);
BattleScriptPushCursor(); BattleScriptPushCursor();
gBattleCommunication[MULTISTRING_CHOOSER] = 0; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_WOKE_UP;
gBattlescriptCurrInstr = BattleScript_MoveUsedWokeUp; gBattlescriptCurrInstr = BattleScript_MoveUsedWokeUp;
effect = 2; effect = 2;
} }
@@ -2019,7 +2052,7 @@ u8 AtkCanceller_UnableToUseMove(void)
gBattleMons[gBattlerAttacker].status1 &= ~(STATUS1_FREEZE); gBattleMons[gBattlerAttacker].status1 &= ~(STATUS1_FREEZE);
BattleScriptPushCursor(); BattleScriptPushCursor();
gBattlescriptCurrInstr = BattleScript_MoveUsedUnfroze; gBattlescriptCurrInstr = BattleScript_MoveUsedUnfroze;
gBattleCommunication[MULTISTRING_CHOOSER] = 0; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_DEFROSTED;
} }
effect = 2; effect = 2;
} }
@@ -2030,7 +2063,7 @@ u8 AtkCanceller_UnableToUseMove(void)
{ {
CancelMultiTurnMoves(gBattlerAttacker); CancelMultiTurnMoves(gBattlerAttacker);
gHitMarker |= HITMARKER_UNABLE_TO_USE_MOVE; gHitMarker |= HITMARKER_UNABLE_TO_USE_MOVE;
gBattleCommunication[MULTISTRING_CHOOSER] = 0; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_LOAFING;
gBattlescriptCurrInstr = BattleScript_MoveUsedLoafingAround; gBattlescriptCurrInstr = BattleScript_MoveUsedLoafingAround;
gMoveResultFlags |= MOVE_RESULT_MISSED; gMoveResultFlags |= MOVE_RESULT_MISSED;
effect = 1; effect = 1;
@@ -2103,12 +2136,14 @@ u8 AtkCanceller_UnableToUseMove(void)
{ {
if (Random() & 1) if (Random() & 1)
{ {
gBattleCommunication[MULTISTRING_CHOOSER] = 0; // The MULTISTRING_CHOOSER is used here as a bool to signal
// to BattleScript_MoveUsedIsConfused whether or not damage was taken
gBattleCommunication[MULTISTRING_CHOOSER] = FALSE;
BattleScriptPushCursor(); BattleScriptPushCursor();
} }
else // confusion dmg else // confusion dmg
{ {
gBattleCommunication[MULTISTRING_CHOOSER] = 1; gBattleCommunication[MULTISTRING_CHOOSER] = TRUE;
gBattlerTarget = gBattlerAttacker; gBattlerTarget = gBattlerAttacker;
gBattleMoveDamage = CalculateBaseDamage(&gBattleMons[gBattlerAttacker], &gBattleMons[gBattlerAttacker], MOVE_POUND, 0, 40, 0, gBattlerAttacker, gBattlerAttacker); gBattleMoveDamage = CalculateBaseDamage(&gBattleMons[gBattlerAttacker], &gBattleMons[gBattlerAttacker], MOVE_POUND, 0, 40, 0, gBattlerAttacker, gBattlerAttacker);
gProtectStructs[gBattlerAttacker].confusionSelfDmg = 1; gProtectStructs[gBattlerAttacker].confusionSelfDmg = 1;
@@ -2195,7 +2230,7 @@ u8 AtkCanceller_UnableToUseMove(void)
gBattleMons[gBattlerAttacker].status1 &= ~(STATUS1_FREEZE); gBattleMons[gBattlerAttacker].status1 &= ~(STATUS1_FREEZE);
BattleScriptPushCursor(); BattleScriptPushCursor();
gBattlescriptCurrInstr = BattleScript_MoveUsedUnfroze; gBattlescriptCurrInstr = BattleScript_MoveUsedUnfroze;
gBattleCommunication[MULTISTRING_CHOOSER] = 1; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_DEFROSTED_BY_MOVE;
} }
effect = 2; effect = 2;
} }
@@ -2593,7 +2628,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u8 ability, u8 special, u16 moveA
if (gBattleMons[battler].statStages[STAT_SPEED] < MAX_STAT_STAGE && gDisableStructs[battler].isFirstTurn != 2) if (gBattleMons[battler].statStages[STAT_SPEED] < MAX_STAT_STAGE && gDisableStructs[battler].isFirstTurn != 2)
{ {
gBattleMons[battler].statStages[STAT_SPEED]++; gBattleMons[battler].statStages[STAT_SPEED]++;
gBattleScripting.animArg1 = 0x11; gBattleScripting.animArg1 = 14 + STAT_SPEED;
gBattleScripting.animArg2 = 0; gBattleScripting.animArg2 = 0;
BattleScriptPushCursorAndCallback(BattleScript_SpeedBoostActivates); BattleScriptPushCursorAndCallback(BattleScript_SpeedBoostActivates);
gBattleScripting.battler = battler; gBattleScripting.battler = battler;
@@ -2655,7 +2690,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u8 ability, u8 special, u16 moveA
{ {
if (!(gBattleResources->flags->flags[battler] & RESOURCE_FLAG_FLASH_FIRE)) if (!(gBattleResources->flags->flags[battler] & RESOURCE_FLAG_FLASH_FIRE))
{ {
gBattleCommunication[MULTISTRING_CHOOSER] = 0; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_FLASH_FIRE_BOOST;
if (gProtectStructs[gBattlerAttacker].notFirstStrike) if (gProtectStructs[gBattlerAttacker].notFirstStrike)
gBattlescriptCurrInstr = BattleScript_FlashFireBoost; gBattlescriptCurrInstr = BattleScript_FlashFireBoost;
else else
@@ -2666,7 +2701,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u8 ability, u8 special, u16 moveA
} }
else else
{ {
gBattleCommunication[MULTISTRING_CHOOSER] = 1; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_FLASH_FIRE_NO_BOOST;
if (gProtectStructs[gBattlerAttacker].notFirstStrike) if (gProtectStructs[gBattlerAttacker].notFirstStrike)
gBattlescriptCurrInstr = BattleScript_FlashFireBoost; gBattlescriptCurrInstr = BattleScript_FlashFireBoost;
else else
@@ -3431,7 +3466,7 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn)
gEffectBattler = battlerId; gEffectBattler = battlerId;
SET_STATCHANGER(STAT_ATK, 1, FALSE); SET_STATCHANGER(STAT_ATK, 1, FALSE);
gBattleScripting.animArg1 = 0xE + STAT_ATK; gBattleScripting.animArg1 = 14 + STAT_ATK;
gBattleScripting.animArg2 = 0; gBattleScripting.animArg2 = 0;
BattleScriptExecute(BattleScript_BerryStatRaiseEnd2); BattleScriptExecute(BattleScript_BerryStatRaiseEnd2);
effect = ITEM_STATS_CHANGE; effect = ITEM_STATS_CHANGE;
@@ -3445,7 +3480,7 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn)
gEffectBattler = battlerId; gEffectBattler = battlerId;
SET_STATCHANGER(STAT_DEF, 1, FALSE); SET_STATCHANGER(STAT_DEF, 1, FALSE);
gBattleScripting.animArg1 = 0xE + STAT_DEF; gBattleScripting.animArg1 = 14 + STAT_DEF;
gBattleScripting.animArg2 = 0; gBattleScripting.animArg2 = 0;
BattleScriptExecute(BattleScript_BerryStatRaiseEnd2); BattleScriptExecute(BattleScript_BerryStatRaiseEnd2);
effect = ITEM_STATS_CHANGE; effect = ITEM_STATS_CHANGE;
@@ -3459,7 +3494,7 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn)
gEffectBattler = battlerId; gEffectBattler = battlerId;
SET_STATCHANGER(STAT_SPEED, 1, FALSE); SET_STATCHANGER(STAT_SPEED, 1, FALSE);
gBattleScripting.animArg1 = 0xE + STAT_SPEED; gBattleScripting.animArg1 = 14 + STAT_SPEED;
gBattleScripting.animArg2 = 0; gBattleScripting.animArg2 = 0;
BattleScriptExecute(BattleScript_BerryStatRaiseEnd2); BattleScriptExecute(BattleScript_BerryStatRaiseEnd2);
effect = ITEM_STATS_CHANGE; effect = ITEM_STATS_CHANGE;
@@ -3473,7 +3508,7 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn)
gEffectBattler = battlerId; gEffectBattler = battlerId;
SET_STATCHANGER(STAT_SPATK, 1, FALSE); SET_STATCHANGER(STAT_SPATK, 1, FALSE);
gBattleScripting.animArg1 = 0xE + STAT_SPATK; gBattleScripting.animArg1 = 14 + STAT_SPATK;
gBattleScripting.animArg2 = 0; gBattleScripting.animArg2 = 0;
BattleScriptExecute(BattleScript_BerryStatRaiseEnd2); BattleScriptExecute(BattleScript_BerryStatRaiseEnd2);
effect = ITEM_STATS_CHANGE; effect = ITEM_STATS_CHANGE;
@@ -3487,7 +3522,7 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn)
gEffectBattler = battlerId; gEffectBattler = battlerId;
SET_STATCHANGER(STAT_SPDEF, 1, FALSE); SET_STATCHANGER(STAT_SPDEF, 1, FALSE);
gBattleScripting.animArg1 = 0xE + STAT_SPDEF; gBattleScripting.animArg1 = 14 + STAT_SPDEF;
gBattleScripting.animArg2 = 0; gBattleScripting.animArg2 = 0;
BattleScriptExecute(BattleScript_BerryStatRaiseEnd2); BattleScriptExecute(BattleScript_BerryStatRaiseEnd2);
effect = ITEM_STATS_CHANGE; effect = ITEM_STATS_CHANGE;
@@ -3622,9 +3657,9 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn)
i++; i++;
} }
if (!(i > 1)) if (!(i > 1))
gBattleCommunication[MULTISTRING_CHOOSER] = 0; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_CURED_PROBLEM;
else else
gBattleCommunication[MULTISTRING_CHOOSER] = 1; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_NORMALIZED_STATUS;
gBattleMons[battlerId].status1 = 0; gBattleMons[battlerId].status1 = 0;
gBattleMons[battlerId].status2 &= ~(STATUS2_CONFUSION); gBattleMons[battlerId].status2 &= ~(STATUS2_CONFUSION);
BattleScriptExecute(BattleScript_BerryCureChosenStatusEnd2); BattleScriptExecute(BattleScript_BerryCureChosenStatusEnd2);
@@ -3637,7 +3672,7 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn)
gBattleMons[battlerId].status2 &= ~(STATUS2_INFATUATION); gBattleMons[battlerId].status2 &= ~(STATUS2_INFATUATION);
StringCopy(gBattleTextBuff1, gStatusConditionString_LoveJpn); StringCopy(gBattleTextBuff1, gStatusConditionString_LoveJpn);
BattleScriptExecute(BattleScript_BerryCureChosenStatusEnd2); BattleScriptExecute(BattleScript_BerryCureChosenStatusEnd2);
gBattleCommunication[MULTISTRING_CHOOSER] = 0; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_CURED_PROBLEM;
effect = ITEM_EFFECT_OTHER; effect = ITEM_EFFECT_OTHER;
} }
break; break;
@@ -3740,7 +3775,7 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn)
gBattleMons[battlerId].status2 &= ~(STATUS2_INFATUATION); gBattleMons[battlerId].status2 &= ~(STATUS2_INFATUATION);
StringCopy(gBattleTextBuff1, gStatusConditionString_LoveJpn); StringCopy(gBattleTextBuff1, gStatusConditionString_LoveJpn);
BattleScriptPushCursor(); BattleScriptPushCursor();
gBattleCommunication[MULTISTRING_CHOOSER] = 0; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_CURED_PROBLEM;
gBattlescriptCurrInstr = BattleScript_BerryCureChosenStatusRet; gBattlescriptCurrInstr = BattleScript_BerryCureChosenStatusRet;
effect = ITEM_EFFECT_OTHER; effect = ITEM_EFFECT_OTHER;
} }
@@ -3776,7 +3811,7 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn)
gBattleMons[battlerId].status1 = 0; gBattleMons[battlerId].status1 = 0;
gBattleMons[battlerId].status2 &= ~(STATUS2_CONFUSION); gBattleMons[battlerId].status2 &= ~(STATUS2_CONFUSION);
BattleScriptPushCursor(); BattleScriptPushCursor();
gBattleCommunication[MULTISTRING_CHOOSER] = 0; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_CURED_PROBLEM;
gBattlescriptCurrInstr = BattleScript_BerryCureChosenStatusRet; gBattlescriptCurrInstr = BattleScript_BerryCureChosenStatusRet;
effect = ITEM_STATUS_CHANGE; effect = ITEM_STATUS_CHANGE;
} }
@@ -4016,7 +4051,9 @@ u8 IsMonDisobedient(void)
calc = CheckMoveLimitations(gBattlerAttacker, gBitTable[gCurrMovePos], 0xFF); calc = CheckMoveLimitations(gBattlerAttacker, gBitTable[gCurrMovePos], 0xFF);
if (calc == 0xF) // all moves cannot be used if (calc == 0xF) // all moves cannot be used
{ {
gBattleCommunication[MULTISTRING_CHOOSER] = Random() & 3; // Randomly select, then print a disobedient string
// B_MSG_LOAFING, B_MSG_WONT_OBEY, B_MSG_TURNED_AWAY, or B_MSG_PRETEND_NOT_NOTICE
gBattleCommunication[MULTISTRING_CHOOSER] = Random() & (NUM_LOAF_STRINGS - 1);
gBattlescriptCurrInstr = BattleScript_MoveUsedLoafingAround; gBattlescriptCurrInstr = BattleScript_MoveUsedLoafingAround;
return 1; return 1;
} }
@@ -4024,7 +4061,7 @@ u8 IsMonDisobedient(void)
{ {
do do
{ {
gCurrMovePos = gChosenMovePos = Random() & 3; gCurrMovePos = gChosenMovePos = Random() & (MAX_MON_MOVES - 1);
} while (gBitTable[gCurrMovePos] & calc); } while (gBitTable[gCurrMovePos] & calc);
gCalledMove = gBattleMons[gBattlerAttacker].moves[gCurrMovePos]; gCalledMove = gBattleMons[gBattlerAttacker].moves[gCurrMovePos];
@@ -4065,7 +4102,9 @@ u8 IsMonDisobedient(void)
} }
else else
{ {
gBattleCommunication[MULTISTRING_CHOOSER] = Random() & 3; // Randomly select, then print a disobedient string
// B_MSG_LOAFING, B_MSG_WONT_OBEY, B_MSG_TURNED_AWAY, or B_MSG_PRETEND_NOT_NOTICE
gBattleCommunication[MULTISTRING_CHOOSER] = Random() & (NUM_LOAF_STRINGS - 1);
gBattlescriptCurrInstr = BattleScript_MoveUsedLoafingAround; gBattlescriptCurrInstr = BattleScript_MoveUsedLoafingAround;
return 1; return 1;
} }
+4 -3
View File
@@ -10,6 +10,7 @@
#include "constants/abilities.h" #include "constants/abilities.h"
#include "random.h" #include "random.h"
#include "battle_scripts.h" #include "battle_scripts.h"
#include "constants/battle_string_ids.h"
void AllocateBattleResources(void) void AllocateBattleResources(void)
{ {
@@ -136,7 +137,7 @@ u32 sub_805725C(u8 battlerId)
gBattleMons[battlerId].status1 &= ~(STATUS1_SLEEP); gBattleMons[battlerId].status1 &= ~(STATUS1_SLEEP);
gBattleMons[battlerId].status2 &= ~(STATUS2_NIGHTMARE); gBattleMons[battlerId].status2 &= ~(STATUS2_NIGHTMARE);
BattleScriptPushCursor(); BattleScriptPushCursor();
gBattleCommunication[MULTISTRING_CHOOSER] = 1; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_WOKE_UP_UPROAR;
gBattlescriptCurrInstr = BattleScript_MoveUsedWokeUp; gBattlescriptCurrInstr = BattleScript_MoveUsedWokeUp;
effect = 2; effect = 2;
} }
@@ -163,7 +164,7 @@ u32 sub_805725C(u8 battlerId)
{ {
gBattleMons[battlerId].status2 &= ~(STATUS2_NIGHTMARE); gBattleMons[battlerId].status2 &= ~(STATUS2_NIGHTMARE);
BattleScriptPushCursor(); BattleScriptPushCursor();
gBattleCommunication[MULTISTRING_CHOOSER] = 0; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_WOKE_UP;
gBattlescriptCurrInstr = BattleScript_MoveUsedWokeUp; gBattlescriptCurrInstr = BattleScript_MoveUsedWokeUp;
effect = 2; effect = 2;
} }
@@ -183,7 +184,7 @@ u32 sub_805725C(u8 battlerId)
gBattleMons[battlerId].status1 &= ~(STATUS1_FREEZE); gBattleMons[battlerId].status1 &= ~(STATUS1_FREEZE);
BattleScriptPushCursor(); BattleScriptPushCursor();
gBattlescriptCurrInstr = BattleScript_MoveUsedUnfroze; gBattlescriptCurrInstr = BattleScript_MoveUsedUnfroze;
gBattleCommunication[MULTISTRING_CHOOSER] = 0; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_DEFROSTED;
} }
effect = 2; effect = 2;
} }
+5 -14
View File
@@ -762,25 +762,16 @@ void BufferContestName(u8 *dest, u8 category)
StringCopy(dest, sContestNames[category]); StringCopy(dest, sContestNames[category]);
} }
// used in tv.c to determine sTVShowState for Contest Lady show // Used by the Contest Lady's TV show to determine how well she performed
// if return val is 1, sTVShowState is 1 u8 GetContestLadyPokeblockState(void)
// if return val is 2, sTVShowState is 3
// if return val is 0, sTVShowState is 2
u8 sub_818E880(void)
{ {
sContestLadyPtr = &gSaveBlock1Ptr->lilycoveLady.contest; sContestLadyPtr = &gSaveBlock1Ptr->lilycoveLady.contest;
if (sContestLadyPtr->numGoodPokeblocksGiven >= LILYCOVE_LADY_GIFT_THRESHOLD) if (sContestLadyPtr->numGoodPokeblocksGiven >= LILYCOVE_LADY_GIFT_THRESHOLD)
{ return CONTEST_LADY_GOOD;
return 1;
}
else if (sContestLadyPtr->numGoodPokeblocksGiven == 0) else if (sContestLadyPtr->numGoodPokeblocksGiven == 0)
{ return CONTEST_LADY_BAD;
return 2;
}
else else
{ return CONTEST_LADY_NORMAL;
return 0;
}
} }
+1 -1
View File
@@ -5366,7 +5366,7 @@ static void BufferStatRoseMessage(s32 arg0)
gBattlerTarget = gBattlerInMenuId; gBattlerTarget = gBattlerInMenuId;
StringCopy(gBattleTextBuff1, gStatNamesTable[sStatsToRaise[arg0]]); StringCopy(gBattleTextBuff1, gStatNamesTable[sStatsToRaise[arg0]]);
StringCopy(gBattleTextBuff2, gText_StatRose); StringCopy(gBattleTextBuff2, gText_StatRose);
BattleStringExpandPlaceholdersToDisplayedString(gText_PkmnsStatChanged2); BattleStringExpandPlaceholdersToDisplayedString(gText_DefendersStatRose);
} }
u8 *UseStatIncreaseItem(u16 itemId) u8 *UseStatIncreaseItem(u16 itemId)
+45 -45
View File
@@ -38,6 +38,7 @@
#include "constants/contest.h" #include "constants/contest.h"
#include "constants/items.h" #include "constants/items.h"
#include "constants/layouts.h" #include "constants/layouts.h"
#include "constants/lilycove_lady.h"
#include "constants/maps.h" #include "constants/maps.h"
#include "constants/metatile_behaviors.h" #include "constants/metatile_behaviors.h"
#include "constants/moves.h" #include "constants/moves.h"
@@ -179,7 +180,7 @@ static void DoTVShowPokemonNewsBattleFrontier(void);
static void DoTVShowWhatsNo1InHoennToday(void); static void DoTVShowWhatsNo1InHoennToday(void);
static void DoTVShowSecretBaseSecrets(void); static void DoTVShowSecretBaseSecrets(void);
static void DoTVShowSafariFanClub(void); static void DoTVShowSafariFanClub(void);
static void DoTVShowPokemonContestLiveUpdates2(void); static void DoTVShowLilycoveContestLady(void);
// .rodata // .rodata
@@ -461,11 +462,11 @@ static const u8 *const sTVNameRaterTextGroup[] = {
gTVNameRaterText18 gTVNameRaterText18
}; };
static const u8 *const sTVPokemonContestLiveUpdates2TextGroup[] = { static const u8 *const sTVLilycoveContestLadyTextGroup[] = {
gTVPokemonContestLiveUpdates2Text00, [CONTESTLADYLIVE_STATE_INTRO] = ContestLadyShow_Text_Intro,
gTVPokemonContestLiveUpdates2Text01, [CONTESTLADYLIVE_STATE_WON] = ContestLadyShow_Text_Won,
gTVPokemonContestLiveUpdates2Text02, [CONTESTLADYLIVE_STATE_LOST] = ContestLadyShow_Text_Lost,
gTVPokemonContestLiveUpdates2Text03 [CONTESTLADYLIVE_STATE_LOST_BADLY] = ContestLadyShow_Text_LostBadly
}; };
static const u8 *const sTVPokemonTodayFailedTextGroup[] = { static const u8 *const sTVPokemonTodayFailedTextGroup[] = {
@@ -1661,13 +1662,13 @@ void PutLilycoveContestLadyShowOnTheAir(void)
if (gSpecialVar_Result != TRUE) if (gSpecialVar_Result != TRUE)
{ {
show = &gSaveBlock1Ptr->tvShows[sCurTVShowSlot]; show = &gSaveBlock1Ptr->tvShows[sCurTVShowSlot];
BufferContestLadyLanguage(&show->contestLiveUpdates2.language); BufferContestLadyLanguage(&show->contestLady.language);
show->contestLiveUpdates2.pokemonNameLanguage = GAME_LANGUAGE; show->contestLady.pokemonNameLanguage = GAME_LANGUAGE;
show->contestLiveUpdates2.kind = TVSHOW_CONTEST_LIVE_UPDATES_2; show->contestLady.kind = TVSHOW_LILYCOVE_CONTEST_LADY;
show->contestLiveUpdates2.active = TRUE; show->contestLady.active = TRUE;
BufferContestLadyPlayerName(show->contestLiveUpdates2.playerName); BufferContestLadyPlayerName(show->contestLady.playerName);
BufferContestLadyMonName(&show->contestLiveUpdates2.contestCategory, show->contestLiveUpdates2.nickname); BufferContestLadyMonName(&show->contestLady.contestCategory, show->contestLady.nickname);
show->contestLiveUpdates2.pokeblockState = sub_818E880(); show->contestLady.pokeblockState = GetContestLadyPokeblockState();
tv_store_id_2x(show); tv_store_id_2x(show);
} }
} }
@@ -3812,9 +3813,8 @@ static void sub_80F0708(void) // FIXME: register allocation shenanigans
break; break;
case TVSHOW_FAN_CLUB_SPECIAL: case TVSHOW_FAN_CLUB_SPECIAL:
break; break;
case TVSHOW_CONTEST_LIVE_UPDATES_2: case TVSHOW_LILYCOVE_CONTEST_LADY:
break; break;
case TVSHOW_OFF_AIR: case TVSHOW_OFF_AIR:
break; break;
case TVSHOW_FAN_CLUB_LETTER: case TVSHOW_FAN_CLUB_LETTER:
@@ -4308,11 +4308,10 @@ static void sub_80F12A4(TVShow *shows)
curShow->fanClubSpecial.language = TV_GetStringLanguage(curShow->fanClubSpecial.playerName); curShow->fanClubSpecial.language = TV_GetStringLanguage(curShow->fanClubSpecial.playerName);
curShow->fanClubSpecial.idolNameLanguage = TV_GetStringLanguage(curShow->fanClubSpecial.idolName); curShow->fanClubSpecial.idolNameLanguage = TV_GetStringLanguage(curShow->fanClubSpecial.idolName);
break; break;
case TVSHOW_CONTEST_LIVE_UPDATES_2: case TVSHOW_LILYCOVE_CONTEST_LADY:
curShow->contestLiveUpdates2.language = TV_GetStringLanguage(curShow->contestLiveUpdates2.playerName); curShow->contestLady.language = TV_GetStringLanguage(curShow->contestLady.playerName);
curShow->contestLiveUpdates2.pokemonNameLanguage = TV_GetStringLanguage(curShow->contestLiveUpdates2.nickname); curShow->contestLady.pokemonNameLanguage = TV_GetStringLanguage(curShow->contestLady.nickname);
break; break;
case TVSHOW_POKEMON_TODAY_CAUGHT: case TVSHOW_POKEMON_TODAY_CAUGHT:
curShow->pokemonToday.language = TV_GetStringLanguage(curShow->pokemonToday.playerName); curShow->pokemonToday.language = TV_GetStringLanguage(curShow->pokemonToday.playerName);
curShow->pokemonToday.language2 = TV_GetStringLanguage(curShow->pokemonToday.nickname); curShow->pokemonToday.language2 = TV_GetStringLanguage(curShow->pokemonToday.nickname);
@@ -4492,8 +4491,8 @@ void DoTVShow(void)
case TVSHOW_SAFARI_FAN_CLUB: case TVSHOW_SAFARI_FAN_CLUB:
DoTVShowSafariFanClub(); DoTVShowSafariFanClub();
break; break;
case TVSHOW_CONTEST_LIVE_UPDATES_2: case TVSHOW_LILYCOVE_CONTEST_LADY:
DoTVShowPokemonContestLiveUpdates2(); DoTVShowLilycoveContestLady();
break; break;
} }
} }
@@ -7174,7 +7173,8 @@ static void DoTVShowSafariFanClub(void)
ShowFieldMessage(sTVSafariFanClubTextGroup[state]); ShowFieldMessage(sTVSafariFanClubTextGroup[state]);
} }
static void DoTVShowPokemonContestLiveUpdates2(void) // This show is a version of Contest Live Updates for the Lilycove Contest Lady
static void DoTVShowLilycoveContestLady(void)
{ {
TVShow *show; TVShow *show;
u8 state; u8 state;
@@ -7184,30 +7184,30 @@ static void DoTVShowPokemonContestLiveUpdates2(void)
state = sTVShowState; state = sTVShowState;
switch (state) switch (state)
{ {
case 0: case CONTESTLADYLIVE_STATE_INTRO:
BufferContestName(gStringVar1, show->contestLiveUpdates2.contestCategory); BufferContestName(gStringVar1, show->contestLady.contestCategory);
if (show->contestLiveUpdates2.pokeblockState == 1) if (show->contestLady.pokeblockState == CONTEST_LADY_GOOD)
{ {
sTVShowState = 1; sTVShowState = CONTESTLADYLIVE_STATE_WON;
} }
else if (show->contestLiveUpdates2.pokeblockState == 0) else if (show->contestLady.pokeblockState == CONTEST_LADY_NORMAL)
{ {
sTVShowState = 2; sTVShowState = CONTESTLADYLIVE_STATE_LOST;
} }
else else // CONTEST_LADY_BAD
{ {
sTVShowState = 3; sTVShowState = CONTESTLADYLIVE_STATE_LOST_BADLY;
} }
break; break;
case 1: case CONTESTLADYLIVE_STATE_WON:
case 2: case CONTESTLADYLIVE_STATE_LOST:
TVShowConvertInternationalString(gStringVar3, show->contestLiveUpdates2.playerName, show->contestLiveUpdates2.language); TVShowConvertInternationalString(gStringVar3, show->contestLady.playerName, show->contestLady.language);
case 3: case CONTESTLADYLIVE_STATE_LOST_BADLY:
TVShowConvertInternationalString(gStringVar2, show->contestLiveUpdates2.nickname, show->contestLiveUpdates2.pokemonNameLanguage); TVShowConvertInternationalString(gStringVar2, show->contestLady.nickname, show->contestLady.pokemonNameLanguage);
TVShowDone(); TVShowDone();
break; break;
} }
ShowFieldMessage(sTVPokemonContestLiveUpdates2TextGroup[state]); ShowFieldMessage(sTVLilycoveContestLadyTextGroup[state]);
} }
void TVShowDone(void) void TVShowDone(void)