summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGriffinR <griffin.g.richards@gmail.com>2021-04-10 12:41:35 -0400
committerGitHub <noreply@github.com>2021-04-10 12:41:35 -0400
commitf6016838b1b0e2f0cf752b3b44c63e9e9776de4f (patch)
treec08712b996af85f4fce6156e48eaef86ec2a0fda
parent5e82db8dc3f10229635d6825fbcfc742740043f2 (diff)
parentfe1b757af5ae8e8942d747863d04c4c33e5399d8 (diff)
Merge pull request #1397 from GriffinRichards/doc-moremisc
Clean up battle scripts
-rw-r--r--asm/macros/battle_script.inc2
-rw-r--r--data/battle_scripts_1.s1169
-rw-r--r--data/battle_scripts_2.s73
-rw-r--r--data/text/tv.inc8
-rw-r--r--include/battle.h21
-rw-r--r--include/battle_ai_switch_items.h22
-rw-r--r--include/battle_controllers.h4
-rw-r--r--include/battle_message.h3
-rw-r--r--include/constants/battle.h4
-rw-r--r--include/constants/battle_script_commands.h49
-rw-r--r--include/constants/battle_string_ids.h224
-rw-r--r--include/constants/lilycove_lady.h10
-rw-r--r--include/constants/tv.h8
-rw-r--r--include/event_scripts.h8
-rw-r--r--include/global.tv.h4
-rw-r--r--include/lilycove_lady.h2
-rw-r--r--src/battle_ai_switch_items.c31
-rw-r--r--src/battle_controller_link_opponent.c6
-rw-r--r--src/battle_controller_link_partner.c6
-rw-r--r--src/battle_controller_opponent.c6
-rw-r--r--src/battle_controller_player.c6
-rw-r--r--src/battle_controller_player_partner.c6
-rw-r--r--src/battle_controller_recorded_opponent.c6
-rw-r--r--src/battle_controller_recorded_player.c6
-rw-r--r--src/battle_controller_safari.c6
-rw-r--r--src/battle_controller_wally.c18
-rw-r--r--src/battle_controllers.c10
-rw-r--r--src/battle_main.c10
-rw-r--r--src/battle_message.c267
-rw-r--r--src/battle_script_commands.c297
-rw-r--r--src/battle_tv.c8
-rw-r--r--src/battle_util.c147
-rw-r--r--src/battle_util2.c7
-rw-r--r--src/lilycove_lady.c19
-rw-r--r--src/pokemon.c2
-rw-r--r--src/tv.c90
36 files changed, 1468 insertions, 1097 deletions
diff --git a/asm/macros/battle_script.inc b/asm/macros/battle_script.inc
index f3664a1c4..0f51061e8 100644
--- a/asm/macros/battle_script.inc
+++ b/asm/macros/battle_script.inc
@@ -1311,7 +1311,7 @@
various \battler, 15
.endm
- .macro arenajudmengtstring id:req
+ .macro arenajudgmentstring id:req
various \id, VARIOUS_ARENA_JUDGMENT_STRING
.endm
diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s
index ad9576a62..045db19c5 100644
--- a/data/battle_scripts_1.s
+++ b/data/battle_scripts_1.s
@@ -1,3 +1,4 @@
+#include "constants/global.h"
#include "constants/battle.h"
#include "constants/pokemon.h"
#include "constants/battle_script_commands.h"
@@ -7,6 +8,7 @@
#include "constants/moves.h"
#include "constants/songs.h"
#include "constants/game_stat.h"
+#include "constants/trainers.h"
.include "asm/macros.inc"
.include "asm/macros/battle_script.inc"
.include "constants/constants.inc"
@@ -256,7 +258,7 @@ BattleScript_EffectHit::
jumpifnotmove MOVE_SURF, BattleScript_HitFromAtkCanceler
jumpifnostatus3 BS_TARGET, STATUS3_UNDERWATER, BattleScript_HitFromAtkCanceler
orword gHitMarker, HITMARKER_IGNORE_UNDERWATER
- setbyte sDMG_MULTIPLIER, 0x2
+ setbyte sDMG_MULTIPLIER, 2
BattleScript_HitFromAtkCanceler::
attackcanceler
BattleScript_HitFromAccCheck::
@@ -278,9 +280,9 @@ BattleScript_HitFromAtkAnimation::
healthbarupdate BS_TARGET
datahpupdate BS_TARGET
critmessage
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
resultmessage
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
seteffectwithchance
tryfaintmon BS_TARGET, FALSE, NULL
BattleScript_MoveEnd::
@@ -293,11 +295,11 @@ BattleScript_PrintMoveMissed::
attackstring
ppreduce
BattleScript_MoveMissedPause::
- pause 0x20
+ pause B_WAIT_TIME_SHORT
BattleScript_MoveMissed::
effectivenesssound
resultmessage
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
goto BattleScript_MoveEnd
BattleScript_EffectSleep::
@@ -318,21 +320,21 @@ BattleScript_EffectSleep::
BattleScript_AlreadyAsleep::
setalreadystatusedmoveattempt BS_ATTACKER
- pause 0x20
+ pause B_WAIT_TIME_SHORT
printstring STRINGID_PKMNALREADYASLEEP
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
goto BattleScript_MoveEnd
BattleScript_WasntAffected::
- pause 0x20
+ pause B_WAIT_TIME_SHORT
printstring STRINGID_PKMNWASNTAFFECTED
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
goto BattleScript_MoveEnd
BattleScript_CantMakeAsleep::
- pause 0x20
+ pause B_WAIT_TIME_SHORT
printfromtable gUproarAwakeStringIds
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
goto BattleScript_MoveEnd
BattleScript_EffectPoisonHit::
@@ -357,23 +359,23 @@ BattleScript_EffectAbsorb::
healthbarupdate BS_TARGET
datahpupdate BS_TARGET
critmessage
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
resultmessage
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
negativedamage
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE
jumpifability BS_TARGET, ABILITY_LIQUID_OOZE, BattleScript_AbsorbLiquidOoze
- setbyte cMULTISTRING_CHOOSER, 0x0
+ setbyte cMULTISTRING_CHOOSER, B_MSG_ABSORB
goto BattleScript_AbsorbUpdateHp
BattleScript_AbsorbLiquidOoze::
manipulatedamage DMG_CHANGE_SIGN
- setbyte cMULTISTRING_CHOOSER, 0x1
+ setbyte cMULTISTRING_CHOOSER, B_MSG_ABSORB_OOZE
BattleScript_AbsorbUpdateHp::
healthbarupdate BS_ATTACKER
datahpupdate BS_ATTACKER
jumpifmovehadnoeffect BattleScript_AbsorbTryFainting
- printfromtable gLeechSeedDrainStringIds
- waitmessage 0x40
+ printfromtable gAbsorbDrainStringIds
+ waitmessage B_WAIT_TIME_LONG
BattleScript_AbsorbTryFainting::
tryfaintmon BS_ATTACKER, FALSE, NULL
tryfaintmon BS_TARGET, FALSE, NULL
@@ -418,9 +420,9 @@ BattleScript_ExplosionLoop:
healthbarupdate BS_TARGET
datahpupdate BS_TARGET
critmessage
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
resultmessage
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
tryfaintmon BS_TARGET, FALSE, NULL
moveendto MOVEEND_NEXT_TARGET
jumpifnexttargetvalid BattleScript_ExplosionLoop
@@ -429,7 +431,7 @@ BattleScript_ExplosionLoop:
BattleScript_ExplosionMissed:
effectivenesssound
resultmessage
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
moveendto MOVEEND_NEXT_TARGET
jumpifnexttargetvalid BattleScript_ExplosionLoop
tryfaintmon BS_ATTACKER, FALSE, NULL
@@ -449,7 +451,7 @@ BattleScript_EffectDreamEater::
BattleScript_DreamEaterNoEffect:
attackstring
ppreduce
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
goto BattleScript_WasntAffected
BattleScript_DreamEaterWorked:
accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE
@@ -467,16 +469,16 @@ BattleScript_DreamEaterWorked:
healthbarupdate BS_TARGET
datahpupdate BS_TARGET
critmessage
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
resultmessage
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
negativedamage
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE
healthbarupdate BS_ATTACKER
datahpupdate BS_ATTACKER
jumpifmovehadnoeffect BattleScript_DreamEaterTryFaintEnd
printstring STRINGID_PKMNDREAMEATEN
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
BattleScript_DreamEaterTryFaintEnd:
tryfaintmon BS_TARGET, FALSE, NULL
goto BattleScript_MoveEnd
@@ -484,12 +486,12 @@ BattleScript_DreamEaterTryFaintEnd:
BattleScript_EffectMirrorMove::
attackcanceler
attackstring
- pause 0x40
+ pause B_WAIT_TIME_LONG
trymirrormove
ppreduce
orbyte gMoveResultFlags, MOVE_RESULT_FAILED
printstring STRINGID_MIRRORMOVEFAILED
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
goto BattleScript_MoveEnd
BattleScript_EffectAttackUp::
@@ -512,8 +514,8 @@ BattleScript_EffectStatUpAfterAtkCanceler::
attackstring
ppreduce
statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR, BattleScript_StatUpEnd
- jumpifbyte CMP_NOT_EQUAL, cMULTISTRING_CHOOSER, 0x2, BattleScript_StatUpAttackAnim
- pause 0x20
+ jumpifbyte CMP_NOT_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_INCREASE, BattleScript_StatUpAttackAnim
+ pause B_WAIT_TIME_SHORT
goto BattleScript_StatUpPrintString
BattleScript_StatUpAttackAnim::
attackanimation
@@ -523,14 +525,14 @@ BattleScript_StatUpDoAnim::
playanimation BS_ATTACKER, B_ANIM_STATS_CHANGE, sB_ANIM_ARG1
BattleScript_StatUpPrintString::
printfromtable gStatUpStringIds
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
BattleScript_StatUpEnd::
goto BattleScript_MoveEnd
BattleScript_StatUp::
playanimation BS_EFFECT_BATTLER, B_ANIM_STATS_CHANGE, sB_ANIM_ARG1
printfromtable gStatUpStringIds
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
return
BattleScript_EffectAttackDown::
@@ -558,9 +560,9 @@ BattleScript_EffectStatDown::
attackstring
ppreduce
statbuffchange STAT_BUFF_ALLOW_PTR, BattleScript_StatDownEnd
- jumpifbyte CMP_LESS_THAN, cMULTISTRING_CHOOSER, 0x2, BattleScript_StatDownDoAnim
- jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 0x3, BattleScript_StatDownEnd
- pause 0x20
+ jumpifbyte CMP_LESS_THAN, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_DECREASE, BattleScript_StatDownDoAnim
+ jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_FELL_EMPTY, BattleScript_StatDownEnd
+ pause B_WAIT_TIME_SHORT
goto BattleScript_StatDownPrintString
BattleScript_StatDownDoAnim::
attackanimation
@@ -569,14 +571,14 @@ BattleScript_StatDownDoAnim::
playanimation BS_TARGET, B_ANIM_STATS_CHANGE, sB_ANIM_ARG1
BattleScript_StatDownPrintString::
printfromtable gStatDownStringIds
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
BattleScript_StatDownEnd::
goto BattleScript_MoveEnd
BattleScript_StatDown::
playanimation BS_EFFECT_BATTLER, B_ANIM_STATS_CHANGE, sB_ANIM_ARG1
printfromtable gStatDownStringIds
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
return
BattleScript_EffectHaze::
@@ -587,7 +589,7 @@ BattleScript_EffectHaze::
waitanimation
normalisebuffs
printstring STRINGID_STATCHANGESGONE
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
goto BattleScript_MoveEnd
BattleScript_EffectBide::
@@ -626,9 +628,9 @@ BattleScript_EffectMultiHit::
accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE
attackstring
ppreduce
- setmultihitcounter 0x0
+ setmultihitcounter 0
initmultihitstring
- setbyte sMULTIHIT_EFFECT, 0x0
+ setbyte sMULTIHIT_EFFECT, 0
BattleScript_MultiHitLoop::
jumpifhasnohp BS_ATTACKER, BattleScript_MultiHitEnd
jumpifhasnohp BS_TARGET, BattleScript_MultiHitPrintStrings
@@ -650,23 +652,23 @@ BattleScript_DoMultiHit::
healthbarupdate BS_TARGET
datahpupdate BS_TARGET
critmessage
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
printstring STRINGID_EMPTYSTRING3
- waitmessage 0x1
- addbyte sMULTIHIT_STRING + 4, 0x1
+ waitmessage 1
+ addbyte sMULTIHIT_STRING + 4, 1
moveendto MOVEEND_NEXT_TARGET
jumpifbyte CMP_COMMON_BITS, gMoveResultFlags, MOVE_RESULT_FOE_ENDURED, BattleScript_MultiHitPrintStrings
decrementmultihit BattleScript_MultiHitLoop
goto BattleScript_MultiHitPrintStrings
BattleScript_MultiHitNoMoreHits::
- pause 0x20
+ pause B_WAIT_TIME_SHORT
BattleScript_MultiHitPrintStrings::
resultmessage
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
jumpifmovehadnoeffect BattleScript_MultiHitEnd
- copyarray gBattleTextBuff1, sMULTIHIT_STRING, 0x6
+ copyarray gBattleTextBuff1, sMULTIHIT_STRING, 6
printstring STRINGID_HITXTIMES
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
BattleScript_MultiHitEnd::
seteffectwithchance
tryfaintmon BS_TARGET, FALSE, NULL
@@ -682,7 +684,7 @@ BattleScript_EffectConversion::
attackanimation
waitanimation
printstring STRINGID_PKMNCHANGEDTYPE
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
goto BattleScript_MoveEnd
BattleScript_EffectFlinchHit::
@@ -700,7 +702,7 @@ BattleScript_EffectRestoreHp::
healthbarupdate BS_ATTACKER
datahpupdate BS_ATTACKER
printstring STRINGID_PKMNREGAINEDHEALTH
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
goto BattleScript_MoveEnd
BattleScript_EffectToxic::
@@ -721,19 +723,19 @@ BattleScript_EffectToxic::
setmoveeffect MOVE_EFFECT_TOXIC
seteffectprimary
resultmessage
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
goto BattleScript_MoveEnd
BattleScript_AlreadyPoisoned::
setalreadystatusedmoveattempt BS_ATTACKER
- pause 0x40
+ pause B_WAIT_TIME_LONG
printstring STRINGID_PKMNALREADYPOISONED
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
goto BattleScript_MoveEnd
BattleScript_ImmunityProtected::
copybyte gEffectBattler, gBattlerTarget
- setbyte cMULTISTRING_CHOOSER, 0x0
+ setbyte cMULTISTRING_CHOOSER, B_MSG_ABILITY_PREVENTS_MOVE_STATUS
call BattleScript_PSNPrevention
goto BattleScript_MoveEnd
@@ -759,24 +761,24 @@ BattleScript_EffectRest::
jumpifstatus BS_ATTACKER, STATUS1_SLEEP, BattleScript_RestIsAlreadyAsleep
jumpifcantmakeasleep BattleScript_RestCantSleep
trysetrest BattleScript_AlreadyAtFullHp
- pause 0x20
+ pause B_WAIT_TIME_SHORT
printfromtable gRestUsedStringIds
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
updatestatusicon BS_ATTACKER
waitstate
goto BattleScript_PresentHealTarget
BattleScript_RestCantSleep::
- pause 0x40
+ pause B_WAIT_TIME_LONG
printfromtable gUproarAwakeStringIds
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
goto BattleScript_MoveEnd
BattleScript_RestIsAlreadyAsleep::
setalreadystatusedmoveattempt BS_ATTACKER
- pause 0x20
+ pause B_WAIT_TIME_SHORT
printstring STRINGID_PKMNALREADYASLEEP2
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
goto BattleScript_MoveEnd
BattleScript_EffectOHKO::
@@ -790,22 +792,22 @@ BattleScript_EffectOHKO::
trysetdestinybondtohappen
goto BattleScript_HitFromAtkAnimation
BattleScript_KOFail::
- pause 0x40
+ pause B_WAIT_TIME_LONG
printfromtable gKOFailedStringIds
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
goto BattleScript_MoveEnd
BattleScript_EffectRazorWind::
jumpifstatus2 BS_ATTACKER, STATUS2_MULTIPLETURNS, BattleScript_TwoTurnMovesSecondTurn
jumpifword CMP_COMMON_BITS, gHitMarker, HITMARKER_NO_ATTACKSTRING, BattleScript_TwoTurnMovesSecondTurn
- setbyte sTWOTURN_STRINGID, 0
+ setbyte sTWOTURN_STRINGID, B_MSG_TURN1_RAZOR_WIND
call BattleScriptFirstChargingTurn
goto BattleScript_MoveEnd
BattleScript_TwoTurnMovesSecondTurn::
attackcanceler
setmoveeffect MOVE_EFFECT_CHARGING
- setbyte sB_ANIM_TURN, 0x1
+ setbyte sB_ANIM_TURN, 1
clearstatusfromeffect BS_ATTACKER
orword gHitMarker, HITMARKER_NO_PPDEDUCT
jumpifnotmove MOVE_SKY_ATTACK, BattleScript_HitFromAccCheck
@@ -823,7 +825,7 @@ BattleScriptFirstChargingTurn::
seteffectprimary
copybyte cMULTISTRING_CHOOSER, sTWOTURN_STRINGID
printfromtable gFirstTurnOfTwoStringIds
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
return
BattleScript_EffectSuperFang::
@@ -851,7 +853,7 @@ BattleScript_EffectTrap::
jumpifnotmove MOVE_WHIRLPOOL, BattleScript_DoWrapEffect
jumpifnostatus3 BS_TARGET, STATUS3_UNDERWATER, BattleScript_DoWrapEffect
orword gHitMarker, HITMARKER_IGNORE_UNDERWATER
- setbyte sDMG_MULTIPLIER, 0x2
+ setbyte sDMG_MULTIPLIER, 2
BattleScript_DoWrapEffect::
setmoveeffect MOVE_EFFECT_WRAP
goto BattleScript_EffectHit
@@ -861,9 +863,9 @@ BattleScript_EffectDoubleHit::
accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE
attackstring
ppreduce
- setmultihitcounter 0x2
+ setmultihitcounter 2
initmultihitstring
- setbyte sMULTIHIT_EFFECT, 0x0
+ setbyte sMULTIHIT_EFFECT, 0
goto BattleScript_MultiHitLoop
BattleScript_EffectRecoilIfMiss::
@@ -873,12 +875,12 @@ BattleScript_EffectRecoilIfMiss::
BattleScript_MoveMissedDoDamage::
attackstring
ppreduce
- pause 0x40
+ pause B_WAIT_TIME_LONG
resultmessage
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
jumpifbyte CMP_COMMON_BITS, gMoveResultFlags, MOVE_RESULT_DOESNT_AFFECT_FOE, BattleScript_MoveEnd
printstring STRINGID_PKMNCRASHED
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
damagecalc
typecalc
adjustnormaldamage
@@ -899,7 +901,7 @@ BattleScript_EffectMist::
attackanimation
waitanimation
printfromtable gMistUsedStringIds
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
goto BattleScript_MoveEnd
BattleScript_EffectFocusEnergy::
@@ -911,7 +913,7 @@ BattleScript_EffectFocusEnergy::
attackanimation
waitanimation
printfromtable gFocusEnergyUsedStringIds
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
goto BattleScript_MoveEnd
BattleScript_EffectRecoil::
@@ -934,14 +936,14 @@ BattleScript_EffectConfuse::
setmoveeffect MOVE_EFFECT_CONFUSION
seteffectprimary
resultmessage
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
goto BattleScript_MoveEnd
BattleScript_AlreadyConfused::
setalreadystatusedmoveattempt BS_ATTACKER
- pause 0x20
+ pause B_WAIT_TIME_SHORT
printstring STRINGID_PKMNALREADYCONFUSED
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
goto BattleScript_MoveEnd
BattleScript_EffectAttackUp2::
@@ -972,7 +974,7 @@ BattleScript_EffectTransform::
attackanimation
waitanimation
printfromtable gTransformUsedStringIds
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
goto BattleScript_MoveEnd
BattleScript_EffectAttackDown2::
@@ -1000,7 +1002,7 @@ BattleScript_PrintReflectLightScreenSafeguardString::
attackanimation
waitanimation
printfromtable gReflectLightScreenSafeguardStringIds
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
goto BattleScript_MoveEnd
BattleScript_EffectPoison::
@@ -1021,7 +1023,7 @@ BattleScript_EffectPoison::
setmoveeffect MOVE_EFFECT_POISON
seteffectprimary
resultmessage
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
goto BattleScript_MoveEnd
BattleScript_EffectParalyze::
@@ -1041,19 +1043,19 @@ BattleScript_EffectParalyze::
setmoveeffect MOVE_EFFECT_PARALYSIS
seteffectprimary
resultmessage
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
goto BattleScript_MoveEnd
BattleScript_AlreadyParalyzed::
setalreadystatusedmoveattempt BS_ATTACKER
- pause 0x20
+ pause B_WAIT_TIME_SHORT
printstring STRINGID_PKMNISALREADYPARALYZED
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
goto BattleScript_MoveEnd
BattleScript_LimberProtected::
copybyte gEffectBattler, gBattlerTarget
- setbyte cMULTISTRING_CHOOSER, 0x0
+ setbyte cMULTISTRING_CHOOSER, B_MSG_ABILITY_PREVENTS_MOVE_STATUS
call BattleScript_PRLZPrevention
goto BattleScript_MoveEnd
@@ -1084,7 +1086,7 @@ BattleScript_EffectAccuracyDownHit::
BattleScript_EffectSkyAttack::
jumpifstatus2 BS_ATTACKER, STATUS2_MULTIPLETURNS, BattleScript_TwoTurnMovesSecondTurn
jumpifword CMP_COMMON_BITS, gHitMarker, HITMARKER_NO_ATTACKSTRING, BattleScript_TwoTurnMovesSecondTurn
- setbyte sTWOTURN_STRINGID, 3
+ setbyte sTWOTURN_STRINGID, B_MSG_TURN1_SKY_ATTACK
call BattleScriptFirstChargingTurn
goto BattleScript_MoveEnd
@@ -1098,7 +1100,7 @@ BattleScript_EffectTwineedle::
setbyte sMULTIHIT_EFFECT, MOVE_EFFECT_POISON
attackstring
ppreduce
- setmultihitcounter 0x2
+ setmultihitcounter 2
initmultihitstring
goto BattleScript_MultiHitLoop
@@ -1109,8 +1111,8 @@ BattleScript_EffectSubstitute::
waitstate
jumpifstatus2 BS_ATTACKER, STATUS2_SUBSTITUTE, BattleScript_AlreadyHasSubstitute
setsubstitute
- jumpifbyte CMP_NOT_EQUAL, cMULTISTRING_CHOOSER, 0x1, BattleScript_SubstituteAnim
- pause 0x20
+ jumpifbyte CMP_NOT_EQUAL, cMULTISTRING_CHOOSER, B_MSG_SUBSTITUTE_FAILED, BattleScript_SubstituteAnim
+ pause B_WAIT_TIME_SHORT
goto BattleScript_SubstituteString
BattleScript_SubstituteAnim::
attackanimation
@@ -1119,13 +1121,13 @@ BattleScript_SubstituteAnim::
datahpupdate BS_ATTACKER
BattleScript_SubstituteString::
printfromtable gSubsituteUsedStringIds
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
goto BattleScript_MoveEnd
BattleScript_AlreadyHasSubstitute::
setalreadystatusedmoveattempt BS_ATTACKER
- pause 0x20
+ pause B_WAIT_TIME_SHORT
printstring STRINGID_PKMNHASSUBSTITUTE
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
goto BattleScript_MoveEnd
BattleScript_EffectRecharge::
@@ -1136,7 +1138,7 @@ BattleScript_EffectRecharge::
BattleScript_MoveUsedMustRecharge::
printstring STRINGID_PKMNMUSTRECHARGE
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
goto BattleScript_MoveEnd
BattleScript_EffectRage::
@@ -1161,23 +1163,23 @@ BattleScript_EffectMimic::
attackanimation
waitanimation
printstring STRINGID_PKMNLEARNEDMOVE2
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
goto BattleScript_MoveEnd
BattleScript_EffectMetronome::
attackcanceler
attackstring
- pause 0x20
+ pause B_WAIT_TIME_SHORT
attackanimation
waitanimation
- setbyte sB_ANIM_TURN, 0x0
- setbyte sB_ANIM_TARGETS_HIT, 0x0
+ setbyte sB_ANIM_TURN, 0
+ setbyte sB_ANIM_TARGETS_HIT, 0
metronome
BattleScript_EffectLeechSeed::
attackcanceler
attackstring
- pause 0x20
+ pause B_WAIT_TIME_SHORT
ppreduce
jumpifstatus2 BS_TARGET, STATUS2_SUBSTITUTE, BattleScript_ButItFailed
accuracycheck BattleScript_DoLeechSeed, ACC_CURR_MOVE
@@ -1186,7 +1188,7 @@ BattleScript_DoLeechSeed::
attackanimation
waitanimation
printfromtable gLeechSeedStringIds
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
goto BattleScript_MoveEnd
BattleScript_EffectSplash::
@@ -1197,7 +1199,7 @@ BattleScript_EffectSplash::
waitanimation
incrementgamestat GAME_STAT_USED_SPLASH
printstring STRINGID_BUTNOTHINGHAPPENED
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
goto BattleScript_MoveEnd
BattleScript_EffectDisable::
@@ -1209,7 +1211,7 @@ BattleScript_EffectDisable::
attackanimation
waitanimation
printstring STRINGID_PKMNMOVEWASDISABLED
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
goto BattleScript_MoveEnd
BattleScript_EffectLevelDamage::
@@ -1253,7 +1255,7 @@ BattleScript_EffectEncore::
attackanimation
waitanimation
printstring STRINGID_PKMNGOTENCORE
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
goto BattleScript_MoveEnd
BattleScript_EffectPainSplit::
@@ -1271,7 +1273,7 @@ BattleScript_EffectPainSplit::
healthbarupdate BS_TARGET
datahpupdate BS_TARGET
printstring STRINGID_SHAREDPAIN
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
goto BattleScript_MoveEnd
BattleScript_EffectSnore::
@@ -1283,7 +1285,7 @@ BattleScript_EffectSnore::
BattleScript_SnoreIsAsleep::
jumpifhalfword CMP_EQUAL, gChosenMove, MOVE_SLEEP_TALK, BattleScript_DoSnore
printstring STRINGID_PKMNFASTASLEEP
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
statusanimation BS_ATTACKER
BattleScript_DoSnore::
attackstring
@@ -1300,7 +1302,7 @@ BattleScript_EffectConversion2::
attackanimation
waitanimation
printstring STRINGID_PKMNCHANGEDTYPE
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
goto BattleScript_MoveEnd
BattleScript_EffectLockOn::
@@ -1313,7 +1315,7 @@ BattleScript_EffectLockOn::
attackanimation
waitanimation
printstring STRINGID_PKMNTOOKAIM
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
goto BattleScript_MoveEnd
BattleScript_EffectSketch::
@@ -1325,7 +1327,7 @@ BattleScript_EffectSketch::
attackanimation
waitanimation
printstring STRINGID_PKMNSKETCHEDMOVE
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
goto BattleScript_MoveEnd
BattleScript_EffectSleepTalk::
@@ -1336,19 +1338,19 @@ BattleScript_EffectSleepTalk::
goto BattleScript_ButItFailed
BattleScript_SleepTalkIsAsleep::
printstring STRINGID_PKMNFASTASLEEP
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
statusanimation BS_ATTACKER
attackstring
ppreduce
orword gHitMarker, HITMARKER_NO_PPDEDUCT
trychoosesleeptalkmove BattleScript_SleepTalkUsingMove
- pause 0x40
+ pause B_WAIT_TIME_LONG
goto BattleScript_ButItFailed
BattleScript_SleepTalkUsingMove::
attackanimation
waitanimation
- setbyte sB_ANIM_TURN, 0x0
- setbyte sB_ANIM_TARGETS_HIT, 0x0
+ setbyte sB_ANIM_TURN, 0
+ setbyte sB_ANIM_TARGETS_HIT, 0
jumptocalledmove TRUE
BattleScript_EffectDestinyBond::
@@ -1359,7 +1361,7 @@ BattleScript_EffectDestinyBond::
attackanimation
waitanimation
printstring STRINGID_PKMNTRYINGTOTAKEFOE
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
goto BattleScript_MoveEnd
BattleScript_EffectFlail::
@@ -1375,7 +1377,7 @@ BattleScript_EffectSpite::
attackanimation
waitanimation
printstring STRINGID_PKMNREDUCEDPP
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
goto BattleScript_MoveEnd
BattleScript_EffectHealBell::
@@ -1387,15 +1389,15 @@ BattleScript_EffectHealBell::
attackanimation
waitanimation
printfromtable gPartyStatusHealStringIds
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
jumpifnotmove MOVE_HEAL_BELL, BattleScript_PartyHealEnd
- jumpifbyte CMP_NO_COMMON_BITS, cMULTISTRING_CHOOSER, 0x1, BattleScript_CheckHealBellMon2Unaffected
+ jumpifbyte CMP_NO_COMMON_BITS, cMULTISTRING_CHOOSER, B_MSG_BELL_SOUNDPROOF_ATTACKER, BattleScript_CheckHealBellMon2Unaffected
printstring STRINGID_PKMNSXBLOCKSY
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
BattleScript_CheckHealBellMon2Unaffected::
- jumpifbyte CMP_NO_COMMON_BITS, cMULTISTRING_CHOOSER, 0x2, BattleScript_PartyHealEnd
+ jumpifbyte CMP_NO_COMMON_BITS, cMULTISTRING_CHOOSER, B_MSG_BELL_SOUNDPROOF_PARTNER, BattleScript_PartyHealEnd
printstring STRINGID_PKMNSXBLOCKSY2
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
BattleScript_PartyHealEnd::
updatestatusicon BS_ATTACKER_WITH_PARTNER
waitstate
@@ -1405,9 +1407,9 @@ BattleScript_EffectTripleKick::
attackcanceler
attackstring
ppreduce
- sethword sTRIPLE_KICK_POWER, 0x0
+ sethword sTRIPLE_KICK_POWER, 0
initmultihitstring
- setmultihit 0x3
+ setmultihit 3
BattleScript_TripleKickLoop::
jumpifhasnohp BS_ATTACKER, BattleScript_TripleKickEnd
jumpifhasnohp BS_TARGET, BattleScript_TripleKickNoMoreHits
@@ -1417,7 +1419,7 @@ BattleScript_DoTripleKickAttack::
accuracycheck BattleScript_TripleKickNoMoreHits, ACC_CURR_MOVE
movevaluescleanup
addbyte sTRIPLE_KICK_POWER, 10
- addbyte sMULTIHIT_STRING + 4, 0x1
+ addbyte sMULTIHIT_STRING + 4, 1
copyhword gDynamicBasePower, sTRIPLE_KICK_POWER
critcalc
damagecalc
@@ -1432,25 +1434,25 @@ BattleScript_DoTripleKickAttack::
healthbarupdate BS_TARGET
datahpupdate BS_TARGET
critmessage
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
printstring STRINGID_EMPTYSTRING3
- waitmessage 0x1
+ waitmessage 1
moveendto MOVEEND_NEXT_TARGET
jumpifbyte CMP_COMMON_BITS, gMoveResultFlags, MOVE_RESULT_FOE_ENDURED, BattleScript_TripleKickPrintStrings
decrementmultihit BattleScript_TripleKickLoop
goto BattleScript_TripleKickPrintStrings
BattleScript_TripleKickNoMoreHits::
- pause 0x20
- jumpifbyte CMP_EQUAL, sMULTIHIT_STRING + 4, 0x0, BattleScript_TripleKickPrintStrings
+ pause B_WAIT_TIME_SHORT
+ jumpifbyte CMP_EQUAL, sMULTIHIT_STRING + 4, 0, BattleScript_TripleKickPrintStrings
bicbyte gMoveResultFlags, MOVE_RESULT_MISSED
BattleScript_TripleKickPrintStrings::
resultmessage
- waitmessage 0x40
- jumpifbyte CMP_EQUAL, sMULTIHIT_STRING + 4, 0x0, BattleScript_TripleKickEnd
+ waitmessage B_WAIT_TIME_LONG
+ jumpifbyte CMP_EQUAL, sMULTIHIT_STRING + 4, 0, BattleScript_TripleKickEnd
jumpifbyte CMP_COMMON_BITS, gMoveResultFlags, MOVE_RESULT_DOESNT_AFFECT_FOE, BattleScript_TripleKickEnd
- copyarray gBattleTextBuff1, sMULTIHIT_STRING, 0x6
+ copyarray gBattleTextBuff1, sMULTIHIT_STRING, 6
printstring STRINGID_HITXTIMES
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
BattleScript_TripleKickEnd::
seteffectwithchance
tryfaintmon BS_TARGET, FALSE, NULL
@@ -1473,7 +1475,7 @@ BattleScript_EffectMeanLook::
setmoveeffect MOVE_EFFECT_PREVENT_ESCAPE
seteffectprimary
printstring STRINGID_TARGETCANTESCAPENOW
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
goto BattleScript_MoveEnd
BattleScript_EffectNightmare::
@@ -1490,7 +1492,7 @@ BattleScript_NightmareWorked::
setmoveeffect MOVE_EFFECT_NIGHTMARE
seteffectprimary
printstring STRINGID_PKMNFELLINTONIGHTMARE
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
goto BattleScript_MoveEnd
BattleScript_EffectMinimize::
@@ -1509,23 +1511,23 @@ BattleScript_EffectCurse::
jumpifstat BS_ATTACKER, CMP_EQUAL, STAT_DEF, MAX_STAT_STAGE, BattleScript_ButItFailed
BattleScript_CurseTrySpeed::
copybyte gBattlerTarget, gBattlerAttacker
- setbyte sB_ANIM_TURN, 0x1
+ setbyte sB_ANIM_TURN, 1
attackanimation
waitanimation
setstatchanger STAT_SPEED, 1, TRUE
statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR, BattleScript_CurseTryAttack
printfromtable gStatDownStringIds
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
BattleScript_CurseTryAttack::
setstatchanger STAT_ATK, 1, FALSE
- statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR, BattleScript_CurseTryDefence
+ statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR, BattleScript_CurseTryDefense
printfromtable gStatUpStringIds
- waitmessage 0x40
-BattleScript_CurseTryDefence::
+ waitmessage B_WAIT_TIME_LONG
+BattleScript_CurseTryDefense::
setstatchanger STAT_DEF, 1, FALSE
statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR, BattleScript_CurseEnd
printfromtable gStatUpStringIds
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
BattleScript_CurseEnd::
goto BattleScript_MoveEnd
BattleScript_GhostCurse::
@@ -1539,13 +1541,13 @@ BattleScript_DoGhostCurse::
accuracycheck BattleScript_ButItFailed, NO_ACC_CALC_CHECK_LOCK_ON
cursetarget BattleScript_ButItFailed
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE
- setbyte sB_ANIM_TURN, 0x0
+ setbyte sB_ANIM_TURN, 0
attackanimation
waitanimation
healthbarupdate BS_ATTACKER
datahpupdate BS_ATTACKER
printstring STRINGID_PKMNLAIDCURSE
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
tryfaintmon BS_ATTACKER, FALSE, NULL
goto BattleScript_MoveEnd
@@ -1558,7 +1560,7 @@ BattleScript_EffectEndure::
attackanimation
waitanimation
printfromtable gProtectLikeUsedStringIds
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
goto BattleScript_MoveEnd
BattleScript_EffectSpikes::
@@ -1569,7 +1571,7 @@ BattleScript_EffectSpikes::
attackanimation
waitanimation
printstring STRINGID_SPIKESSCATTERED
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
goto BattleScript_MoveEnd
BattleScript_EffectForesight::
@@ -1581,7 +1583,7 @@ BattleScript_EffectForesight::
attackanimation
waitanimation
printstring STRINGID_PKMNIDENTIFIED
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
goto BattleScript_MoveEnd
BattleScript_EffectPerishSong::
@@ -1592,18 +1594,18 @@ BattleScript_EffectPerishSong::
attackanimation
waitanimation
printstring STRINGID_FAINTINTHREE
- waitmessage 0x40
- setbyte sBATTLER, 0x0
+ waitmessage B_WAIT_TIME_LONG
+ setbyte sBATTLER, 0
BattleScript_PerishSongLoop::
jumpifability BS_SCRIPTING, ABILITY_SOUNDPROOF, BattleScript_PerishSongNotAffected
BattleScript_PerishSongLoopIncrement::
- addbyte sBATTLER, 0x1
+ addbyte sBATTLER, 1
jumpifbytenotequal sBATTLER, gBattlersCount, BattleScript_PerishSongLoop
goto BattleScript_MoveEnd
BattleScript_PerishSongNotAffected::
printstring STRINGID_PKMNSXBLOCKSY2
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
goto BattleScript_PerishSongLoopIncrement
BattleScript_EffectSandstorm::
@@ -1636,11 +1638,11 @@ BattleScript_EffectSwagger::
waitanimation
setstatchanger STAT_ATK, 2, FALSE
statbuffchange STAT_BUFF_ALLOW_PTR, BattleScript_SwaggerTryConfuse
- jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 0x2, BattleScript_SwaggerTryConfuse
+ jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_INCREASE, BattleScript_SwaggerTryConfuse
setgraphicalstatchangevalues
playanimation BS_TARGET, B_ANIM_STATS_CHANGE, sB_ANIM_ARG1
printfromtable gStatUpStringIds
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
BattleScript_SwaggerTryConfuse::
jumpifability BS_TARGET, ABILITY_OWN_TEMPO, BattleScript_OwnTempoPrevents
jumpifsideaffecting BS_TARGET, SIDE_STATUS_SAFEGUARD, BattleScript_SafeguardProtected
@@ -1671,7 +1673,7 @@ BattleScript_EffectAttract::
attackanimation
waitanimation
printstring STRINGID_PKMNFELLINLOVE
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
goto BattleScript_MoveEnd
BattleScript_EffectReturn::
@@ -1706,9 +1708,9 @@ BattleScript_EffectMagnitude::
ppreduce
selectfirstvalidtarget
magnitudedamagecalculation
- pause 0x20
+ pause B_WAIT_TIME_SHORT
printstring STRINGID_MAGNITUDESTRENGTH
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
goto BattleScript_HitsAllWithUndergroundBonusLoop
BattleScript_EffectBatonPass::
@@ -1719,10 +1721,10 @@ BattleScript_EffectBatonPass::
jumpifcantswitch SWITCH_IGNORE_ESCAPE_PREVENTION | BS_ATTACKER, BattleScript_ButItFailed
attackanimation
waitanimation
- openpartyscreen 0x1, BattleScript_ButItFailed
+ openpartyscreen BS_ATTACKER, BattleScript_ButItFailed
switchoutabilities BS_ATTACKER
waitstate
- switchhandleorder BS_ATTACKER, 0x2
+ switchhandleorder BS_ATTACKER, 2
returntoball BS_ATTACKER
getswitchedmondata BS_ATTACKER
switchindataupdate BS_ATTACKER
@@ -1770,7 +1772,7 @@ BattleScript_MoveWeatherChange::
attackanimation
waitanimation
printfromtable gMoveWeatherChangeStringIds
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
call BattleScript_WeatherFormChanges
goto BattleScript_MoveEnd
@@ -1804,7 +1806,7 @@ BattleScript_EffectBellyDrum::
healthbarupdate BS_ATTACKER
datahpupdate BS_ATTACKER
printstring STRINGID_PKMNCUTHPMAXEDATTACK
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
goto BattleScript_MoveEnd
BattleScript_EffectPsychUp::
@@ -1815,7 +1817,7 @@ BattleScript_EffectPsychUp::
attackanimation
waitanimation
printstring STRINGID_PKMNCOPIEDSTATCHANGES
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
goto BattleScript_MoveEnd
BattleScript_EffectMirrorCoat::
@@ -1831,22 +1833,22 @@ BattleScript_EffectMirrorCoat::
BattleScript_EffectSkullBash::
jumpifstatus2 BS_ATTACKER, STATUS2_MULTIPLETURNS, BattleScript_TwoTurnMovesSecondTurn
jumpifword CMP_COMMON_BITS, gHitMarker, HITMARKER_NO_ATTACKSTRING, BattleScript_TwoTurnMovesSecondTurn
- setbyte sTWOTURN_STRINGID, 2
+ setbyte sTWOTURN_STRINGID, B_MSG_TURN1_SKULL_BASH
call BattleScriptFirstChargingTurn
setstatchanger STAT_DEF, 1, FALSE
statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR, BattleScript_SkullBashEnd
- jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 0x2, BattleScript_SkullBashEnd
+ jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_INCREASE, BattleScript_SkullBashEnd
setgraphicalstatchangevalues
playanimation BS_ATTACKER, B_ANIM_STATS_CHANGE, sB_ANIM_ARG1
printfromtable gStatUpStringIds
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
BattleScript_SkullBashEnd::
goto BattleScript_MoveEnd
BattleScript_EffectTwister::
jumpifnostatus3 BS_TARGET, STATUS3_ON_AIR, BattleScript_FlinchEffect
orword gHitMarker, HITMARKER_IGNORE_ON_AIR
- setbyte sDMG_MULTIPLIER, 0x2
+ setbyte sDMG_MULTIPLIER, 2
BattleScript_FlinchEffect::
setmoveeffect MOVE_EFFECT_FLINCH
goto BattleScript_EffectHit
@@ -1860,11 +1862,11 @@ BattleScript_HitsAllWithUndergroundBonusLoop::
movevaluescleanup
jumpifnostatus3 BS_TARGET, STATUS3_UNDERGROUND, BattleScript_HitsAllNoUndergroundBonus
orword gHitMarker, HITMARKER_IGNORE_UNDERGROUND
- setbyte sDMG_MULTIPLIER, 0x2
+ setbyte sDMG_MULTIPLIER, 2
goto BattleScript_DoHitAllWithUndergroundBonus
BattleScript_HitsAllNoUndergroundBonus::
bicword gHitMarker, HITMARKER_IGNORE_UNDERGROUND
- setbyte sDMG_MULTIPLIER, 0x1
+ setbyte sDMG_MULTIPLIER, 1
BattleScript_DoHitAllWithUndergroundBonus::
accuracycheck BattleScript_HitAllWithUndergroundBonusMissed, ACC_CURR_MOVE
critcalc
@@ -1879,21 +1881,21 @@ BattleScript_DoHitAllWithUndergroundBonus::
healthbarupdate BS_TARGET
datahpupdate BS_TARGET
critmessage
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
resultmessage
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
printstring STRINGID_EMPTYSTRING3
- waitmessage 0x1
+ waitmessage 1
tryfaintmon BS_TARGET, FALSE, NULL
moveendto MOVEEND_NEXT_TARGET
jumpifnexttargetvalid BattleScript_HitsAllWithUndergroundBonusLoop
end
BattleScript_HitAllWithUndergroundBonusMissed::
- pause 0x20
+ pause B_WAIT_TIME_SHORT
typecalc
effectivenesssound
resultmessage
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
moveendto MOVEEND_NEXT_TARGET
jumpifnexttargetvalid BattleScript_HitsAllWithUndergroundBonusLoop
end
@@ -1906,18 +1908,18 @@ BattleScript_EffectFutureSight::
attackanimation
waitanimation
printfromtable gFutureMoveUsedStringIds
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
goto BattleScript_MoveEnd
BattleScript_EffectGust::
jumpifnostatus3 BS_TARGET, STATUS3_ON_AIR, BattleScript_EffectHit
orword gHitMarker, HITMARKER_IGNORE_ON_AIR
- setbyte sDMG_MULTIPLIER, 0x2
+ setbyte sDMG_MULTIPLIER, 2
goto BattleScript_EffectHit
BattleScript_EffectStomp::
jumpifnostatus3 BS_TARGET, STATUS3_MINIMIZED, BattleScript_FlinchEffect
- setbyte sDMG_MULTIPLIER, 0x2
+ setbyte sDMG_MULTIPLIER, 2
goto BattleScript_FlinchEffect
BattleScript_EffectSolarbeam::
@@ -1927,7 +1929,7 @@ BattleScript_EffectSolarbeam::
BattleScript_SolarbeamDecideTurn::
jumpifstatus2 BS_ATTACKER, STATUS2_MULTIPLETURNS, BattleScript_TwoTurnMovesSecondTurn
jumpifword CMP_COMMON_BITS, gHitMarker, HITMARKER_NO_ATTACKSTRING, BattleScript_TwoTurnMovesSecondTurn
- setbyte sTWOTURN_STRINGID, 1
+ setbyte sTWOTURN_STRINGID, B_MSG_TURN1_SOLAR_BEAM
call BattleScriptFirstChargingTurn
goto BattleScript_MoveEnd
BattleScript_SolarbeamOnFirstTurn::
@@ -1948,12 +1950,12 @@ BattleScript_EffectTeleport::
ppreduce
jumpifbattletype BATTLE_TYPE_TRAINER, BattleScript_ButItFailed
getifcantrunfrombattle BS_ATTACKER
- jumpifbyte CMP_EQUAL, gBattleCommunication, 0x1, BattleScript_ButItFailed
- jumpifbyte CMP_EQUAL, gBattleCommunication, 0x2, BattleScript_PrintAbilityMadeIneffective
+ jumpifbyte CMP_EQUAL, gBattleCommunication, 1, BattleScript_ButItFailed
+ jumpifbyte CMP_EQUAL, gBattleCommunication, 2, BattleScript_PrintAbilityMadeIneffective
attackanimation
waitanimation
printstring STRINGID_PKMNFLEDFROMBATTLE
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
setoutcomeonteleport BS_ATTACKER
goto BattleScript_MoveEnd
@@ -1961,15 +1963,15 @@ BattleScript_EffectBeatUp::
attackcanceler
accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE
attackstring
- pause 0x20
+ pause B_WAIT_TIME_SHORT
ppreduce
- setbyte gBattleCommunication, 0x0
+ setbyte gBattleCommunication, 0
BattleScript_BeatUpLoop::
movevaluescleanup
trydobeatup BattleScript_BeatUpEnd, BattleScript_ButItFailed
printstring STRINGID_PKMNATTACK
critcalc
- jumpifbyte CMP_NOT_EQUAL, gCritMultiplier, 0x2, BattleScript_BeatUpAttack
+ jumpifbyte CMP_NOT_EQUAL, gCritMultiplier, 2, BattleScript_BeatUpAttack
manipulatedamage DMG_DOUBLED
BattleScript_BeatUpAttack::
adjustnormaldamage
@@ -1981,9 +1983,9 @@ BattleScript_BeatUpAttack::
healthbarupdate BS_TARGET
datahpupdate BS_TARGET
critmessage
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
resultmessage
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
tryfaintmon BS_TARGET, FALSE, NULL
moveendto MOVEEND_NEXT_TARGET
goto BattleScript_BeatUpLoop
@@ -1996,19 +1998,19 @@ BattleScript_EffectSemiInvulnerable::
jumpifmove MOVE_FLY, BattleScript_FirstTurnFly
jumpifmove MOVE_DIVE, BattleScript_FirstTurnDive
jumpifmove MOVE_BOUNCE, BattleScript_FirstTurnBounce
- setbyte sTWOTURN_STRINGID, 5
+ setbyte sTWOTURN_STRINGID, B_MSG_TURN1_DIG
goto BattleScript_FirstTurnSemiInvulnerable
BattleScript_FirstTurnBounce::
- setbyte sTWOTURN_STRINGID, 7
+ setbyte sTWOTURN_STRINGID, B_MSG_TURN1_BOUNCE
goto BattleScript_FirstTurnSemiInvulnerable
BattleScript_FirstTurnDive::
- setbyte sTWOTURN_STRINGID, 6
+ setbyte sTWOTURN_STRINGID, B_MSG_TURN1_DIVE
goto BattleScript_FirstTurnSemiInvulnerable
BattleScript_FirstTurnFly::
- setbyte sTWOTURN_STRINGID, 4
+ setbyte sTWOTURN_STRINGID, B_MSG_TURN1_FLY
BattleScript_FirstTurnSemiInvulnerable::
call BattleScriptFirstChargingTurn
setsemiinvulnerablebit
@@ -2017,7 +2019,7 @@ BattleScript_FirstTurnSemiInvulnerable::
BattleScript_SecondTurnSemiInvulnerable::
attackcanceler
setmoveeffect MOVE_EFFECT_CHARGING
- setbyte sB_ANIM_TURN, 0x1
+ setbyte sB_ANIM_TURN, 1
clearstatusfromeffect BS_ATTACKER
orword gHitMarker, HITMARKER_NO_PPDEDUCT
jumpifnotmove MOVE_BOUNCE, BattleScript_SemiInvulnerableTryHit
@@ -2038,7 +2040,7 @@ BattleScript_EffectDefenseCurl::
setdefensecurlbit
setstatchanger STAT_DEF, 1, FALSE
statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR, BattleScript_DefenseCurlDoStatUpAnim
- jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 0x2, BattleScript_StatUpPrintString
+ jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_INCREASE, BattleScript_StatUpPrintString
attackanimation
waitanimation
BattleScript_DefenseCurlDoStatUpAnim::
@@ -2056,13 +2058,13 @@ BattleScript_PresentHealTarget::
healthbarupdate BS_TARGET
datahpupdate BS_TARGET
printstring STRINGID_PKMNREGAINEDHEALTH
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
goto BattleScript_MoveEnd
BattleScript_AlreadyAtFullHp::
- pause 0x20
+ pause B_WAIT_TIME_SHORT
printstring STRINGID_PKMNHPFULL
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
goto BattleScript_MoveEnd
BattleScript_EffectFakeOut::
@@ -2076,17 +2078,17 @@ BattleScript_ButItFailedAtkStringPpReduce::
BattleScript_ButItFailedPpReduce::
ppreduce
BattleScript_ButItFailed::
- pause 0x20
+ pause B_WAIT_TIME_SHORT
orbyte gMoveResultFlags, MOVE_RESULT_FAILED
resultmessage
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
goto BattleScript_MoveEnd
BattleScript_NotAffected::
- pause 0x20
+ pause B_WAIT_TIME_SHORT
orbyte gMoveResultFlags, MOVE_RESULT_DOESNT_AFFECT_FOE
resultmessage
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
goto BattleScript_MoveEnd
BattleScript_EffectUproar::
@@ -2108,12 +2110,12 @@ BattleScript_EffectStockpile::
attackanimation
waitanimation
printfromtable gStockpileUsedStringIds
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
goto BattleScript_MoveEnd
BattleScript_EffectSpitUp::
attackcanceler
- jumpifbyte CMP_EQUAL, gBattleCommunication + 6, 0x1, BattleScript_82D9FA2
+ jumpifbyte CMP_EQUAL, cMISS_TYPE, B_MSG_PROTECTED, BattleScript_SpitUpFailProtect
attackstring
ppreduce
accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE
@@ -2122,18 +2124,18 @@ BattleScript_EffectSpitUp::
adjustsetdamage
goto BattleScript_HitFromAtkAnimation
BattleScript_SpitUpFail::
- pause 0x20
+ pause B_WAIT_TIME_SHORT
printstring STRINGID_FAILEDTOSPITUP
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
goto BattleScript_MoveEnd
-BattleScript_82D9FA2::
+BattleScript_SpitUpFailProtect::
attackstring
ppreduce
- pause 0x40
+ pause B_WAIT_TIME_LONG
stockpiletobasedamage BattleScript_SpitUpFail
resultmessage
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
goto BattleScript_MoveEnd
BattleScript_EffectSwallow::
@@ -2144,9 +2146,9 @@ BattleScript_EffectSwallow::
goto BattleScript_PresentHealTarget
BattleScript_SwallowFail::
- pause 0x20
+ pause B_WAIT_TIME_SHORT
printfromtable gSwallowFailStringIds
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
goto BattleScript_MoveEnd
BattleScript_EffectHail::
@@ -2165,7 +2167,7 @@ BattleScript_EffectTorment::
attackanimation
waitanimation
printstring STRINGID_PKMNSUBJECTEDTOTORMENT
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
goto BattleScript_MoveEnd
BattleScript_EffectFlatter::
@@ -2179,11 +2181,11 @@ BattleScript_EffectFlatter::
waitanimation
setstatchanger STAT_SPATK, 1, FALSE
statbuffchange STAT_BUFF_ALLOW_PTR, BattleScript_FlatterTryConfuse
- jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 0x2, BattleScript_FlatterTryConfuse
+ jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_INCREASE, BattleScript_FlatterTryConfuse
setgraphicalstatchangevalues
playanimation BS_TARGET, B_ANIM_STATS_CHANGE, sB_ANIM_ARG1
printfromtable gStatUpStringIds
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
BattleScript_FlatterTryConfuse::
jumpifability BS_TARGET, ABILITY_OWN_TEMPO, BattleScript_OwnTempoPrevents
jumpifsideaffecting BS_TARGET, SIDE_STATUS_SAFEGUARD, BattleScript_SafeguardProtected
@@ -2210,20 +2212,20 @@ BattleScript_EffectWillOWisp::
BattleScript_WaterVeilPrevents::
copybyte gEffectBattler, gBattlerTarget
- setbyte cMULTISTRING_CHOOSER, 0x0
+ setbyte cMULTISTRING_CHOOSER, B_MSG_ABILITY_PREVENTS_MOVE_STATUS
call BattleScript_BRNPrevention
goto BattleScript_MoveEnd
BattleScript_AlreadyBurned::
setalreadystatusedmoveattempt BS_ATTACKER
- pause 0x20
+ pause B_WAIT_TIME_SHORT
printstring STRINGID_PKMNALREADYHASBURN
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
goto BattleScript_MoveEnd
BattleScript_EffectMemento::
attackcanceler
- jumpifbyte CMP_EQUAL, gBattleCommunication + 6, 0x1, BattleScript_82DA153
+ jumpifbyte CMP_EQUAL, cMISS_TYPE, B_MSG_PROTECTED, BattleScript_MementoFailProtect
attackstring
ppreduce
jumpifattackandspecialattackcannotfall BattleScript_ButItFailed
@@ -2236,33 +2238,35 @@ BattleScript_EffectMemento::
playstatchangeanimation BS_TARGET, BIT_ATK, STAT_CHANGE_NEGATIVE | STAT_CHANGE_BY_TWO
setstatchanger STAT_ATK, 2, TRUE
statbuffchange STAT_BUFF_ALLOW_PTR, BattleScript_EffectMementoTrySpAtk
- jumpifbyte CMP_GREATER_THAN, cMULTISTRING_CHOOSER, 0x1, BattleScript_EffectMementoTrySpAtk
+ @ Greater than STAT_FELL is checking if the stat cannot decrease
+ jumpifbyte CMP_GREATER_THAN, cMULTISTRING_CHOOSER, B_MSG_DEFENDER_STAT_FELL, BattleScript_EffectMementoTrySpAtk
printfromtable gStatDownStringIds
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
BattleScript_EffectMementoTrySpAtk:
playstatchangeanimation BS_TARGET, BIT_SPATK, STAT_CHANGE_NEGATIVE | STAT_CHANGE_BY_TWO
setstatchanger STAT_SPATK, 2, TRUE
statbuffchange STAT_BUFF_ALLOW_PTR, BattleScript_EffectMementoTryFaint
- jumpifbyte CMP_GREATER_THAN, cMULTISTRING_CHOOSER, 0x1, BattleScript_EffectMementoTryFaint
+ @ Greater than STAT_FELL is checking if the stat cannot decrease
+ jumpifbyte CMP_GREATER_THAN, cMULTISTRING_CHOOSER, B_MSG_DEFENDER_STAT_FELL, BattleScript_EffectMementoTryFaint
printfromtable gStatDownStringIds
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
BattleScript_EffectMementoTryFaint:
tryfaintmon BS_ATTACKER, FALSE, NULL
goto BattleScript_MoveEnd
BattleScript_EffectMementoPrintNoEffect:
printstring STRINGID_BUTNOEFFECT
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
goto BattleScript_EffectMementoTryFaint
-BattleScript_82DA153:
+BattleScript_MementoFailProtect:
attackstring
ppreduce
- jumpifattackandspecialattackcannotfall BattleScript_82DA15A
-BattleScript_82DA15A:
+ jumpifattackandspecialattackcannotfall BattleScript_MementoFailEnd
+BattleScript_MementoFailEnd:
setatkhptozero
- pause 0x40
+ pause B_WAIT_TIME_LONG
effectivenesssound
resultmessage
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
tryfaintmon BS_ATTACKER, FALSE, NULL
goto BattleScript_MoveEnd
@@ -2271,7 +2275,7 @@ BattleScript_EffectFacade::
goto BattleScript_EffectHit
BattleScript_FacadeDoubleDmg::
- setbyte sDMG_MULTIPLIER, 0x2
+ setbyte sDMG_MULTIPLIER, 2
goto BattleScript_EffectHit
BattleScript_EffectFocusPunch::
@@ -2279,7 +2283,7 @@ BattleScript_EffectFocusPunch::
jumpifnodamage BattleScript_HitFromAccCheck
ppreduce
printstring STRINGID_PKMNLOSTFOCUS
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
goto BattleScript_MoveEnd
BattleScript_EffectSmellingsalt::
@@ -2288,7 +2292,7 @@ BattleScript_EffectSmellingsalt::
jumpifstatus BS_TARGET, STATUS1_PARALYSIS, BattleScript_SmellingsaltDoubleDmg
goto BattleScript_EffectHit
BattleScript_SmellingsaltDoubleDmg:
- setbyte sDMG_MULTIPLIER, 0x2
+ setbyte sDMG_MULTIPLIER, 2
goto BattleScript_EffectHit
BattleScript_EffectFollowMe::
@@ -2299,16 +2303,16 @@ BattleScript_EffectFollowMe::
attackanimation
waitanimation
printstring STRINGID_PKMNCENTERATTENTION
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
goto BattleScript_MoveEnd
BattleScript_EffectNaturePower::
attackcanceler
attackstring
- pause 0x20
+ pause B_WAIT_TIME_SHORT
callterrainattack
printstring STRINGID_NATUREPOWERTURNEDINTO
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
return
BattleScript_EffectCharge::
@@ -2319,7 +2323,7 @@ BattleScript_EffectCharge::
attackanimation
waitanimation
printstring STRINGID_PKMNCHARGINGPOWER
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
goto BattleScript_MoveEnd
BattleScript_EffectTaunt::
@@ -2331,7 +2335,7 @@ BattleScript_EffectTaunt::
attackanimation
waitanimation
printstring STRINGID_PKMNFELLFORTAUNT
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
goto BattleScript_MoveEnd
BattleScript_EffectHelpingHand::
@@ -2342,7 +2346,7 @@ BattleScript_EffectHelpingHand::
attackanimation
waitanimation
printstring STRINGID_PKMNREADYTOHELP
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
goto BattleScript_MoveEnd
BattleScript_EffectTrick::
@@ -2355,9 +2359,9 @@ BattleScript_EffectTrick::
attackanimation
waitanimation
printstring STRINGID_PKMNSWITCHEDITEMS
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
printfromtable gItemSwapStringIds
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
goto BattleScript_MoveEnd
BattleScript_EffectRolePlay::
@@ -2369,14 +2373,14 @@ BattleScript_EffectRolePlay::
attackanimation
waitanimation
printstring STRINGID_PKMNCOPIEDFOE
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
goto BattleScript_MoveEnd
BattleScript_EffectWish::
attackcanceler
attackstring
ppreduce
- trywish 0x0, BattleScript_ButItFailed
+ trywish 0, BattleScript_ButItFailed
attackanimation
waitanimation
goto BattleScript_MoveEnd
@@ -2387,8 +2391,8 @@ BattleScript_EffectAssist::
assistattackselect BattleScript_ButItFailedPpReduce
attackanimation
waitanimation
- setbyte sB_ANIM_TURN, 0x0
- setbyte sB_ANIM_TARGETS_HIT, 0x0
+ setbyte sB_ANIM_TURN, 0
+ setbyte sB_ANIM_TARGETS_HIT, 0
jumptocalledmove TRUE
BattleScript_EffectIngrain::
@@ -2399,7 +2403,7 @@ BattleScript_EffectIngrain::
attackanimation
waitanimation
printstring STRINGID_PKMNPLANTEDROOTS
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
goto BattleScript_MoveEnd
BattleScript_EffectSuperpower::
@@ -2414,7 +2418,7 @@ BattleScript_EffectMagicCoat::
attackanimation
waitanimation
printstring STRINGID_PKMNSHROUDEDITSELF
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
goto BattleScript_MoveEnd
BattleScript_EffectRecycle::
@@ -2425,7 +2429,7 @@ BattleScript_EffectRecycle::
attackanimation
waitanimation
printstring STRINGID_XFOUNDONEY
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
goto BattleScript_MoveEnd
BattleScript_EffectRevenge::
@@ -2442,14 +2446,14 @@ BattleScript_EffectBrickBreak::
damagecalc
typecalc
adjustnormaldamage
- jumpifbyte CMP_EQUAL, sB_ANIM_TURN, 0x0, BattleScript_BrickBreakAnim
+ jumpifbyte CMP_EQUAL, sB_ANIM_TURN, 0, BattleScript_BrickBreakAnim
bicbyte gMoveResultFlags, MOVE_RESULT_MISSED | MOVE_RESULT_DOESNT_AFFECT_FOE
BattleScript_BrickBreakAnim::
attackanimation
waitanimation
- jumpifbyte CMP_LESS_THAN, sB_ANIM_TURN, 0x2, BattleScript_BrickBreakDoHit
+ jumpifbyte CMP_LESS_THAN, sB_ANIM_TURN, 2, BattleScript_BrickBreakDoHit
printstring STRINGID_THEWALLSHATTERED
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
BattleScript_BrickBreakDoHit::
typecalc2
effectivenesssound
@@ -2458,9 +2462,9 @@ BattleScript_BrickBreakDoHit::
healthbarupdate BS_TARGET
datahpupdate BS_TARGET
critmessage
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
resultmessage
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
seteffectwithchance
tryfaintmon BS_TARGET, FALSE, NULL
goto BattleScript_MoveEnd
@@ -2479,14 +2483,14 @@ BattleScript_EffectYawn::
attackanimation
waitanimation
printstring STRINGID_PKMNWASMADEDROWSY
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
goto BattleScript_MoveEnd
BattleScript_PrintBankAbilityMadeIneffective::
copybyte sBATTLER, sBATTLER_WITH_ABILITY
BattleScript_PrintAbilityMadeIneffective::
- pause 0x20
+ pause B_WAIT_TIME_SHORT
printstring STRINGID_PKMNSXMADEITINEFFECTIVE
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
goto BattleScript_MoveEnd
BattleScript_EffectKnockOff::
@@ -2520,7 +2524,7 @@ BattleScript_EffectSkillSwap::
attackanimation
waitanimation
printstring STRINGID_PKMNSWAPPEDABILITIES
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
goto BattleScript_MoveEnd
BattleScript_EffectImprison::
@@ -2531,7 +2535,7 @@ BattleScript_EffectImprison::
attackanimation
waitanimation
printstring STRINGID_PKMNSEALEDOPPONENTMOVE
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
goto BattleScript_MoveEnd
BattleScript_EffectRefresh::
@@ -2542,7 +2546,7 @@ BattleScript_EffectRefresh::
attackanimation
waitanimation
printstring STRINGID_PKMNSTATUSNORMAL
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
updatestatusicon BS_ATTACKER
goto BattleScript_MoveEnd
@@ -2554,7 +2558,7 @@ BattleScript_EffectGrudge::
attackanimation
waitanimation
printstring STRINGID_PKMNWANTSGRUDGE
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
goto BattleScript_MoveEnd
BattleScript_EffectSnatch::
@@ -2564,9 +2568,9 @@ BattleScript_EffectSnatch::
ppreduce
attackanimation
waitanimation
- pause 0x20
+ pause B_WAIT_TIME_SHORT
printstring STRINGID_PKMNWAITSFORTARGET
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
goto BattleScript_MoveEnd
BattleScript_EffectLowKick::
@@ -2589,7 +2593,7 @@ BattleScript_EffectTeeterDance::
attackcanceler
attackstring
ppreduce
- setbyte gBattlerTarget, 0x0
+ setbyte gBattlerTarget, 0
BattleScript_TeeterDanceLoop::
movevaluescleanup
setmoveeffect MOVE_EFFECT_CONFUSION
@@ -2604,42 +2608,42 @@ BattleScript_TeeterDanceLoop::
waitanimation
seteffectprimary
resultmessage
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
BattleScript_TeeterDanceDoMoveEndIncrement::
moveendto MOVEEND_NEXT_TARGET
BattleScript_TeeterDanceLoopIncrement::
- addbyte gBattlerTarget, 0x1
+ addbyte gBattlerTarget, 1
jumpifbytenotequal gBattlerTarget, gBattlersCount, BattleScript_TeeterDanceLoop
end
BattleScript_TeeterDanceOwnTempoPrevents::
- pause 0x20
+ pause B_WAIT_TIME_SHORT
printstring STRINGID_PKMNPREVENTSCONFUSIONWITH
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
goto BattleScript_TeeterDanceDoMoveEndIncrement
BattleScript_TeeterDanceSafeguardProtected::
- pause 0x20
+ pause B_WAIT_TIME_SHORT
printstring STRINGID_PKMNUSEDSAFEGUARD
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
goto BattleScript_TeeterDanceDoMoveEndIncrement
BattleScript_TeeterDanceSubstitutePrevents::
- pause 0x20
+ pause B_WAIT_TIME_SHORT
printstring STRINGID_BUTITFAILED
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
goto BattleScript_TeeterDanceDoMoveEndIncrement
BattleScript_TeeterDanceAlreadyConfused::
setalreadystatusedmoveattempt BS_ATTACKER
- pause 0x20
+ pause B_WAIT_TIME_SHORT
printstring STRINGID_PKMNALREADYCONFUSED
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
goto BattleScript_TeeterDanceDoMoveEndIncrement
BattleScript_TeeterDanceMissed::
resultmessage
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
goto BattleScript_TeeterDanceDoMoveEndIncrement
BattleScript_EffectMudSport::
@@ -2651,7 +2655,7 @@ BattleScript_EffectWaterSport::
attackanimation
waitanimation
printfromtable gSportsUsedStringIds
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
goto BattleScript_MoveEnd
BattleScript_EffectPoisonFang::
@@ -2681,24 +2685,24 @@ BattleScript_TickleDoMoveAnim::
playstatchangeanimation BS_TARGET, BIT_ATK, STAT_CHANGE_NEGATIVE
setstatchanger STAT_ATK, 1, TRUE
statbuffchange STAT_BUFF_ALLOW_PTR, BattleScript_TickleTryLowerDef
- jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 0x2, BattleScript_TickleTryLowerDef
+ jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_DECREASE, BattleScript_TickleTryLowerDef
printfromtable gStatDownStringIds
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
BattleScript_TickleTryLowerDef::
playstatchangeanimation BS_TARGET, BIT_DEF, STAT_CHANGE_NEGATIVE
setstatchanger STAT_DEF, 1, TRUE
statbuffchange STAT_BUFF_ALLOW_PTR, BattleScript_TickleEnd
- jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 0x2, BattleScript_TickleEnd
+ jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_DECREASE, BattleScript_TickleEnd
printfromtable gStatDownStringIds
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
BattleScript_TickleEnd::
goto BattleScript_MoveEnd
BattleScript_CantLowerMultipleStats::
- pause 0x20
+ pause B_WAIT_TIME_SHORT
orbyte gMoveResultFlags, MOVE_RESULT_FAILED
printstring STRINGID_STATSWONTDECREASE2
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
goto BattleScript_MoveEnd
BattleScript_EffectCosmicPower::
@@ -2711,18 +2715,18 @@ BattleScript_CosmicPowerDoMoveAnim::
attackanimation
waitanimation
setbyte sSTAT_ANIM_PLAYED, FALSE
- playstatchangeanimation BS_ATTACKER, BIT_DEF | BIT_SPDEF, 0x0
+ playstatchangeanimation BS_ATTACKER, BIT_DEF | BIT_SPDEF, 0
setstatchanger STAT_DEF, 1, FALSE
statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR, BattleScript_CosmicPowerTrySpDef
- jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 0x2, BattleScript_CosmicPowerTrySpDef
+ jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_INCREASE, BattleScript_CosmicPowerTrySpDef
printfromtable gStatUpStringIds
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
BattleScript_CosmicPowerTrySpDef::
setstatchanger STAT_SPDEF, 1, FALSE
statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR, BattleScript_CosmicPowerEnd
- jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 0x2, BattleScript_CosmicPowerEnd
+ jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_INCREASE, BattleScript_CosmicPowerEnd
printfromtable gStatUpStringIds
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
BattleScript_CosmicPowerEnd::
goto BattleScript_MoveEnd
@@ -2740,18 +2744,18 @@ BattleScript_BulkUpDoMoveAnim::
attackanimation
waitanimation
setbyte sSTAT_ANIM_PLAYED, FALSE
- playstatchangeanimation BS_ATTACKER, BIT_ATK | BIT_DEF, 0x0
+ playstatchangeanimation BS_ATTACKER, BIT_ATK | BIT_DEF, 0
setstatchanger STAT_ATK, 1, FALSE
statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR, BattleScript_BulkUpTryDef
- jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 0x2, BattleScript_BulkUpTryDef
+ jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_INCREASE, BattleScript_BulkUpTryDef
printfromtable gStatUpStringIds
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
BattleScript_BulkUpTryDef::
setstatchanger STAT_DEF, 1, FALSE
statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR, BattleScript_BulkUpEnd
- jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 0x2, BattleScript_BulkUpEnd
+ jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_INCREASE, BattleScript_BulkUpEnd
printfromtable gStatUpStringIds
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
BattleScript_BulkUpEnd::
goto BattleScript_MoveEnd
@@ -2765,26 +2769,26 @@ BattleScript_CalmMindDoMoveAnim::
attackanimation
waitanimation
setbyte sSTAT_ANIM_PLAYED, FALSE
- playstatchangeanimation BS_ATTACKER, BIT_SPATK | BIT_SPDEF, 0x0
+ playstatchangeanimation BS_ATTACKER, BIT_SPATK | BIT_SPDEF, 0
setstatchanger STAT_SPATK, 1, FALSE
statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR, BattleScript_CalmMindTrySpDef
- jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 0x2, BattleScript_CalmMindTrySpDef
+ jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_INCREASE, BattleScript_CalmMindTrySpDef
printfromtable gStatUpStringIds
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
BattleScript_CalmMindTrySpDef::
setstatchanger STAT_SPDEF, 1, FALSE
statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR, BattleScript_CalmMindEnd
- jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 0x2, BattleScript_CalmMindEnd
+ jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_INCREASE, BattleScript_CalmMindEnd
printfromtable gStatUpStringIds
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
BattleScript_CalmMindEnd::
goto BattleScript_MoveEnd
BattleScript_CantRaiseMultipleStats::
- pause 0x20
+ pause B_WAIT_TIME_SHORT
orbyte gMoveResultFlags, MOVE_RESULT_FAILED
printstring STRINGID_STATSWONTINCREASE2
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
goto BattleScript_MoveEnd
BattleScript_EffectDragonDance::
@@ -2797,18 +2801,18 @@ BattleScript_DragonDanceDoMoveAnim::
attackanimation
waitanimation
setbyte sSTAT_ANIM_PLAYED, FALSE
- playstatchangeanimation BS_ATTACKER, BIT_ATK | BIT_SPEED, 0x0
+ playstatchangeanimation BS_ATTACKER, BIT_ATK | BIT_SPEED, 0
setstatchanger STAT_ATK, 1, FALSE
statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR, BattleScript_DragonDanceTrySpeed
- jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 0x2, BattleScript_DragonDanceTrySpeed
+ jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_INCREASE, BattleScript_DragonDanceTrySpeed
printfromtable gStatUpStringIds
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
BattleScript_DragonDanceTrySpeed::
setstatchanger STAT_SPEED, 1, FALSE
statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR, BattleScript_DragonDanceEnd
- jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 0x2, BattleScript_DragonDanceEnd
+ jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_INCREASE, BattleScript_DragonDanceEnd
printfromtable gStatUpStringIds
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
BattleScript_DragonDanceEnd::
goto BattleScript_MoveEnd
@@ -2820,12 +2824,12 @@ BattleScript_EffectCamouflage::
attackanimation
waitanimation
printstring STRINGID_PKMNCHANGEDTYPE
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
goto BattleScript_MoveEnd
BattleScript_FaintAttacker::
playfaintcry BS_ATTACKER
- pause 0x40
+ pause B_WAIT_TIME_LONG
dofaintanimation BS_ATTACKER
cleareffectsonfaint BS_ATTACKER
printstring STRINGID_ATTACKERFAINTED
@@ -2833,47 +2837,47 @@ BattleScript_FaintAttacker::
BattleScript_FaintTarget::
playfaintcry BS_TARGET
- pause 0x40
+ pause B_WAIT_TIME_LONG
dofaintanimation BS_TARGET
cleareffectsonfaint BS_TARGET
printstring STRINGID_TARGETFAINTED
return
BattleScript_GiveExp::
- setbyte sGIVEEXP_STATE, 0x0
+ setbyte sGIVEEXP_STATE, 0
getexp BS_TARGET
end2
BattleScript_HandleFaintedMon::
- atk24 BattleScript_82DA8F6
+ atk24 BattleScript_HandleFaintedMonMultiple
jumpifbyte CMP_NOT_EQUAL, gBattleOutcome, 0, BattleScript_FaintedMonEnd
jumpifbattletype BATTLE_TYPE_TRAINER, BattleScript_FaintedMonTryChooseAnother
jumpifword CMP_NO_COMMON_BITS, gHitMarker, HITMARKER_x400000, BattleScript_FaintedMonTryChooseAnother
printstring STRINGID_USENEXTPKMN
- setbyte gBattleCommunication, 0x0
+ setbyte gBattleCommunication, 0
yesnobox
- jumpifbyte CMP_EQUAL, gBattleCommunication + 1, 0x0, BattleScript_FaintedMonTryChooseAnother
+ jumpifbyte CMP_EQUAL, gBattleCommunication + 1, 0, BattleScript_FaintedMonTryChooseAnother
jumpifplayerran BattleScript_FaintedMonEnd
printstring STRINGID_CANTESCAPE2
BattleScript_FaintedMonTryChooseAnother::
- openpartyscreen 0x3, BattleScript_FaintedMonEnd
- switchhandleorder BS_FAINTED, 0x2
+ openpartyscreen BS_FAINTED, BattleScript_FaintedMonEnd
+ switchhandleorder BS_FAINTED, 2
jumpifnotbattletype BATTLE_TYPE_TRAINER, BattleScript_FaintedMonChooseAnother
jumpifbattletype BATTLE_TYPE_LINK, BattleScript_FaintedMonChooseAnother
jumpifbattletype BATTLE_TYPE_RECORDED_LINK, BattleScript_FaintedMonChooseAnother
jumpifbattletype BATTLE_TYPE_FRONTIER, BattleScript_FaintedMonChooseAnother
jumpifbattletype BATTLE_TYPE_DOUBLE, BattleScript_FaintedMonChooseAnother
jumpifword CMP_COMMON_BITS, gHitMarker, HITMARKER_x400000, BattleScript_FaintedMonChooseAnother
- jumpifbyte CMP_EQUAL, sBATTLE_STYLE, 0x1, BattleScript_FaintedMonChooseAnother
+ jumpifbyte CMP_EQUAL, sBATTLE_STYLE, OPTIONS_BATTLE_STYLE_SET, BattleScript_FaintedMonChooseAnother
jumpifcantswitch BS_PLAYER1, BattleScript_FaintedMonChooseAnother
printstring STRINGID_ENEMYABOUTTOSWITCHPKMN
- setbyte gBattleCommunication, 0x0
+ setbyte gBattleCommunication, 0
yesnobox
- jumpifbyte CMP_EQUAL, gBattleCommunication + 1, 0x1, BattleScript_FaintedMonChooseAnother
+ jumpifbyte CMP_EQUAL, gBattleCommunication + 1, 1, BattleScript_FaintedMonChooseAnother
setatktoplayer0
- openpartyscreen 0x81, BattleScript_FaintedMonChooseAnother
- switchhandleorder BS_ATTACKER, 0x2
- jumpifbyte CMP_EQUAL, gBattleCommunication, 0x6, BattleScript_FaintedMonChooseAnother
+ openpartyscreen BS_ATTACKER | PARTY_SCREEN_OPTIONAL, BattleScript_FaintedMonChooseAnother
+ switchhandleorder BS_ATTACKER, 2
+ jumpifbyte CMP_EQUAL, gBattleCommunication, PARTY_SIZE, BattleScript_FaintedMonChooseAnother
atknameinbuff1
resetintimidatetracebits BS_ATTACKER
hpthresholds2 BS_ATTACKER
@@ -2888,7 +2892,7 @@ BattleScript_FaintedMonTryChooseAnother::
hpthresholds BS_ATTACKER
printstring STRINGID_SWITCHINMON
hidepartystatussummary BS_ATTACKER
- switchinanim BS_ATTACKER, 0x0
+ switchinanim BS_ATTACKER, 0
waitstate
switchineffects BS_ATTACKER
resetsentmonsvalue
@@ -2908,14 +2912,14 @@ BattleScript_FaintedMonChooseAnother::
BattleScript_FaintedMonEnd::
end2
-BattleScript_82DA8F6::
- openpartyscreen 0x5, BattleScript_82DA8FC
-BattleScript_82DA8FC::
- switchhandleorder BS_FAINTED, 0x0
- openpartyscreen 0x6, BattleScript_82DA92C
- switchhandleorder BS_FAINTED, 0x0
-BattleScript_82DA908::
- switchhandleorder BS_FAINTED, 0x3
+BattleScript_HandleFaintedMonMultiple::
+ openpartyscreen BS_UNK_5, BattleScript_HandleFaintedMonMultipleStart
+BattleScript_HandleFaintedMonMultipleStart::
+ switchhandleorder BS_FAINTED, 0
+ openpartyscreen BS_UNK_6, BattleScript_HandleFaintedMonMultipleEnd
+ switchhandleorder BS_FAINTED, 0
+BattleScript_HandleFaintedMonLoop::
+ switchhandleorder BS_FAINTED, 3
drawpartystatussummary BS_FAINTED
getswitchedmondata BS_FAINTED
switchindataupdate BS_FAINTED
@@ -2925,8 +2929,8 @@ BattleScript_82DA908::
switchinanim BS_FAINTED, FALSE
waitstate
switchineffects 5
- jumpifbytenotequal gBattlerFainted, gBattlersCount, BattleScript_82DA908
-BattleScript_82DA92C::
+ jumpifbytenotequal gBattlerFainted, gBattlersCount, BattleScript_HandleFaintedMonLoop
+BattleScript_HandleFaintedMonMultipleEnd::
end2
BattleScript_LocalTrainerBattleWon::
@@ -2948,7 +2952,7 @@ BattleScript_LocalBattleWonLoseTexts::
BattleScript_LocalBattleWonReward::
getmoneyreward
printstring STRINGID_PLAYERGOTMONEY
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
BattleScript_PayDayMoneyAndPickUpItems::
givepaydaymoney
pickup
@@ -2959,12 +2963,12 @@ BattleScript_LocalBattleLost::
jumpifbattletype BATTLE_TYPE_FRONTIER, BattleScript_LocalBattleLostPrintTrainersWinText
jumpifbattletype BATTLE_TYPE_TRAINER_HILL, BattleScript_LocalBattleLostPrintTrainersWinText
jumpifbattletype BATTLE_TYPE_EREADER_TRAINER, BattleScript_LocalBattleLostEnd
- jumpifhalfword CMP_EQUAL, gTrainerBattleOpponent_A, 0x400, BattleScript_LocalBattleLostEnd
+ jumpifhalfword CMP_EQUAL, gTrainerBattleOpponent_A, TRAINER_SECRET_BASE, BattleScript_LocalBattleLostEnd
BattleScript_LocalBattleLostPrintWhiteOut::
printstring STRINGID_PLAYERWHITEOUT
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
printstring STRINGID_PLAYERWHITEOUT2
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
BattleScript_LocalBattleLostEnd::
end2
BattleScript_CheckDomeDrew::
@@ -3005,23 +3009,23 @@ BattleScript_FrontierLinkBattleLost::
jumpifbattletype BATTLE_TYPE_RECORDED, BattleScript_FrontierLinkBattleLostEnd
endlinkbattle
BattleScript_FrontierLinkBattleLostEnd::
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
end2
BattleScript_LinkBattleWonOrLost::
jumpifbattletype BATTLE_TYPE_BATTLE_TOWER, BattleScript_TowerLinkBattleWon
printstring STRINGID_BATTLEEND
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
jumpifbattletype BATTLE_TYPE_RECORDED, BattleScript_LinkBattleWonOrLostWaitEnd
endlinkbattle
BattleScript_LinkBattleWonOrLostWaitEnd::
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
end2
BattleScript_TowerLinkBattleWon::
playtrainerdefeatbgm BS_ATTACKER
printstring STRINGID_BATTLEEND
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
trainerslidein BS_ATTACKER
waitstate
printstring STRINGID_TRAINER1LOSETEXT
@@ -3033,7 +3037,7 @@ BattleScript_TowerLinkBattleWon::
jumpifbattletype BATTLE_TYPE_RECORDED, BattleScript_TowerLinkBattleWonEnd
endlinkbattle
BattleScript_TowerLinkBattleWonEnd::
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
end2
BattleScript_FrontierTrainerBattleWon::
@@ -3062,22 +3066,22 @@ BattleScript_FrontierTrainerBattleWon_End:
BattleScript_SmokeBallEscape::
playanimation BS_ATTACKER, B_ANIM_SMOKEBALL_ESCAPE, NULL
printstring STRINGID_PKMNFLEDUSINGITS
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
end2
BattleScript_RanAwayUsingMonAbility::
printstring STRINGID_PKMNFLEDUSING
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
end2
BattleScript_GotAwaySafely::
printstring STRINGID_GOTAWAYSAFELY
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
end2
BattleScript_WildMonFled::
printstring STRINGID_WILDPKMNFLED
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
end2
BattleScript_PrintCantRunFromTrainer::
@@ -3086,7 +3090,7 @@ BattleScript_PrintCantRunFromTrainer::
BattleScript_PrintFailedToRunString::
printfromtable gNoEscapeStringIds
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
end2
BattleScript_PrintCantEscapeFromBattle::
@@ -3100,12 +3104,12 @@ BattleScript_PrintFullBox::
BattleScript_ActionSwitch::
hpthresholds2 BS_ATTACKER
printstring STRINGID_RETURNMON
- setbyte sDMG_MULTIPLIER, 0x2
+ setbyte sDMG_MULTIPLIER, 2
jumpifbattletype BATTLE_TYPE_DOUBLE, BattleScript_PursuitSwitchDmgSetMultihit
- setmultihit 0x1
+ setmultihit 1
goto BattleScript_PursuitSwitchDmgLoop
BattleScript_PursuitSwitchDmgSetMultihit::
- setmultihit 0x2
+ setmultihit 2
BattleScript_PursuitSwitchDmgLoop::
jumpifnopursuitswitchdmg BattleScript_DoSwitchOut
swapattackerwithtarget
@@ -3119,7 +3123,7 @@ BattleScript_DoSwitchOut::
returnatktoball
waitstate
drawpartystatussummary BS_ATTACKER
- switchhandleorder BS_ATTACKER, 0x1
+ switchhandleorder BS_ATTACKER, 1
getswitchedmondata BS_ATTACKER
switchindataupdate BS_ATTACKER
hpthresholds BS_ATTACKER
@@ -3133,7 +3137,7 @@ BattleScript_DoSwitchOut::
end2
BattleScript_PursuitDmgOnSwitchOut::
- pause 0x20
+ pause B_WAIT_TIME_SHORT
attackstring
ppreduce
critcalc
@@ -3148,26 +3152,26 @@ BattleScript_PursuitDmgOnSwitchOut::
healthbarupdate BS_TARGET
datahpupdate BS_TARGET
critmessage
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
resultmessage
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
tryfaintmon BS_TARGET, FALSE, NULL
moveendfromto MOVEEND_ON_DAMAGE_ABILITIES, MOVEEND_CHOICE_MOVE
getbattlerfainted BS_TARGET
jumpifbyte CMP_EQUAL, gBattleCommunication, FALSE, BattleScript_PursuitDmgOnSwitchOutRet
- setbyte sGIVEEXP_STATE, 0x0
+ setbyte sGIVEEXP_STATE, 0
getexp BS_TARGET
BattleScript_PursuitDmgOnSwitchOutRet:
return
BattleScript_Pausex20::
- pause 0x20
+ pause B_WAIT_TIME_SHORT
return
BattleScript_LevelUp::
fanfare MUS_LEVEL_UP
printstring STRINGID_PKMNGREWTOLV
- setbyte sLVLBOX_STATE, 0x0
+ setbyte sLVLBOX_STATE, 0
drawlvlupbox
handlelearnnewmove BattleScript_LearnedNewMove, BattleScript_LearnMoveReturn, TRUE
goto BattleScript_AskToLearnMove
@@ -3179,11 +3183,11 @@ BattleScript_AskToLearnMove::
printstring STRINGID_TRYTOLEARNMOVE2
printstring STRINGID_TRYTOLEARNMOVE3
waitstate
- setbyte sLEARNMOVE_STATE, 0x0
+ setbyte sLEARNMOVE_STATE, 0
yesnoboxlearnmove BattleScript_ForgotAndLearnedNewMove
printstring STRINGID_STOPLEARNINGMOVE
waitstate
- setbyte sLEARNMOVE_STATE, 0x0
+ setbyte sLEARNMOVE_STATE, 0
yesnoboxstoplearningmove BattleScript_AskToLearnMove
printstring STRINGID_DIDNOTLEARNMOVE
goto BattleScript_TryLearnMoveLoop
@@ -3195,7 +3199,7 @@ BattleScript_LearnedNewMove::
buffermovetolearn
fanfare MUS_LEVEL_UP
printstring STRINGID_PKMNLEARNEDMOVE
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
updatechoicemoveonlvlup BS_ATTACKER
goto BattleScript_TryLearnMoveLoop
BattleScript_LearnMoveReturn::
@@ -3203,23 +3207,23 @@ BattleScript_LearnMoveReturn::
BattleScript_RainContinuesOrEnds::
printfromtable gRainContinuesStringIds
- waitmessage 0x40
- jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 0x2, BattleScript_RainContinuesOrEndsEnd
+ waitmessage B_WAIT_TIME_LONG
+ jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_RAIN_STOPPED, BattleScript_RainContinuesOrEndsEnd
playanimation BS_ATTACKER, B_ANIM_RAIN_CONTINUES, NULL
BattleScript_RainContinuesOrEndsEnd::
end2
BattleScript_DamagingWeatherContinues::
printfromtable gSandStormHailContinuesStringIds
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
playanimation2 BS_ATTACKER, sB_ANIM_ARG1, NULL
- setbyte gBattleCommunication, 0x0
+ setbyte gBattleCommunication, 0
BattleScript_DamagingWeatherLoop::
- copyarraywithindex gBattlerAttacker, gBattlerByTurnOrder, gBattleCommunication, 0x1
+ copyarraywithindex gBattlerAttacker, gBattlerByTurnOrder, gBattleCommunication, 1
weatherdamage
- jumpifword CMP_EQUAL, gBattleMoveDamage, 0x0, BattleScript_DamagingWeatherLoopIncrement
+ jumpifword CMP_EQUAL, gBattleMoveDamage, 0, BattleScript_DamagingWeatherLoopIncrement
printfromtable gSandStormHailDmgStringIds
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
orword gHitMarker, HITMARKER_x20 | HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_x100000 | HITMARKER_GRUDGE
effectivenesssound
hitanimation BS_ATTACKER
@@ -3229,7 +3233,7 @@ BattleScript_DamagingWeatherLoop::
atk24 BattleScript_DamagingWeatherLoopIncrement
BattleScript_DamagingWeatherLoopIncrement::
jumpifbyte CMP_NOT_EQUAL, gBattleOutcome, 0, BattleScript_DamagingWeatherContinuesEnd
- addbyte gBattleCommunication, 0x1
+ addbyte gBattleCommunication, 1
jumpifbytenotequal gBattleCommunication, gBattlersCount, BattleScript_DamagingWeatherLoop
BattleScript_DamagingWeatherContinuesEnd::
bicword gHitMarker, HITMARKER_x20 | HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_x100000 | HITMARKER_GRUDGE
@@ -3237,41 +3241,41 @@ BattleScript_DamagingWeatherContinuesEnd::
BattleScript_SandStormHailEnds::
printfromtable gSandStormHailEndStringIds
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
end2
BattleScript_SunlightContinues::
printstring STRINGID_SUNLIGHTSTRONG
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
playanimation BS_ATTACKER, B_ANIM_SUN_CONTINUES, NULL
end2
BattleScript_SunlightFaded::
printstring STRINGID_SUNLIGHTFADED
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
end2
BattleScript_OverworldWeatherStarts::
printfromtable gWeatherStartsStringIds
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
playanimation2 BS_ATTACKER, sB_ANIM_ARG1, NULL
end3
BattleScript_SideStatusWoreOff::
printstring STRINGID_PKMNSXWOREOFF
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
end2
BattleScript_SafeguardProtected::
- pause 0x20
+ pause B_WAIT_TIME_SHORT
printstring STRINGID_PKMNUSEDSAFEGUARD
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
end2
BattleScript_SafeguardEnds::
- pause 0x20
+ pause B_WAIT_TIME_SHORT
printstring STRINGID_PKMNSAFEGUARDEXPIRED
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
end2
BattleScript_LeechSeedTurnDrain::
@@ -3282,23 +3286,23 @@ BattleScript_LeechSeedTurnDrain::
copyword gBattleMoveDamage, gHpDealt
jumpifability BS_ATTACKER, ABILITY_LIQUID_OOZE, BattleScript_LeechSeedTurnPrintLiquidOoze
manipulatedamage DMG_CHANGE_SIGN
- setbyte cMULTISTRING_CHOOSER, 0x3
+ setbyte cMULTISTRING_CHOOSER, B_MSG_LEECH_SEED_DRAIN
goto BattleScript_LeechSeedTurnPrintAndUpdateHp
BattleScript_LeechSeedTurnPrintLiquidOoze::
- setbyte cMULTISTRING_CHOOSER, 0x4
+ setbyte cMULTISTRING_CHOOSER, B_MSG_LEECH_SEED_OOZE
BattleScript_LeechSeedTurnPrintAndUpdateHp::
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_x100000
healthbarupdate BS_TARGET
datahpupdate BS_TARGET
printfromtable gLeechSeedStringIds
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
tryfaintmon BS_ATTACKER, FALSE, NULL
tryfaintmon BS_TARGET, FALSE, NULL
end2
BattleScript_BideStoringEnergy::
printstring STRINGID_PKMNSTORINGENERGY
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
goto BattleScript_MoveEnd
BattleScript_BideAttack::
@@ -3306,13 +3310,13 @@ BattleScript_BideAttack::
setmoveeffect MOVE_EFFECT_CHARGING
clearstatusfromeffect BS_ATTACKER
printstring STRINGID_PKMNUNLEASHEDENERGY
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
accuracycheck BattleScript_MoveMissed, ACC_CURR_MOVE
typecalc
bicbyte gMoveResultFlags, MOVE_RESULT_SUPER_EFFECTIVE | MOVE_RESULT_NOT_VERY_EFFECTIVE
copyword gBattleMoveDamage, sBIDE_DMG
adjustsetdamage
- setbyte sB_ANIM_TURN, 0x1
+ setbyte sB_ANIM_TURN, 1
attackanimation
waitanimation
effectivenesssound
@@ -3321,7 +3325,7 @@ BattleScript_BideAttack::
healthbarupdate BS_TARGET
datahpupdate BS_TARGET
resultmessage
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
tryfaintmon BS_TARGET, FALSE, NULL
goto BattleScript_MoveEnd
@@ -3330,7 +3334,7 @@ BattleScript_BideNoEnergyToAttack::
setmoveeffect MOVE_EFFECT_CHARGING
clearstatusfromeffect BS_ATTACKER
printstring STRINGID_PKMNUNLEASHEDENERGY
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
goto BattleScript_ButItFailed
BattleScript_SuccessForceOut::
@@ -3353,19 +3357,19 @@ BattleScript_TrainerBattleForceOut::
goto BattleScript_MoveEnd
BattleScript_MistProtected::
- pause 0x20
+ pause B_WAIT_TIME_SHORT
printstring STRINGID_PKMNPROTECTEDBYMIST
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
return
BattleScript_RageIsBuilding::
printstring STRINGID_PKMNRAGEBUILDING
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
return
BattleScript_MoveUsedIsDisabled::
printstring STRINGID_PKMNMOVEISDISABLED
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
goto BattleScript_MoveEnd
BattleScript_SelectingDisabledMove::
@@ -3374,7 +3378,7 @@ BattleScript_SelectingDisabledMove::
BattleScript_DisabledNoMore::
printstring STRINGID_PKMNMOVEDISABLEDNOMORE
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
end2
BattleScript_SelectingDisabledMoveInPalace::
@@ -3385,12 +3389,12 @@ BattleScript_SelectingUnusableMoveInPalace::
BattleScript_EncoredNoMore::
printstring STRINGID_PKMNENCOREENDED
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
end2
BattleScript_DestinyBondTakesLife::
printstring STRINGID_PKMNTOOKFOE
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_x100000
healthbarupdate BS_ATTACKER
datahpupdate BS_ATTACKER
@@ -3407,7 +3411,7 @@ BattleScript_SpikesOnAttacker::
return
BattleScript_SpikesOnAttackerFainted::
- setbyte sGIVEEXP_STATE, 0x0
+ setbyte sGIVEEXP_STATE, 0
getexp BS_ATTACKER
moveendall
goto BattleScript_HandleFaintedMon
@@ -3422,7 +3426,7 @@ BattleScript_SpikesOnTarget::
return
BattleScript_SpikesOnTargetFainted::
- setbyte sGIVEEXP_STATE, 0x0
+ setbyte sGIVEEXP_STATE, 0
getexp BS_TARGET
moveendall
goto BattleScript_HandleFaintedMon
@@ -3437,19 +3441,19 @@ BattleScript_SpikesOnFaintedBattler::
return
BattleScript_SpikesOnFaintedBattlerFainted::
- setbyte sGIVEEXP_STATE, 0x0
+ setbyte sGIVEEXP_STATE, 0
getexp BS_FAINTED
moveendall
goto BattleScript_HandleFaintedMon
BattleScript_PrintHurtBySpikes::
printstring STRINGID_PKMNHURTBYSPIKES
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
return
BattleScript_PerishSongTakesLife::
printstring STRINGID_PKMNPERISHCOUNTFELL
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_x100000
healthbarupdate BS_ATTACKER
datahpupdate BS_ATTACKER
@@ -3458,7 +3462,7 @@ BattleScript_PerishSongTakesLife::
BattleScript_PerishSongCountGoesDown::
printstring STRINGID_PKMNPERISHCOUNTFELL
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
end2
BattleScript_AllStatsUp::
@@ -3469,31 +3473,31 @@ BattleScript_AllStatsUp::
jumpifstat BS_ATTACKER, CMP_EQUAL, STAT_SPDEF, MAX_STAT_STAGE, BattleScript_AllStatsUpRet
BattleScript_AllStatsUpAtk::
setbyte sSTAT_ANIM_PLAYED, FALSE
- playstatchangeanimation BS_ATTACKER, BIT_ATK | BIT_DEF | BIT_SPEED | BIT_SPATK | BIT_SPDEF, 0x0
+ playstatchangeanimation BS_ATTACKER, BIT_ATK | BIT_DEF | BIT_SPEED | BIT_SPATK | BIT_SPDEF, 0
setstatchanger STAT_ATK, 1, FALSE
statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR, BattleScript_AllStatsUpDef
printfromtable gStatUpStringIds
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
BattleScript_AllStatsUpDef::
setstatchanger STAT_DEF, 1, FALSE
statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR, BattleScript_AllStatsUpSpeed
printfromtable gStatUpStringIds
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
BattleScript_AllStatsUpSpeed::
setstatchanger STAT_SPEED, 1, FALSE
statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR, BattleScript_AllStatsUpSpAtk
printfromtable gStatUpStringIds
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
BattleScript_AllStatsUpSpAtk::
setstatchanger STAT_SPATK, 1, FALSE
statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR, BattleScript_AllStatsUpSpDef
printfromtable gStatUpStringIds
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
BattleScript_AllStatsUpSpDef::
setstatchanger STAT_SPDEF, 1, FALSE
statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR, BattleScript_AllStatsUpRet
printfromtable gStatUpStringIds
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
BattleScript_AllStatsUpRet::
return
@@ -3503,31 +3507,31 @@ BattleScript_RapidSpinAway::
BattleScript_WrapFree::
printstring STRINGID_PKMNGOTFREE
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
copybyte gBattlerTarget, sBATTLER
return
BattleScript_LeechSeedFree::
printstring STRINGID_PKMNSHEDLEECHSEED
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
return
BattleScript_SpikesFree::
printstring STRINGID_PKMNBLEWAWAYSPIKES
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
return
BattleScript_MonTookFutureAttack::
printstring STRINGID_PKMNTOOKATTACK
- waitmessage 0x40
- jumpifbyte CMP_NOT_EQUAL, cMULTISTRING_CHOOSER, 0x0, BattleScript_CheckDoomDesireMiss
+ waitmessage B_WAIT_TIME_LONG
+ jumpifbyte CMP_NOT_EQUAL, cMULTISTRING_CHOOSER, B_MSG_FUTURE_SIGHT, BattleScript_CheckDoomDesireMiss
accuracycheck BattleScript_FutureAttackMiss, MOVE_FUTURE_SIGHT
goto BattleScript_FutureAttackAnimate
BattleScript_CheckDoomDesireMiss::
accuracycheck BattleScript_FutureAttackMiss, MOVE_DOOM_DESIRE
BattleScript_FutureAttackAnimate::
adjustnormaldamage2
- jumpifbyte CMP_NOT_EQUAL, cMULTISTRING_CHOOSER, 0x0, BattleScript_FutureHitAnimDoomDesire
+ jumpifbyte CMP_NOT_EQUAL, cMULTISTRING_CHOOSER, B_MSG_FUTURE_SIGHT, BattleScript_FutureHitAnimDoomDesire
playanimation BS_ATTACKER, B_ANIM_FUTURE_SIGHT_HIT, NULL
goto BattleScript_DoFutureAttackHit
BattleScript_FutureHitAnimDoomDesire::
@@ -3539,7 +3543,7 @@ BattleScript_DoFutureAttackHit::
healthbarupdate BS_TARGET
datahpupdate BS_TARGET
resultmessage
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
tryfaintmon BS_TARGET, FALSE, NULL
atk24 BattleScript_FutureAttackEnd
BattleScript_FutureAttackEnd::
@@ -3549,11 +3553,11 @@ BattleScript_FutureAttackEnd::
end2
BattleScript_FutureAttackMiss::
- pause 0x20
+ pause B_WAIT_TIME_SHORT
setbyte gMoveResultFlags, 0
orbyte gMoveResultFlags, MOVE_RESULT_FAILED
resultmessage
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
setbyte gMoveResultFlags, 0
end2
@@ -3567,9 +3571,9 @@ BattleScript_SelectingMoveWithNoPP::
BattleScript_NoPPForMove::
attackstring
- pause 0x20
+ pause B_WAIT_TIME_SHORT
printstring STRINGID_BUTNOPPLEFT
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
goto BattleScript_MoveEnd
BattleScript_SelectingTormentedMove::
@@ -3578,7 +3582,7 @@ BattleScript_SelectingTormentedMove::
BattleScript_MoveUsedIsTormented::
printstring STRINGID_PKMNCANTUSEMOVETORMENT
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
goto BattleScript_MoveEnd
BattleScript_SelectingTormentedMoveInPalace::
@@ -3591,7 +3595,7 @@ BattleScript_SelectingNotAllowedMoveTaunt::
BattleScript_MoveUsedIsTaunted::
printstring STRINGID_PKMNCANTUSEMOVETAUNT
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
goto BattleScript_MoveEnd
BattleScript_SelectingNotAllowedMoveTauntInPalace::
@@ -3599,38 +3603,38 @@ BattleScript_SelectingNotAllowedMoveTauntInPalace::
goto BattleScript_SelectingUnusableMoveInPalace
BattleScript_WishComesTrue::
- trywish 0x1, BattleScript_WishButFullHp
+ trywish 1, BattleScript_WishButFullHp
playanimation BS_TARGET, B_ANIM_WISH_HEAL, NULL
printstring STRINGID_PKMNWISHCAMETRUE
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE
healthbarupdate BS_TARGET
datahpupdate BS_TARGET
printstring STRINGID_PKMNREGAINEDHEALTH
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
end2
BattleScript_WishButFullHp::
printstring STRINGID_PKMNWISHCAMETRUE
- waitmessage 0x40
- pause 0x20
+ waitmessage B_WAIT_TIME_LONG
+ pause B_WAIT_TIME_SHORT
printstring STRINGID_PKMNHPFULL
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
end2
BattleScript_IngrainTurnHeal::
playanimation BS_ATTACKER, B_ANIM_INGRAIN_HEAL, NULL
printstring STRINGID_PKMNABSORBEDNUTRIENTS
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE
healthbarupdate BS_ATTACKER
datahpupdate BS_ATTACKER
end2
BattleScript_PrintMonIsRooted::
- pause 0x20
+ pause B_WAIT_TIME_SHORT
printstring STRINGID_PKMNANCHOREDITSELF
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
goto BattleScript_MoveEnd
BattleScript_AtkDefDown::
@@ -3639,28 +3643,28 @@ BattleScript_AtkDefDown::
playstatchangeanimation BS_ATTACKER, BIT_ATK, STAT_CHANGE_CANT_PREVENT | STAT_CHANGE_NEGATIVE
setstatchanger STAT_ATK, 1, TRUE
statbuffchange MOVE_EFFECT_AFFECTS_USER | MOVE_EFFECT_CERTAIN | STAT_BUFF_ALLOW_PTR, BattleScript_AtkDefDown_TryDef
- jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 0x2, BattleScript_AtkDefDown_TryDef
+ jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_DECREASE, BattleScript_AtkDefDown_TryDef
printfromtable gStatDownStringIds
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
BattleScript_AtkDefDown_TryDef::
playstatchangeanimation BS_ATTACKER, BIT_DEF, STAT_CHANGE_CANT_PREVENT | STAT_CHANGE_NEGATIVE
setstatchanger STAT_DEF, 1, TRUE
statbuffchange MOVE_EFFECT_AFFECTS_USER | MOVE_EFFECT_CERTAIN | STAT_BUFF_ALLOW_PTR, BattleScript_AtkDefDown_End
- jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 0x2, BattleScript_AtkDefDown_End
+ jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_DECREASE, BattleScript_AtkDefDown_End
printfromtable gStatDownStringIds
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
BattleScript_AtkDefDown_End::
return
BattleScript_KnockedOff::
playanimation BS_TARGET, B_ANIM_ITEM_KNOCKOFF, NULL
printstring STRINGID_PKMNKNOCKEDOFF
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
return
BattleScript_MoveUsedIsImprisoned::
printstring STRINGID_PKMNCANTUSEMOVESEALED
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
goto BattleScript_MoveEnd
BattleScript_SelectingImprisonedMove::
@@ -3673,15 +3677,15 @@ BattleScript_SelectingImprisonedMoveInPalace::
BattleScript_GrudgeTakesPp::
printstring STRINGID_PKMNLOSTPPGRUDGE
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
return
BattleScript_MagicCoatBounce::
attackstring
ppreduce
- pause 0x20
+ pause B_WAIT_TIME_SHORT
printstring STRINGID_PKMNMOVEBOUNCED
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
orword gHitMarker, HITMARKER_ATTACKSTRING_PRINTED | HITMARKER_NO_PPDEDUCT | HITMARKER_x800000
setmagiccoattarget BS_ATTACKER
return
@@ -3692,19 +3696,19 @@ BattleScript_SnatchedMove::
snatchsetbattlers
playanimation BS_TARGET, B_ANIM_SNATCH_MOVE, NULL
printstring STRINGID_PKMNSNATCHEDMOVE
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
orword gHitMarker, HITMARKER_ATTACKSTRING_PRINTED | HITMARKER_NO_PPDEDUCT | HITMARKER_x800000
swapattackerwithtarget
return
BattleScript_EnduredMsg::
printstring STRINGID_PKMNENDUREDHIT
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
return
BattleScript_OneHitKOMsg::
printstring STRINGID_ONEHITKO
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
return
BattleScript_SAtkDown2::
@@ -3712,42 +3716,42 @@ BattleScript_SAtkDown2::
playstatchangeanimation BS_ATTACKER, BIT_SPATK, STAT_CHANGE_CANT_PREVENT | STAT_CHANGE_NEGATIVE | STAT_CHANGE_BY_TWO
setstatchanger STAT_SPATK, 2, TRUE
statbuffchange MOVE_EFFECT_AFFECTS_USER | MOVE_EFFECT_CERTAIN | STAT_BUFF_ALLOW_PTR, BattleScript_SAtkDown2End
- jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 0x2, BattleScript_SAtkDown2End
+ jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_DECREASE, BattleScript_SAtkDown2End
printfromtable gStatDownStringIds
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
BattleScript_SAtkDown2End::
return
BattleScript_FocusPunchSetUp::
printstring STRINGID_EMPTYSTRING3
- waitmessage 0x1
+ waitmessage 1
playanimation BS_ATTACKER, B_ANIM_FOCUS_PUNCH_SETUP, NULL
printstring STRINGID_PKMNTIGHTENINGFOCUS
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
end2
BattleScript_MoveUsedIsAsleep::
printstring STRINGID_PKMNFASTASLEEP
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
statusanimation BS_ATTACKER
goto BattleScript_MoveEnd
BattleScript_MoveUsedWokeUp::
bicword gHitMarker, HITMARKER_x10
printfromtable gWokeUpStringIds
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
updatestatusicon BS_ATTACKER
return
BattleScript_MonWokeUpInUproar::
printstring STRINGID_PKMNWOKEUPINUPROAR
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
updatestatusicon BS_ATTACKER
end2
BattleScript_PoisonTurnDmg::
printstring STRINGID_PKMNHURTBYPOISON
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
BattleScript_DoStatusTurnDmg::
statusanimation BS_ATTACKER
BattleScript_DoTurnDmg::
@@ -3761,60 +3765,60 @@ BattleScript_DoTurnDmgEnd::
BattleScript_BurnTurnDmg::
printstring STRINGID_PKMNHURTBYBURN
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
goto BattleScript_DoStatusTurnDmg
BattleScript_MoveUsedIsFrozen::
printstring STRINGID_PKMNISFROZEN
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
statusanimation BS_ATTACKER
goto BattleScript_MoveEnd
BattleScript_MoveUsedUnfroze::
printfromtable gGotDefrostedStringIds
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
updatestatusicon BS_ATTACKER
return
BattleScript_DefrostedViaFireMove::
printstring STRINGID_PKMNWASDEFROSTED
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
updatestatusicon BS_TARGET
return
BattleScript_MoveUsedIsParalyzed::
printstring STRINGID_PKMNISPARALYZED
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
statusanimation BS_ATTACKER
cancelmultiturnmoves BS_ATTACKER
goto BattleScript_MoveEnd
BattleScript_MoveUsedFlinched::
printstring STRINGID_PKMNFLINCHED
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
goto BattleScript_MoveEnd
BattleScript_PrintUproarOverTurns::
printfromtable gUproarOverTurnStringIds
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
end2
BattleScript_ThrashConfuses::
chosenstatus2animation BS_ATTACKER, STATUS2_CONFUSION
printstring STRINGID_PKMNFATIGUECONFUSION
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
end2
BattleScript_MoveUsedIsConfused::
printstring STRINGID_PKMNISCONFUSED
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
status2animation BS_ATTACKER, STATUS2_CONFUSION
- jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 0x0, BattleScript_MoveUsedIsConfusedRet
+ jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, FALSE, BattleScript_MoveUsedIsConfusedRet
BattleScript_DoSelfConfusionDmg::
cancelmultiturnmoves BS_ATTACKER
adjustnormaldamage2
printstring STRINGID_ITHURTCONFUSION
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
effectivenesssound
hitanimation BS_ATTACKER
waitstate
@@ -3822,7 +3826,7 @@ BattleScript_DoSelfConfusionDmg::
healthbarupdate BS_ATTACKER
datahpupdate BS_ATTACKER
resultmessage
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
tryfaintmon BS_ATTACKER, FALSE, NULL
goto BattleScript_MoveEnd
BattleScript_MoveUsedIsConfusedRet::
@@ -3830,58 +3834,58 @@ BattleScript_MoveUsedIsConfusedRet::
BattleScript_MoveUsedIsConfusedNoMore::
printstring STRINGID_PKMNHEALEDCONFUSION
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
return
BattleScript_PrintPayDayMoneyString::
printstring STRINGID_PLAYERPICKEDUPMONEY
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
return
BattleScript_WrapTurnDmg::
playanimation BS_ATTACKER, B_ANIM_TURN_TRAP, sB_ANIM_ARG1
printstring STRINGID_PKMNHURTBY
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
goto BattleScript_DoTurnDmg
BattleScript_WrapEnds::
printstring STRINGID_PKMNFREEDFROM
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
end2
BattleScript_MoveUsedIsInLove::
printstring STRINGID_PKMNINLOVE
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
status2animation BS_ATTACKER, STATUS2_INFATUATION
return
BattleScript_MoveUsedIsInLoveCantAttack::
printstring STRINGID_PKMNIMMOBILIZEDBYLOVE
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
goto BattleScript_MoveEnd
BattleScript_NightmareTurnDmg::
printstring STRINGID_PKMNLOCKEDINNIGHTMARE
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
status2animation BS_ATTACKER, STATUS2_NIGHTMARE
goto BattleScript_DoTurnDmg
BattleScript_CurseTurnDmg::
printstring STRINGID_PKMNAFFLICTEDBYCURSE
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
status2animation BS_ATTACKER, STATUS2_CURSED
goto BattleScript_DoTurnDmg
BattleScript_TargetPRLZHeal::
printstring STRINGID_PKMNHEALEDPARALYSIS
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
updatestatusicon BS_TARGET
return
BattleScript_MoveEffectSleep::
statusanimation BS_EFFECT_BATTLER
printfromtable gFellAsleepStringIds
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
BattleScript_UpdateEffectStatusIconRet::
updatestatusicon BS_EFFECT_BATTLER
waitstate
@@ -3890,7 +3894,7 @@ BattleScript_UpdateEffectStatusIconRet::
BattleScript_YawnMakesAsleep::
statusanimation BS_EFFECT_BATTLER
printstring STRINGID_PKMNFELLASLEEP
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
updatestatusicon BS_EFFECT_BATTLER
waitstate
makevisible BS_EFFECT_BATTLER
@@ -3899,52 +3903,52 @@ BattleScript_YawnMakesAsleep::
BattleScript_MoveEffectPoison::
statusanimation BS_EFFECT_BATTLER
printfromtable gGotPoisonedStringIds
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
goto BattleScript_UpdateEffectStatusIconRet
BattleScript_MoveEffectBurn::
statusanimation BS_EFFECT_BATTLER
printfromtable gGotBurnedStringIds
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
goto BattleScript_UpdateEffectStatusIconRet
BattleScript_MoveEffectFreeze::
statusanimation BS_EFFECT_BATTLER
printfromtable gGotFrozenStringIds
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
goto BattleScript_UpdateEffectStatusIconRet
BattleScript_MoveEffectParalysis::
statusanimation BS_EFFECT_BATTLER
printfromtable gGotParalyzedStringIds
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
goto BattleScript_UpdateEffectStatusIconRet
BattleScript_MoveEffectUproar::
printstring STRINGID_PKMNCAUSEDUPROAR
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
return
BattleScript_MoveEffectToxic::
statusanimation BS_EFFECT_BATTLER
printstring STRINGID_PKMNBADLYPOISONED
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
goto BattleScript_UpdateEffectStatusIconRet
BattleScript_MoveEffectPayDay::
printstring STRINGID_COINSSCATTERED
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
return
BattleScript_MoveEffectWrap::
printfromtable gWrappedStringIds
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
return
BattleScript_MoveEffectConfusion::
chosenstatus2animation BS_EFFECT_BATTLER, STATUS2_CONFUSION
printstring STRINGID_PKMNWASCONFUSED
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
return
BattleScript_MoveEffectRecoil::
@@ -3955,7 +3959,7 @@ BattleScript_DoRecoil::
healthbarupdate BS_ATTACKER
datahpupdate BS_ATTACKER
printstring STRINGID_PKMNHITWITHRECOIL
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
tryfaintmon BS_ATTACKER, FALSE, NULL
BattleScript_RecoilEnd::
return
@@ -3963,11 +3967,11 @@ BattleScript_RecoilEnd::
BattleScript_ItemSteal::
playanimation BS_TARGET, B_ANIM_ITEM_STEAL, NULL
printstring STRINGID_PKMNSTOLEITEM
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
return
BattleScript_DrizzleActivates::
- pause 0x20
+ pause B_WAIT_TIME_SHORT
printstring STRINGID_PKMNMADEITRAIN
waitstate
playanimation BS_BATTLER_0, B_ANIM_RAIN_CONTINUES, NULL
@@ -3977,25 +3981,25 @@ BattleScript_DrizzleActivates::
BattleScript_SpeedBoostActivates::
playanimation BS_ATTACKER, B_ANIM_STATS_CHANGE, sB_ANIM_ARG1
printstring STRINGID_PKMNRAISEDSPEED
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
end3
BattleScript_TraceActivates::
- pause 0x20
+ pause B_WAIT_TIME_SHORT
printstring STRINGID_PKMNTRACED
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
end3
BattleScript_RainDishActivates::
printstring STRINGID_PKMNSXRESTOREDHPALITTLE2
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE
healthbarupdate BS_ATTACKER
datahpupdate BS_ATTACKER
end3
BattleScript_SandstreamActivates::
- pause 0x20
+ pause B_WAIT_TIME_SHORT
printstring STRINGID_PKMNSXWHIPPEDUPSANDSTORM
waitstate
playanimation BS_BATTLER_0, B_ANIM_SANDSTORM_CONTINUES, NULL
@@ -4004,15 +4008,15 @@ BattleScript_SandstreamActivates::
BattleScript_ShedSkinActivates::
printstring STRINGID_PKMNSXCUREDYPROBLEM
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
updatestatusicon BS_ATTACKER
end3
BattleScript_WeatherFormChanges::
- setbyte sBATTLER, 0x0
+ setbyte sBATTLER, 0
BattleScript_WeatherFormChangesLoop::
trycastformdatachange
- addbyte sBATTLER, 0x1
+ addbyte sBATTLER, 1
jumpifbytenotequal sBATTLER, gBattlersCount, BattleScript_WeatherFormChangesLoop
return
@@ -4024,7 +4028,7 @@ BattleScript_DoCastformChange::
docastformchangeanimation
waitstate
printstring STRINGID_PKMNTRANSFORMED
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
return
BattleScript_IntimidateActivatesEnd3::
@@ -4032,9 +4036,9 @@ BattleScript_IntimidateActivatesEnd3::
end3
BattleScript_PauseIntimidateActivates:
- pause 0x20
+ pause B_WAIT_TIME_SHORT
BattleScript_IntimidateActivates::
- setbyte gBattlerTarget, 0x0
+ setbyte gBattlerTarget, 0
setstatchanger STAT_ATK, 1, TRUE
BattleScript_IntimidateActivatesLoop:
trygetintimidatetarget BattleScript_IntimidateActivatesReturn
@@ -4043,24 +4047,24 @@ BattleScript_IntimidateActivatesLoop:
jumpifability BS_TARGET, ABILITY_HYPER_CUTTER, BattleScript_IntimidatePrevented
jumpifability BS_TARGET, ABILITY_WHITE_SMOKE, BattleScript_IntimidatePrevented
statbuffchange STAT_BUFF_NOT_PROTECT_AFFECTED | STAT_BUFF_ALLOW_PTR, BattleScript_IntimidateActivatesLoopIncrement
- jumpifbyte CMP_GREATER_THAN, cMULTISTRING_CHOOSER, 0x1, BattleScript_IntimidateActivatesLoopIncrement
+ jumpifbyte CMP_GREATER_THAN, cMULTISTRING_CHOOSER, 1, BattleScript_IntimidateActivatesLoopIncrement
setgraphicalstatchangevalues
playanimation BS_TARGET, B_ANIM_STATS_CHANGE, sB_ANIM_ARG1
printstring STRINGID_PKMNCUTSATTACKWITH
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
BattleScript_IntimidateActivatesLoopIncrement:
- addbyte gBattlerTarget, 0x1
+ addbyte gBattlerTarget, 1
goto BattleScript_IntimidateActivatesLoop
BattleScript_IntimidateActivatesReturn:
return
BattleScript_IntimidatePrevented:
- pause 0x20
+ pause B_WAIT_TIME_SHORT
printstring STRINGID_PREVENTEDFROMWORKING
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
goto BattleScript_IntimidateActivatesLoopIncrement
BattleScript_DroughtActivates::
- pause 0x20
+ pause B_WAIT_TIME_SHORT
printstring STRINGID_PKMNSXINTENSIFIEDSUN
waitstate
playanimation BS_BATTLER_0, B_ANIM_SUN_CONTINUES, NULL
@@ -4069,34 +4073,34 @@ BattleScript_DroughtActivates::
BattleScript_TookAttack::
attackstring
- pause 0x20
+ pause B_WAIT_TIME_SHORT
printstring STRINGID_PKMNSXTOOKATTACK
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
orword gHitMarker, HITMARKER_ATTACKSTRING_PRINTED
return
BattleScript_SturdyPreventsOHKO::
- pause 0x20
+ pause B_WAIT_TIME_SHORT
printstring STRINGID_PKMNPROTECTEDBY
- pause 0x40
+ pause B_WAIT_TIME_LONG
goto BattleScript_MoveEnd
BattleScript_DampStopsExplosion::
- pause 0x20
+ pause B_WAIT_TIME_SHORT
printstring STRINGID_PKMNPREVENTSUSAGE
- pause 0x40
+ pause B_WAIT_TIME_LONG
goto BattleScript_MoveEnd
BattleScript_MoveHPDrain_PPLoss::
ppreduce
BattleScript_MoveHPDrain::
attackstring
- pause 0x20
+ pause B_WAIT_TIME_SHORT
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE
healthbarupdate BS_TARGET
datahpupdate BS_TARGET
printstring STRINGID_PKMNRESTOREDHPUSING
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
orbyte gMoveResultFlags, MOVE_RESULT_DOESNT_AFFECT_FOE
goto BattleScript_MoveEnd
@@ -4104,9 +4108,9 @@ BattleScript_MonMadeMoveUseless_PPLoss::
ppreduce
BattleScript_MonMadeMoveUseless::
attackstring
- pause 0x20
+ pause B_WAIT_TIME_SHORT
printstring STRINGID_PKMNSXMADEYUSELESS
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
orbyte gMoveResultFlags, MOVE_RESULT_DOESNT_AFFECT_FOE
goto BattleScript_MoveEnd
@@ -4114,83 +4118,83 @@ BattleScript_FlashFireBoost_PPLoss::
ppreduce
BattleScript_FlashFireBoost::
attackstring
- pause 0x20
+ pause B_WAIT_TIME_SHORT
printfromtable gFlashFireStringIds
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
goto BattleScript_MoveEnd
BattleScript_AbilityPreventsPhasingOut::
- pause 0x20
+ pause B_WAIT_TIME_SHORT
printstring STRINGID_PKMNANCHORSITSELFWITH
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
goto BattleScript_MoveEnd
BattleScript_AbilityNoStatLoss::
- pause 0x20
+ pause B_WAIT_TIME_SHORT
printstring STRINGID_PKMNPREVENTSSTATLOSSWITH
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
return
BattleScript_BRNPrevention::
- pause 0x20
+ pause B_WAIT_TIME_SHORT
printfromtable gBRNPreventionStringIds
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
return
BattleScript_PRLZPrevention::
- pause 0x20
+ pause B_WAIT_TIME_SHORT
printfromtable gPRLZPreventionStringIds
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
return
BattleScript_PSNPrevention::
- pause 0x20
+ pause B_WAIT_TIME_SHORT
printfromtable gPSNPreventionStringIds
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
return
BattleScript_ObliviousPreventsAttraction::
- pause 0x20
+ pause B_WAIT_TIME_SHORT
printstring STRINGID_PKMNPREVENTSROMANCEWITH
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
goto BattleScript_MoveEnd
BattleScript_FlinchPrevention::
- pause 0x20
+ pause B_WAIT_TIME_SHORT
printstring STRINGID_PKMNSXPREVENTSFLINCHING
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
goto BattleScript_MoveEnd
BattleScript_OwnTempoPrevents::
- pause 0x20
+ pause B_WAIT_TIME_SHORT
printstring STRINGID_PKMNPREVENTSCONFUSIONWITH
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
goto BattleScript_MoveEnd
BattleScript_SoundproofProtected::
attackstring
ppreduce
- pause 0x20
+ pause B_WAIT_TIME_SHORT
printstring STRINGID_PKMNSXBLOCKSY
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
goto BattleScript_MoveEnd
BattleScript_AbilityNoSpecificStatLoss::
- pause 0x20
+ pause B_WAIT_TIME_SHORT
printstring STRINGID_PKMNSXPREVENTSYLOSS
- waitmessage 0x40
- setbyte cMULTISTRING_CHOOSER, 0x3
+ waitmessage B_WAIT_TIME_LONG
+ setbyte cMULTISTRING_CHOOSER, B_MSG_STAT_FELL_EMPTY
return
BattleScript_StickyHoldActivates::
- pause 0x20
+ pause B_WAIT_TIME_SHORT
printstring STRINGID_PKMNSXMADEYINEFFECTIVE
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
goto BattleScript_MoveEnd
BattleScript_ColorChangeActivates::
printstring STRINGID_PKMNCHANGEDTYPEWITH
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
return
BattleScript_RoughSkinActivates::
@@ -4198,14 +4202,14 @@ BattleScript_RoughSkinActivates::
healthbarupdate BS_ATTACKER
datahpupdate BS_ATTACKER
printstring STRINGID_PKMNHURTSWITH
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
tryfaintmon BS_ATTACKER, FALSE, NULL
return
BattleScript_CuteCharmActivates::
status2animation BS_ATTACKER, STATUS2_INFATUATION
printstring STRINGID_PKMNSXINFATUATEDY
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
return
BattleScript_ApplySecondaryEffect::
@@ -4219,42 +4223,42 @@ BattleScript_SynchronizeActivates::
return
BattleScript_NoItemSteal::
- pause 0x20
+ pause B_WAIT_TIME_SHORT
printstring STRINGID_PKMNSXMADEYINEFFECTIVE
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
return
BattleScript_AbilityCuredStatus::
printstring STRINGID_PKMNSXCUREDITSYPROBLEM
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
updatestatusicon BS_SCRIPTING
return
BattleScript_IgnoresWhileAsleep::
printstring STRINGID_PKMNIGNORESASLEEP
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
moveendto MOVEEND_NEXT_TARGET
end
BattleScript_IgnoresAndUsesRandomMove::
printstring STRINGID_PKMNIGNOREDORDERS
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
jumptocalledmove FALSE
BattleScript_MoveUsedLoafingAround::
- jumpifbyte CMP_NOT_EQUAL, cMULTISTRING_CHOOSER, 0x4, BattleScript_82DB6C7
- setbyte gBattleCommunication, 0x0
+ jumpifbyte CMP_NOT_EQUAL, cMULTISTRING_CHOOSER, B_MSG_INCAPABLE_OF_POWER, BattleScript_MoveUsedLoafingAroundMsg
+ setbyte gBattleCommunication, 0
various24 BS_ATTACKER
- setbyte cMULTISTRING_CHOOSER, 0x4
-BattleScript_82DB6C7::
+ setbyte cMULTISTRING_CHOOSER, B_MSG_INCAPABLE_OF_POWER
+BattleScript_MoveUsedLoafingAroundMsg::
printfromtable gInobedientStringIds
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
moveendto MOVEEND_NEXT_TARGET
end
BattleScript_IgnoresAndFallsAsleep::
printstring STRINGID_PKMNBEGANTONAP
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
setmoveeffect MOVE_EFFECT_SLEEP | MOVE_EFFECT_AFFECTS_USER
seteffectprimary
moveendto MOVEEND_NEXT_TARGET
@@ -4262,7 +4266,7 @@ BattleScript_IgnoresAndFallsAsleep::
BattleScript_IgnoresAndHitsItself::
printstring STRINGID_PKMNWONTOBEY
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
goto BattleScript_DoSelfConfusionDmg
BattleScript_SubstituteFade::
@@ -4277,7 +4281,7 @@ BattleScript_BerryCurePrlzEnd2::
BattleScript_BerryCureParRet::
playanimation BS_SCRIPTING, B_ANIM_HELD_ITEM_EFFECT, NULL
printstring STRINGID_PKMNSITEMCUREDPARALYSIS
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
updatestatusicon BS_SCRIPTING
removeitem BS_SCRIPTING
return
@@ -4289,7 +4293,7 @@ BattleScript_BerryCurePsnEnd2::
BattleScript_BerryCurePsnRet::
playanimation BS_SCRIPTING, B_ANIM_HELD_ITEM_EFFECT, NULL
printstring STRINGID_PKMNSITEMCUREDPOISON
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
updatestatusicon BS_SCRIPTING
removeitem BS_SCRIPTING
return
@@ -4301,7 +4305,7 @@ BattleScript_BerryCureBrnEnd2::
BattleScript_BerryCureBrnRet::
playanimation BS_SCRIPTING, B_ANIM_HELD_ITEM_EFFECT, NULL
printstring STRINGID_PKMNSITEMHEALEDBURN
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
updatestatusicon BS_SCRIPTING
removeitem BS_SCRIPTING
return
@@ -4313,7 +4317,7 @@ BattleScript_BerryCureFrzEnd2::
BattleScript_BerryCureFrzRet::
playanimation BS_SCRIPTING, B_ANIM_HELD_ITEM_EFFECT, NULL
printstring STRINGID_PKMNSITEMDEFROSTEDIT
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
updatestatusicon BS_SCRIPTING
removeitem BS_SCRIPTING
return
@@ -4325,7 +4329,7 @@ BattleScript_BerryCureSlpEnd2::
BattleScript_BerryCureSlpRet::
playanimation BS_SCRIPTING, B_ANIM_HELD_ITEM_EFFECT, NULL
printstring STRINGID_PKMNSITEMWOKEIT
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
updatestatusicon BS_SCRIPTING
removeitem BS_SCRIPTING
return
@@ -4337,7 +4341,7 @@ BattleScript_BerryCureConfusionEnd2::
BattleScript_BerryCureConfusionRet::
playanimation BS_SCRIPTING, B_ANIM_HELD_ITEM_EFFECT, NULL
printstring STRINGID_PKMNSITEMSNAPPEDOUT
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
removeitem BS_SCRIPTING
return
@@ -4348,7 +4352,7 @@ BattleScript_BerryCureChosenStatusEnd2::
BattleScript_BerryCureChosenStatusRet::
playanimation BS_SCRIPTING, B_ANIM_HELD_ITEM_EFFECT, NULL
printfromtable gBerryEffectStringIds
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
updatestatusicon BS_SCRIPTING
removeitem BS_SCRIPTING
return
@@ -4360,14 +4364,14 @@ BattleScript_WhiteHerbEnd2::
BattleScript_WhiteHerbRet::
playanimation BS_SCRIPTING, B_ANIM_HELD_ITEM_EFFECT, NULL
printstring STRINGID_PKMNSITEMRESTOREDSTATUS
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
removeitem BS_SCRIPTING
return
BattleScript_ItemHealHP_RemoveItem::
playanimation BS_ATTACKER, B_ANIM_HELD_ITEM_EFFECT, NULL
printstring STRINGID_PKMNSITEMRESTOREDHEALTH
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE
healthbarupdate BS_ATTACKER
datahpupdate BS_ATTACKER
@@ -4377,7 +4381,7 @@ BattleScript_ItemHealHP_RemoveItem::
BattleScript_BerryPPHealEnd2::
playanimation BS_ATTACKER, B_ANIM_HELD_ITEM_EFFECT, NULL
printstring STRINGID_PKMNSITEMRESTOREDPP
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
removeitem BS_ATTACKER
end2
@@ -4388,7 +4392,7 @@ BattleScript_ItemHealHP_End2::
BattleScript_ItemHealHP_Ret::
playanimation BS_ATTACKER, B_ANIM_HELD_ITEM_EFFECT, NULL
printstring STRINGID_PKMNSITEMRESTOREDHPALITTLE
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE
healthbarupdate BS_ATTACKER
datahpupdate BS_ATTACKER
@@ -4401,18 +4405,18 @@ BattleScript_SelectingNotAllowedMoveChoiceItem::
BattleScript_FocusBandActivates::
playanimation BS_TARGET, B_ANIM_FOCUS_BAND, NULL
printstring STRINGID_PKMNHUNGONWITHX
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
return
BattleScript_BerryConfuseHealEnd2::
playanimation BS_ATTACKER, B_ANIM_HELD_ITEM_EFFECT, NULL
printstring STRINGID_PKMNSITEMRESTOREDHEALTH
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE
healthbarupdate BS_ATTACKER
datahpupdate BS_ATTACKER
printstring STRINGID_FORXCOMMAYZ
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
setmoveeffect MOVE_EFFECT_CONFUSION | MOVE_EFFECT_AFFECTS_USER
seteffectprimary
removeitem BS_ATTACKER
@@ -4420,9 +4424,9 @@ BattleScript_BerryConfuseHealEnd2::
BattleScript_BerryStatRaiseEnd2::
playanimation BS_ATTACKER, B_ANIM_HELD_ITEM_EFFECT, NULL
- statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR, BattleScript_82DB85B
-BattleScript_82DB85B::
- setbyte cMULTISTRING_CHOOSER, 0x4
+ statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR, BattleScript_BerryStatRaiseDoStatUp
+BattleScript_BerryStatRaiseDoStatUp::
+ setbyte cMULTISTRING_CHOOSER, B_MSG_STAT_ROSE_ITEM
call BattleScript_StatUp
removeitem BS_ATTACKER
end2
@@ -4430,7 +4434,7 @@ BattleScript_82DB85B::
BattleScript_BerryFocusEnergyEnd2::
playanimation BS_ATTACKER, B_ANIM_HELD_ITEM_EFFECT, NULL
printstring STRINGID_PKMNUSEDXTOGETPUMPED
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
removeitem BS_ATTACKER
end2
@@ -4448,7 +4452,7 @@ BattleScript_PalaceTryBattlerFlavorText::
palaceflavortext BS_ATTACKER @ BS_ATTACKER here overwritten by gBattleCommunication + 1
jumpifbyte CMP_NOT_EQUAL, gBattleCommunication, TRUE, BattleScript_PalaceEndFlavorText
printfromtable gBattlePalaceFlavorTextTable
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
BattleScript_PalaceEndFlavorText::
addbyte gBattleCommunication + 1, 1
jumpifbytenotequal gBattleCommunication + 1, gBattlersCount, BattleScript_PalaceTryBattlerFlavorText
@@ -4460,22 +4464,23 @@ BattleScript_ArenaTurnBeginning::
waitcry BS_ATTACKER
volumedown
playse SE_ARENA_TIMEUP1
- pause 0x8
+ pause 8
playse SE_ARENA_TIMEUP1
various14 BS_ATTACKER
- arenajudmengtstring 8
- arenawaitmessage 8
- pause 0x40
+ arenajudgmentstring B_MSG_REF_COMMENCE_BATTLE
+ arenawaitmessage B_MSG_REF_COMMENCE_BATTLE
+ pause B_WAIT_TIME_LONG
various15 BS_ATTACKER
volumeup
end2
-
-BattleScript_82DB8E0:: @ Unused battlescript
+
+@ Unused
+BattleScript_ArenaNothingDecided::
playse SE_DING_DONG
various14 BS_ATTACKER
- arenajudmengtstring BS_TARGET
- arenawaitmessage BS_TARGET
- pause 0x40
+ arenajudgmentstring B_MSG_REF_NOTHING_IS_DECIDED
+ arenawaitmessage B_MSG_REF_NOTHING_IS_DECIDED
+ pause B_WAIT_TIME_LONG
various15 BS_ATTACKER
end2
@@ -4486,34 +4491,34 @@ BattleScript_ArenaDoJudgment::
waitstate
volumedown
playse SE_ARENA_TIMEUP1
- pause 0x8
+ pause 8
playse SE_ARENA_TIMEUP1
- pause 0x40
+ pause B_WAIT_TIME_LONG
various14 BS_ATTACKER
- arenajudmengtstring 1
- arenawaitmessage 1
- pause 0x40
- setbyte gBattleCommunication, 0x0
+ arenajudgmentstring B_MSG_REF_THATS_IT
+ arenawaitmessage B_MSG_REF_THATS_IT
+ pause B_WAIT_TIME_LONG
+ setbyte gBattleCommunication, 0
arenajudgmentwindow
- pause 0x40
+ pause B_WAIT_TIME_LONG
arenajudgmentwindow
- arenajudmengtstring 2
- arenawaitmessage 2
+ arenajudgmentstring B_MSG_REF_JUDGE_MIND
+ arenawaitmessage B_MSG_REF_JUDGE_MIND
arenajudgmentwindow
- arenajudmengtstring 3
- arenawaitmessage 3
+ arenajudgmentstring B_MSG_REF_JUDGE_SKILL
+ arenawaitmessage B_MSG_REF_JUDGE_SKILL
arenajudgmentwindow
- arenajudmengtstring 4
- arenawaitmessage 4
+ arenajudgmentstring B_MSG_REF_JUDGE_BODY
+ arenawaitmessage B_MSG_REF_JUDGE_BODY
arenajudgmentwindow
- jumpifbyte CMP_EQUAL, gBattleCommunication + 1, 0x3, BattleScript_ArenaJudgmentPlayerLoses
- jumpifbyte CMP_EQUAL, gBattleCommunication + 1, 0x4, BattleScript_ArenaJudgmentDraw
- arenajudmengtstring 5
- arenawaitmessage 5
+ jumpifbyte CMP_EQUAL, gBattleCommunication + 1, 3, BattleScript_ArenaJudgmentPlayerLoses
+ jumpifbyte CMP_EQUAL, gBattleCommunication + 1, 4, BattleScript_ArenaJudgmentDraw
+ arenajudgmentstring B_MSG_REF_PLAYER_WON
+ arenawaitmessage B_MSG_REF_PLAYER_WON
arenajudgmentwindow
various15 BS_ATTACKER
printstring STRINGID_DEFEATEDOPPONENTBYREFEREE
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
playfaintcry BS_OPPONENT1
waitcry BS_ATTACKER
dofaintanimation BS_OPPONENT1
@@ -4522,12 +4527,12 @@ BattleScript_ArenaDoJudgment::
end2
BattleScript_ArenaJudgmentPlayerLoses:
- arenajudmengtstring 6
- arenawaitmessage 6
+ arenajudgmentstring B_MSG_REF_OPPONENT_WON
+ arenawaitmessage B_MSG_REF_OPPONENT_WON
arenajudgmentwindow
various15 BS_ATTACKER
printstring STRINGID_LOSTTOOPPONENTBYREFEREE
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
playfaintcry BS_PLAYER1
waitcry BS_ATTACKER
dofaintanimation BS_PLAYER1
@@ -4536,12 +4541,12 @@ BattleScript_ArenaJudgmentPlayerLoses:
end2
BattleScript_ArenaJudgmentDraw:
- arenajudmengtstring 7
- arenawaitmessage 7
+ arenajudgmentstring B_MSG_REF_DRAW
+ arenawaitmessage B_MSG_REF_DRAW
arenajudgmentwindow
various15 BS_ATTACKER
printstring STRINGID_TIEDOPPONENTBYREFEREE
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
playfaintcry BS_PLAYER1
waitcry BS_ATTACKER
dofaintanimation BS_PLAYER1
@@ -4560,12 +4565,12 @@ BattleScript_AskIfWantsToForfeitMatch::
BattleScript_PrintPlayerForfeited::
printstring STRINGID_FORFEITEDMATCH
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
end2
BattleScript_PrintPlayerForfeitedLinkBattle::
printstring STRINGID_FORFEITEDMATCH
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
endlinkbattle
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
end2
diff --git a/data/battle_scripts_2.s b/data/battle_scripts_2.s
index caa6cddac..996048dd3 100644
--- a/data/battle_scripts_2.s
+++ b/data/battle_scripts_2.s
@@ -34,7 +34,7 @@ gBattlescriptsForUsingItem:: @ 82DBD3C
.4byte BattleScript_OpponentUsesHealItem @ AI_ITEM_HEAL_HP
.4byte BattleScript_OpponentUsesStatusCureItem @ AI_ITEM_CURE_CONDITION
.4byte BattleScript_OpponentUsesXItem @ AI_ITEM_X_STAT
- .4byte BattleScript_OpponentUsesGuardSpecs @ AI_ITEM_GUARD_SPECS
+ .4byte BattleScript_OpponentUsesGuardSpec @ AI_ITEM_GUARD_SPEC
.align 2
gBattlescriptsForRunningByItem:: @ 82DBD54
@@ -69,16 +69,16 @@ BattleScript_PrintCaughtMonInfo::
trysetcaughtmondexflags BattleScript_TryNicknameCaughtMon
printstring STRINGID_PKMNDATAADDEDTODEX
waitstate
- setbyte gBattleCommunication, 0x0
+ setbyte gBattleCommunication, 0
displaydexinfo
BattleScript_TryNicknameCaughtMon::
printstring STRINGID_GIVENICKNAMECAPTURED
waitstate
- setbyte gBattleCommunication, 0x0
+ setbyte gBattleCommunication, 0
trygivecaughtmonnick BattleScript_GiveCaughtMonEnd
givecaughtmon
printfromtable gCaughtMonStringIds
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
goto BattleScript_SuccessBallThrowEnd
BattleScript_GiveCaughtMonEnd::
givecaughtmon
@@ -93,83 +93,78 @@ BattleScript_WallyBallThrow::
BattleScript_ShakeBallThrow::
printfromtable gBallEscapeStringIds
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
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
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
setbyte gBattleOutcome, B_OUTCOME_NO_SAFARI_BALLS
BattleScript_ShakeBallThrowEnd::
finishaction
BattleScript_TrainerBallBlock::
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
printstring STRINGID_TRAINERBLOCKEDBALL
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
printstring STRINGID_DONTBEATHIEF
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
finishaction
BattleScript_PlayerUsesItem::
- setbyte sMOVEEND_STATE, 0xF
- moveend 0x1, 0x0
+ moveendcase MOVEEND_MIRROR_MOVE
end
BattleScript_OpponentUsesHealItem::
printstring STRINGID_EMPTYSTRING3
- pause 0x30
+ pause B_WAIT_TIME_MED
playse SE_USE_ITEM
printstring STRINGID_TRAINER1USEDITEM
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
useitemonopponent
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE
healthbarupdate BS_ATTACKER
datahpupdate BS_ATTACKER
printstring STRINGID_PKMNSITEMRESTOREDHEALTH
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
updatestatusicon BS_ATTACKER
- setbyte sMOVEEND_STATE, 0xF
- moveend 0x1, 0x0
+ moveendcase MOVEEND_MIRROR_MOVE
finishaction
BattleScript_OpponentUsesStatusCureItem::
printstring STRINGID_EMPTYSTRING3
- pause 0x30
+ pause B_WAIT_TIME_MED
playse SE_USE_ITEM
printstring STRINGID_TRAINER1USEDITEM
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
useitemonopponent
printfromtable gTrainerItemCuredStatusStringIds
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
updatestatusicon BS_ATTACKER
- setbyte sMOVEEND_STATE, 0xF
- moveend 0x1, 0x0
+ moveendcase MOVEEND_MIRROR_MOVE
finishaction
BattleScript_OpponentUsesXItem::
printstring STRINGID_EMPTYSTRING3
- pause 0x30
+ pause B_WAIT_TIME_MED
playse SE_USE_ITEM
printstring STRINGID_TRAINER1USEDITEM
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
useitemonopponent
printfromtable gStatUpStringIds
- waitmessage 0x40
- setbyte sMOVEEND_STATE, 0xF
- moveend 0x1, 0x0
+ waitmessage B_WAIT_TIME_LONG
+ moveendcase MOVEEND_MIRROR_MOVE
finishaction
-BattleScript_OpponentUsesGuardSpecs::
+BattleScript_OpponentUsesGuardSpec::
printstring STRINGID_EMPTYSTRING3
- pause 0x30
+ pause B_WAIT_TIME_MED
playse SE_USE_ITEM
printstring STRINGID_TRAINER1USEDITEM
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
useitemonopponent
printfromtable gMistUsedStringIds
- waitmessage 0x40
- setbyte sMOVEEND_STATE, 0xF
- moveend 0x1, 0x0
+ waitmessage B_WAIT_TIME_LONG
+ moveendcase MOVEEND_MIRROR_MOVE
finishaction
BattleScript_RunByUsingItem::
@@ -179,29 +174,29 @@ BattleScript_RunByUsingItem::
BattleScript_ActionWatchesCarefully:
printstring STRINGID_PKMNWATCHINGCAREFULLY
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
end2
BattleScript_ActionGetNear:
printfromtable gSafariGetNearStringIds
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
end2
BattleScript_ActionThrowPokeblock:
printstring STRINGID_THREWPOKEBLOCKATPKMN
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
playanimation BS_ATTACKER, B_ANIM_POKEBLOCK_THROW, NULL
printfromtable gSafariPokeblockResultStringIds
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
end2
BattleScript_ActionWallyThrow:
printstring STRINGID_RETURNMON
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
returnatktoball
waitstate
trainerslidein BS_TARGET
waitstate
printstring STRINGID_YOUTHROWABALLNOWRIGHT
- waitmessage 0x40
+ waitmessage B_WAIT_TIME_LONG
end2
diff --git a/data/text/tv.inc b/data/text/tv.inc
index 72d391034..287ce7f00 100644
--- a/data/text/tv.inc
+++ b/data/text/tv.inc
@@ -2925,7 +2925,7 @@ gTVInSearchOfTrainersText08:: @ 0828C011
.string "That's all for today!\n"
.string "See you again on our next broadcast!$"
-gTVPokemonContestLiveUpdates2Text00:: @ 0828C137
+ContestLadyShow_Text_Intro:: @ 0828C137
.string "“POKéMON CONTEST LIVE UPDATES!”\p"
.string "MC: Sorry to interrupt the regular\n"
.string "programming, and thanks for joining us!\p"
@@ -2940,7 +2940,7 @@ gTVPokemonContestLiveUpdates2Text00:: @ 0828C137
.string "Spectators: ?!!!!\n"
.string "?!!!!$"
-gTVPokemonContestLiveUpdates2Text01:: @ 0828C28C
+ContestLadyShow_Text_Won:: @ 0828C28C
.string "MC: Excuse me!\n"
.string "Thanks for joining us on live TV!\p"
.string "May I congratulate you on your win?\p"
@@ -2959,7 +2959,7 @@ gTVPokemonContestLiveUpdates2Text01:: @ 0828C28C
.string "We did it!\l"
.string "Thank you!$"
-gTVPokemonContestLiveUpdates2Text02:: @ 0828C45B
+ContestLadyShow_Text_Lost:: @ 0828C45B
.string "MC: Excuse me!\n"
.string "Thanks for joining us on live TV!\p"
.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 "Thanks for tuning in!$"
-gTVPokemonContestLiveUpdates2Text03:: @ 0828C662
+ContestLadyShow_Text_LostBadly:: @ 0828C662
.string "MC: Excuse me!\n"
.string "Thanks for joining us on live TV!\p"
.string "How did your CONTEST appearance go?\p"
diff --git a/include/battle.h b/include/battle.h
index 954d33b07..14ecfbdd3 100644
--- a/include/battle.h
+++ b/include/battle.h
@@ -40,16 +40,17 @@
#define MAX_TRAINER_ITEMS 4
// array entries for battle communication
-#define MULTIUSE_STATE 0x0
-#define CURSOR_POSITION 0x1
-#define TASK_ID 0x1 // task Id and cursor position share the same field
-#define SPRITES_INIT_STATE1 0x1 // shares the Id as well
-#define SPRITES_INIT_STATE2 0x2
-#define MOVE_EFFECT_BYTE 0x3
-#define ACTIONS_CONFIRMED_COUNT 0x4
-#define MULTISTRING_CHOOSER 0x5
-#define MSG_DISPLAY 0x7
-#define BATTLE_COMMUNICATION_ENTRIES_COUNT 0x8
+#define MULTIUSE_STATE 0
+#define CURSOR_POSITION 1
+#define TASK_ID 1 // task Id and cursor position share the same field
+#define SPRITES_INIT_STATE1 1 // shares the Id as well
+#define SPRITES_INIT_STATE2 2
+#define MOVE_EFFECT_BYTE 3
+#define ACTIONS_CONFIRMED_COUNT 4
+#define MULTISTRING_CHOOSER 5
+#define MISS_TYPE 6
+#define MSG_DISPLAY 7
+#define BATTLE_COMMUNICATION_ENTRIES_COUNT 8
#define MOVE_TARGET_SELECTED 0x0
#define MOVE_TARGET_DEPENDS 0x1
diff --git a/include/battle_ai_switch_items.h b/include/battle_ai_switch_items.h
index 0a230e7f6..a0b6fe62c 100644
--- a/include/battle_ai_switch_items.h
+++ b/include/battle_ai_switch_items.h
@@ -7,10 +7,30 @@ enum
AI_ITEM_HEAL_HP,
AI_ITEM_CURE_CONDITION,
AI_ITEM_X_STAT,
- AI_ITEM_GUARD_SPECS,
+ AI_ITEM_GUARD_SPEC,
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);
u8 GetMostSuitableMonToSwitchInto(void);
diff --git a/include/battle_controllers.h b/include/battle_controllers.h
index da76ab0c6..34e916b0f 100644
--- a/include/battle_controllers.h
+++ b/include/battle_controllers.h
@@ -156,7 +156,7 @@ enum
CONTROLLER_CLEARUNKFLAG,
CONTROLLER_TOGGLEUNKFLAG,
CONTROLLER_HITANIMATION,
- CONTROLLER_42,
+ CONTROLLER_CANTSWITCH,
CONTROLLER_PLAYSE,
CONTROLLER_PLAYFANFAREORBGM,
CONTROLLER_FAINTINGCRY,
@@ -227,7 +227,7 @@ void BtlController_EmitSetUnkVar(u8 bufferId, u8 b); // unused
void BtlController_EmitClearUnkFlag(u8 bufferId); // unused
void BtlController_EmitToggleUnkFlag(u8 bufferId); // unused
void BtlController_EmitHitAnimation(u8 bufferId);
-void BtlController_EmitCmd42(u8 bufferId);
+void BtlController_EmitCantSwitch(u8 bufferId);
void BtlController_EmitPlaySE(u8 bufferId, u16 songId);
void BtlController_EmitPlayFanfareOrBGM(u8 bufferId, u16 songId, bool8 playBGM);
void BtlController_EmitFaintingCry(u8 bufferId);
diff --git a/include/battle_message.h b/include/battle_message.h
index 011a1cb0c..da3009d63 100644
--- a/include/battle_message.h
+++ b/include/battle_message.h
@@ -223,7 +223,6 @@ extern const u8* const gBattleStringsTable[];
extern const u8* const gStatNamesTable[];
extern const u8* const gPokeblockWasTooXStringTable[];
extern const u8* const gRefereeStringsTable[];
-extern const u8* const gStatNamesTable2[];
extern const u8 *const gRoundsStringTable[];
extern const u8 gText_PkmnIsEvolving[];
@@ -269,7 +268,7 @@ extern const u8 gText_Win[];
extern const u8 gText_Loss[];
extern const u8 gText_Draw[];
extern const u8 gText_StatRose[];
-extern const u8 gText_PkmnsStatChanged2[];
+extern const u8 gText_DefendersStatRose[];
extern const u8 gText_PkmnGettingPumped[];
extern const u8 gText_PkmnShroudedInMist[];
extern const u8 gText_PkmnsXPreventsSwitching[];
diff --git a/include/constants/battle.h b/include/constants/battle.h
index e6ebc85e4..3dbd83255 100644
--- a/include/constants/battle.h
+++ b/include/constants/battle.h
@@ -302,4 +302,8 @@
#define BATTLE_TERRAIN_BUILDING 8
#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
diff --git a/include/constants/battle_script_commands.h b/include/constants/battle_script_commands.h
index 9372377c4..9794589af 100644
--- a/include/constants/battle_script_commands.h
+++ b/include/constants/battle_script_commands.h
@@ -32,14 +32,17 @@
#define cEFFECT_CHOOSER gBattleCommunication + 3
#define cMULTISTRING_CHOOSER gBattleCommunication + 5
+#define cMISS_TYPE gBattleCommunication + 6
// Battle Script defines for getting the wanted battler
#define BS_TARGET 0
#define BS_ATTACKER 1
#define BS_EFFECT_BATTLER 2
#define BS_FAINTED 3
-#define BS_BATTLER_0 7
#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_NOT_ATTACKER_SIDE 9 // for Cmd_jumpifability
#define BS_SCRIPTING 10
@@ -54,12 +57,12 @@
#define ACC_CURR_MOVE 0
// compare operands
-#define CMP_EQUAL 0x0
-#define CMP_NOT_EQUAL 0x1
-#define CMP_GREATER_THAN 0x2
-#define CMP_LESS_THAN 0x3
-#define CMP_COMMON_BITS 0x4
-#define CMP_NO_COMMON_BITS 0x5
+#define CMP_EQUAL 0
+#define CMP_NOT_EQUAL 1
+#define CMP_GREATER_THAN 2
+#define CMP_LESS_THAN 3
+#define CMP_COMMON_BITS 4
+#define CMP_NO_COMMON_BITS 5
// Cmd_various
#define VARIOUS_CANCEL_MULTI_TURN_MOVES 0
@@ -92,27 +95,29 @@
#define DMG_DOUBLED 2
// Cmd_jumpifcantswitch
-#define SWITCH_IGNORE_ESCAPE_PREVENTION 0x80
+#define SWITCH_IGNORE_ESCAPE_PREVENTION (1 << 7)
// Cmd_statbuffchange
-#define STAT_BUFF_ALLOW_PTR 0x1 // If set, allow use of jumpptr. Set in every use of statbuffchange
-#define STAT_BUFF_NOT_PROTECT_AFFECTED 0x20
+#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 (1 << 5)
// stat change flags for Cmd_playstatchangeanimation
-#define STAT_CHANGE_NEGATIVE 0x1
-#define STAT_CHANGE_BY_TWO 0x2
-#define STAT_CHANGE_MULTIPLE_STATS 0x4
-#define STAT_CHANGE_CANT_PREVENT 0x8
+#define STAT_CHANGE_NEGATIVE (1 << 0)
+#define STAT_CHANGE_BY_TWO (1 << 1)
+#define STAT_CHANGE_MULTIPLE_STATS (1 << 2)
+#define STAT_CHANGE_CANT_PREVENT (1 << 3)
// stat flags for Cmd_playstatchangeanimation
-#define BIT_HP 0x1
-#define BIT_ATK 0x2
-#define BIT_DEF 0x4
-#define BIT_SPEED 0x8
-#define BIT_SPATK 0x10
-#define BIT_SPDEF 0x20
-#define BIT_ACC 0x40
-#define BIT_EVASION 0x80
+#define BIT_HP (1 << 0)
+#define BIT_ATK (1 << 1)
+#define BIT_DEF (1 << 2)
+#define BIT_SPEED (1 << 3)
+#define BIT_SPATK (1 << 4)
+#define BIT_SPDEF (1 << 5)
+#define BIT_ACC (1 << 6)
+#define BIT_EVASION (1 << 7)
+
+#define PARTY_SCREEN_OPTIONAL (1 << 7) // Flag for first argument to openpartyscreen
// cases for Cmd_moveend
#define MOVEEND_RAGE 0
diff --git a/include/constants/battle_string_ids.h b/include/constants/battle_string_ids.h
index 1886043f1..f22541272 100644
--- a/include/constants/battle_string_ids.h
+++ b/include/constants/battle_string_ids.h
@@ -214,10 +214,10 @@
#define STRINGID_STATROSE 210
#define STRINGID_STATHARSHLY 211
#define STRINGID_STATFELL 212
-#define STRINGID_PKMNSSTATCHANGED 213
-#define STRINGID_PKMNSSTATCHANGED2 214
-#define STRINGID_PKMNSSTATCHANGED3 215
-#define STRINGID_PKMNSSTATCHANGED4 216
+#define STRINGID_ATTACKERSSTATROSE 213
+#define STRINGID_DEFENDERSSTATROSE 214
+#define STRINGID_ATTACKERSSTATFELL 215
+#define STRINGID_DEFENDERSSTATFELL 216
#define STRINGID_CRITICALHIT 217
#define STRINGID_ONEHITKO 218
#define STRINGID_123POOF 219
@@ -326,7 +326,7 @@
#define STRINGID_SOOTHINGAROMA 322
#define STRINGID_ITEMSCANTBEUSEDNOW 323
#define STRINGID_FORXCOMMAYZ 324
-#define STRINGID_USINGXTHEYOFZN 325
+#define STRINGID_USINGITEMSTATOFPKMNROSE 325
#define STRINGID_PKMNUSEDXTOGETPUMPED 326
#define STRINGID_PKMNSXMADEYUSELESS 327
#define STRINGID_PKMNTRAPPEDBYSANDTOMB 328
@@ -383,4 +383,218 @@
#define STRINGID_TRAINER1WINTEXT 379
#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
diff --git a/include/constants/lilycove_lady.h b/include/constants/lilycove_lady.h
index 01f60ccf4..11b9b31e9 100644
--- a/include/constants/lilycove_lady.h
+++ b/include/constants/lilycove_lady.h
@@ -21,6 +21,12 @@
#define QUIZ_AUTHOR_NAME_PLAYER 1
#define QUIZ_AUTHOR_NAME_OTHER_PLAYER 2
-#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
diff --git a/include/constants/tv.h b/include/constants/tv.h
index 57da9837b..f7b091f49 100644
--- a/include/constants/tv.h
+++ b/include/constants/tv.h
@@ -19,7 +19,7 @@
#define TVSHOW_3_CHEERS_FOR_POKEBLOCKS 9
#define TVSHOW_BATTLE_UPDATE 10
#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_SMART_SHOPPER 22
@@ -215,4 +215,10 @@
#define TRENDWATCHER_STATE_BIGGER_FEMALE 5
#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
diff --git a/include/event_scripts.h b/include/event_scripts.h
index ecb40c266..122af54cc 100644
--- a/include/event_scripts.h
+++ b/include/event_scripts.h
@@ -344,10 +344,10 @@ extern const u8 gTVInSearchOfTrainersText05[];
extern const u8 gTVInSearchOfTrainersText06[];
extern const u8 gTVInSearchOfTrainersText07[];
extern const u8 gTVInSearchOfTrainersText08[];
-extern const u8 gTVPokemonContestLiveUpdates2Text00[];
-extern const u8 gTVPokemonContestLiveUpdates2Text01[];
-extern const u8 gTVPokemonContestLiveUpdates2Text02[];
-extern const u8 gTVPokemonContestLiveUpdates2Text03[];
+extern const u8 ContestLadyShow_Text_Intro[];
+extern const u8 ContestLadyShow_Text_Won[];
+extern const u8 ContestLadyShow_Text_Lost[];
+extern const u8 ContestLadyShow_Text_LostBadly[];
extern const u8 gPokeNewsTextSlateport_Upcoming[];
extern const u8 gPokeNewsTextSlateport_Ongoing[];
extern const u8 gPokeNewsTextSlateport_Ending[];
diff --git a/include/global.tv.h b/include/global.tv.h
index 8e1a898b6..64e6a984e 100644
--- a/include/global.tv.h
+++ b/include/global.tv.h
@@ -179,7 +179,7 @@ typedef union // size = 0x24
/*0x18*/ u8 idolNameLanguage;
} fanClubSpecial;
- // TVSHOW_CONTEST_LIVE_UPDATES_2
+ // TVSHOW_LILYCOVE_CONTEST_LADY
struct {
/*0x00*/ u8 kind;
/*0x01*/ bool8 active;
@@ -189,7 +189,7 @@ typedef union // size = 0x24
/*0x16*/ u8 pokeblockState;
/*0x17*/ u8 language;
/*0x18*/ u8 pokemonNameLanguage;
- } contestLiveUpdates2;
+ } contestLady;
// Record Mixing Shows
// TVSHOW_POKEMON_TODAY_CAUGHT
diff --git a/include/lilycove_lady.h b/include/lilycove_lady.h
index 1ec327be9..d3cce4ca8 100644
--- a/include/lilycove_lady.h
+++ b/include/lilycove_lady.h
@@ -12,6 +12,6 @@ void BufferContestLadyMonName(u8 *dest1, u8 *dest2);
void BufferContestLadyPlayerName(u8 *dest);
void BufferContestLadyLanguage(u8 *dest);
void BufferContestName(u8 *dest, u8 category);
-u8 sub_818E880(void);
+u8 GetContestLadyPokeblockState(void);
#endif //GUARD_LILYCOVE_LADY_H
diff --git a/src/battle_ai_switch_items.c b/src/battle_ai_switch_items.c
index 263c1e7cc..04122b17d 100644
--- a/src/battle_ai_switch_items.c
+++ b/src/battle_ai_switch_items.c
@@ -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)
return AI_ITEM_X_STAT;
else if (itemEffect[3] & ITEM3_GUARD_SPEC)
- return AI_ITEM_GUARD_SPECS;
+ return AI_ITEM_GUARD_SPEC;
else
return AI_ITEM_NOT_RECOGNIZABLE;
}
@@ -863,32 +863,33 @@ static bool8 ShouldUseItem(void)
*(gBattleStruct->AI_itemFlags + gActiveBattler / 2) = 0;
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;
}
- 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;
}
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;
}
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;
}
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;
}
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;
}
break;
@@ -897,20 +898,20 @@ static bool8 ShouldUseItem(void)
if (gDisableStructs[gActiveBattler].isFirstTurn == 0)
break;
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)
- *(gBattleStruct->AI_itemFlags + gActiveBattler / 2) |= 0x2;
+ *(gBattleStruct->AI_itemFlags + gActiveBattler / 2) |= (1 << AI_X_DEFEND);
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)
- *(gBattleStruct->AI_itemFlags + gActiveBattler / 2) |= 0x8;
+ *(gBattleStruct->AI_itemFlags + gActiveBattler / 2) |= (1 << AI_X_SPATK);
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)
- *(gBattleStruct->AI_itemFlags + gActiveBattler / 2) |= 0x80;
+ *(gBattleStruct->AI_itemFlags + gActiveBattler / 2) |= (1 << AI_DIRE_HIT);
shouldUse = TRUE;
break;
- case AI_ITEM_GUARD_SPECS:
+ case AI_ITEM_GUARD_SPEC:
battlerSide = GetBattlerSide(gActiveBattler);
if (gDisableStructs[gActiveBattler].isFirstTurn != 0 && gSideTimers[battlerSide].mistTimer == 0)
shouldUse = TRUE;
diff --git a/src/battle_controller_link_opponent.c b/src/battle_controller_link_opponent.c
index dd44bc91b..179ae18e8 100644
--- a/src/battle_controller_link_opponent.c
+++ b/src/battle_controller_link_opponent.c
@@ -74,7 +74,7 @@ static void LinkOpponentHandleSetUnkVar(void);
static void LinkOpponentHandleClearUnkFlag(void);
static void LinkOpponentHandleToggleUnkFlag(void);
static void LinkOpponentHandleHitAnimation(void);
-static void LinkOpponentHandleCmd42(void);
+static void LinkOpponentHandleCantSwitch(void);
static void LinkOpponentHandlePlaySE(void);
static void LinkOpponentHandlePlayFanfareOrBGM(void);
static void LinkOpponentHandleFaintingCry(void);
@@ -146,7 +146,7 @@ static void (*const sLinkOpponentBufferCommands[CONTROLLER_CMDS_COUNT])(void) =
[CONTROLLER_CLEARUNKFLAG] = LinkOpponentHandleClearUnkFlag,
[CONTROLLER_TOGGLEUNKFLAG] = LinkOpponentHandleToggleUnkFlag,
[CONTROLLER_HITANIMATION] = LinkOpponentHandleHitAnimation,
- [CONTROLLER_42] = LinkOpponentHandleCmd42,
+ [CONTROLLER_CANTSWITCH] = LinkOpponentHandleCantSwitch,
[CONTROLLER_PLAYSE] = LinkOpponentHandlePlaySE,
[CONTROLLER_PLAYFANFAREORBGM] = LinkOpponentHandlePlayFanfareOrBGM,
[CONTROLLER_FAINTINGCRY] = LinkOpponentHandleFaintingCry,
@@ -1647,7 +1647,7 @@ static void LinkOpponentHandleHitAnimation(void)
}
}
-static void LinkOpponentHandleCmd42(void)
+static void LinkOpponentHandleCantSwitch(void)
{
LinkOpponentBufferExecCompleted();
}
diff --git a/src/battle_controller_link_partner.c b/src/battle_controller_link_partner.c
index 3d6cd7c3b..2bb1cd914 100644
--- a/src/battle_controller_link_partner.c
+++ b/src/battle_controller_link_partner.c
@@ -72,7 +72,7 @@ static void LinkPartnerHandleSetUnkVar(void);
static void LinkPartnerHandleClearUnkFlag(void);
static void LinkPartnerHandleToggleUnkFlag(void);
static void LinkPartnerHandleHitAnimation(void);
-static void LinkPartnerHandleCmd42(void);
+static void LinkPartnerHandleCantSwitch(void);
static void LinkPartnerHandlePlaySE(void);
static void LinkPartnerHandlePlayFanfareOrBGM(void);
static void LinkPartnerHandleFaintingCry(void);
@@ -143,7 +143,7 @@ static void (*const sLinkPartnerBufferCommands[CONTROLLER_CMDS_COUNT])(void) =
[CONTROLLER_CLEARUNKFLAG] = LinkPartnerHandleClearUnkFlag,
[CONTROLLER_TOGGLEUNKFLAG] = LinkPartnerHandleToggleUnkFlag,
[CONTROLLER_HITANIMATION] = LinkPartnerHandleHitAnimation,
- [CONTROLLER_42] = LinkPartnerHandleCmd42,
+ [CONTROLLER_CANTSWITCH] = LinkPartnerHandleCantSwitch,
[CONTROLLER_PLAYSE] = LinkPartnerHandlePlaySE,
[CONTROLLER_PLAYFANFAREORBGM] = LinkPartnerHandlePlayFanfareOrBGM,
[CONTROLLER_FAINTINGCRY] = LinkPartnerHandleFaintingCry,
@@ -1477,7 +1477,7 @@ static void LinkPartnerHandleHitAnimation(void)
}
}
-static void LinkPartnerHandleCmd42(void)
+static void LinkPartnerHandleCantSwitch(void)
{
LinkPartnerBufferExecCompleted();
}
diff --git a/src/battle_controller_opponent.c b/src/battle_controller_opponent.c
index 69f729ee0..2c181c14f 100644
--- a/src/battle_controller_opponent.c
+++ b/src/battle_controller_opponent.c
@@ -79,7 +79,7 @@ static void OpponentHandleSetUnkVar(void);
static void OpponentHandleClearUnkFlag(void);
static void OpponentHandleToggleUnkFlag(void);
static void OpponentHandleHitAnimation(void);
-static void OpponentHandleCmd42(void);
+static void OpponentHandleCantSwitch(void);
static void OpponentHandlePlaySE(void);
static void OpponentHandlePlayFanfareOrBGM(void);
static void OpponentHandleFaintingCry(void);
@@ -151,7 +151,7 @@ static void (*const sOpponentBufferCommands[CONTROLLER_CMDS_COUNT])(void) =
[CONTROLLER_CLEARUNKFLAG] = OpponentHandleClearUnkFlag,
[CONTROLLER_TOGGLEUNKFLAG] = OpponentHandleToggleUnkFlag,
[CONTROLLER_HITANIMATION] = OpponentHandleHitAnimation,
- [CONTROLLER_42] = OpponentHandleCmd42,
+ [CONTROLLER_CANTSWITCH] = OpponentHandleCantSwitch,
[CONTROLLER_PLAYSE] = OpponentHandlePlaySE,
[CONTROLLER_PLAYFANFAREORBGM] = OpponentHandlePlayFanfareOrBGM,
[CONTROLLER_FAINTINGCRY] = OpponentHandleFaintingCry,
@@ -1813,7 +1813,7 @@ static void OpponentHandleHitAnimation(void)
}
}
-static void OpponentHandleCmd42(void)
+static void OpponentHandleCantSwitch(void)
{
OpponentBufferExecCompleted();
}
diff --git a/src/battle_controller_player.c b/src/battle_controller_player.c
index 7b5e55adb..e7801d0e4 100644
--- a/src/battle_controller_player.c
+++ b/src/battle_controller_player.c
@@ -80,7 +80,7 @@ static void PlayerHandleSetUnkVar(void);
static void PlayerHandleClearUnkFlag(void);
static void PlayerHandleToggleUnkFlag(void);
static void PlayerHandleHitAnimation(void);
-static void PlayerHandleCmd42(void);
+static void PlayerHandleCantSwitch(void);
static void PlayerHandlePlaySE(void);
static void PlayerHandlePlayFanfareOrBGM(void);
static void PlayerHandleFaintingCry(void);
@@ -167,7 +167,7 @@ static void (*const sPlayerBufferCommands[CONTROLLER_CMDS_COUNT])(void) =
[CONTROLLER_CLEARUNKFLAG] = PlayerHandleClearUnkFlag,
[CONTROLLER_TOGGLEUNKFLAG] = PlayerHandleToggleUnkFlag,
[CONTROLLER_HITANIMATION] = PlayerHandleHitAnimation,
- [CONTROLLER_42] = PlayerHandleCmd42,
+ [CONTROLLER_CANTSWITCH] = PlayerHandleCantSwitch,
[CONTROLLER_PLAYSE] = PlayerHandlePlaySE,
[CONTROLLER_PLAYFANFAREORBGM] = PlayerHandlePlayFanfareOrBGM,
[CONTROLLER_FAINTINGCRY] = PlayerHandleFaintingCry,
@@ -2890,7 +2890,7 @@ static void PlayerHandleHitAnimation(void)
}
}
-static void PlayerHandleCmd42(void)
+static void PlayerHandleCantSwitch(void)
{
PlayerBufferExecCompleted();
}
diff --git a/src/battle_controller_player_partner.c b/src/battle_controller_player_partner.c
index 251542a48..cc433a9b2 100644
--- a/src/battle_controller_player_partner.c
+++ b/src/battle_controller_player_partner.c
@@ -70,7 +70,7 @@ static void PlayerPartnerHandleSetUnkVar(void);
static void PlayerPartnerHandleClearUnkFlag(void);
static void PlayerPartnerHandleToggleUnkFlag(void);
static void PlayerPartnerHandleHitAnimation(void);
-static void PlayerPartnerHandleCmd42(void);
+static void PlayerPartnerHandleCantSwitch(void);
static void PlayerPartnerHandlePlaySE(void);
static void PlayerPartnerHandlePlayFanfareOrBGM(void);
static void PlayerPartnerHandleFaintingCry(void);
@@ -146,7 +146,7 @@ static void (*const sPlayerPartnerBufferCommands[CONTROLLER_CMDS_COUNT])(void) =
[CONTROLLER_CLEARUNKFLAG] = PlayerPartnerHandleClearUnkFlag,
[CONTROLLER_TOGGLEUNKFLAG] = PlayerPartnerHandleToggleUnkFlag,
[CONTROLLER_HITANIMATION] = PlayerPartnerHandleHitAnimation,
- [CONTROLLER_42] = PlayerPartnerHandleCmd42,
+ [CONTROLLER_CANTSWITCH] = PlayerPartnerHandleCantSwitch,
[CONTROLLER_PLAYSE] = PlayerPartnerHandlePlaySE,
[CONTROLLER_PLAYFANFAREORBGM] = PlayerPartnerHandlePlayFanfareOrBGM,
[CONTROLLER_FAINTINGCRY] = PlayerPartnerHandleFaintingCry,
@@ -1727,7 +1727,7 @@ static void PlayerPartnerHandleHitAnimation(void)
}
}
-static void PlayerPartnerHandleCmd42(void)
+static void PlayerPartnerHandleCantSwitch(void)
{
PlayerPartnerBufferExecCompleted();
}
diff --git a/src/battle_controller_recorded_opponent.c b/src/battle_controller_recorded_opponent.c
index 26d93ad28..663d71ec7 100644
--- a/src/battle_controller_recorded_opponent.c
+++ b/src/battle_controller_recorded_opponent.c
@@ -74,7 +74,7 @@ static void RecordedOpponentHandleSetUnkVar(void);
static void RecordedOpponentHandleClearUnkFlag(void);
static void RecordedOpponentHandleToggleUnkFlag(void);
static void RecordedOpponentHandleHitAnimation(void);
-static void RecordedOpponentHandleCmd42(void);
+static void RecordedOpponentHandleCantSwitch(void);
static void RecordedOpponentHandlePlaySE(void);
static void RecordedOpponentHandlePlayFanfareOrBGM(void);
static void RecordedOpponentHandleFaintingCry(void);
@@ -146,7 +146,7 @@ static void (*const sRecordedOpponentBufferCommands[CONTROLLER_CMDS_COUNT])(void
[CONTROLLER_CLEARUNKFLAG] = RecordedOpponentHandleClearUnkFlag,
[CONTROLLER_TOGGLEUNKFLAG] = RecordedOpponentHandleToggleUnkFlag,
[CONTROLLER_HITANIMATION] = RecordedOpponentHandleHitAnimation,
- [CONTROLLER_42] = RecordedOpponentHandleCmd42,
+ [CONTROLLER_CANTSWITCH] = RecordedOpponentHandleCantSwitch,
[CONTROLLER_PLAYSE] = RecordedOpponentHandlePlaySE,
[CONTROLLER_PLAYFANFAREORBGM] = RecordedOpponentHandlePlayFanfareOrBGM,
[CONTROLLER_FAINTINGCRY] = RecordedOpponentHandleFaintingCry,
@@ -1587,7 +1587,7 @@ static void RecordedOpponentHandleHitAnimation(void)
}
}
-static void RecordedOpponentHandleCmd42(void)
+static void RecordedOpponentHandleCantSwitch(void)
{
RecordedOpponentBufferExecCompleted();
}
diff --git a/src/battle_controller_recorded_player.c b/src/battle_controller_recorded_player.c
index 63a04ac40..aa4154a3f 100644
--- a/src/battle_controller_recorded_player.c
+++ b/src/battle_controller_recorded_player.c
@@ -70,7 +70,7 @@ static void RecordedPlayerHandleSetUnkVar(void);
static void RecordedPlayerHandleClearUnkFlag(void);
static void RecordedPlayerHandleToggleUnkFlag(void);
static void RecordedPlayerHandleHitAnimation(void);
-static void RecordedPlayerHandleCmd42(void);
+static void RecordedPlayerHandleCantSwitch(void);
static void RecordedPlayerHandlePlaySE(void);
static void RecordedPlayerHandlePlayFanfareOrBGM(void);
static void RecordedPlayerHandleFaintingCry(void);
@@ -141,7 +141,7 @@ static void (*const sRecordedPlayerBufferCommands[CONTROLLER_CMDS_COUNT])(void)
[CONTROLLER_CLEARUNKFLAG] = RecordedPlayerHandleClearUnkFlag,
[CONTROLLER_TOGGLEUNKFLAG] = RecordedPlayerHandleToggleUnkFlag,
[CONTROLLER_HITANIMATION] = RecordedPlayerHandleHitAnimation,
- [CONTROLLER_42] = RecordedPlayerHandleCmd42,
+ [CONTROLLER_CANTSWITCH] = RecordedPlayerHandleCantSwitch,
[CONTROLLER_PLAYSE] = RecordedPlayerHandlePlaySE,
[CONTROLLER_PLAYFANFAREORBGM] = RecordedPlayerHandlePlayFanfareOrBGM,
[CONTROLLER_FAINTINGCRY] = RecordedPlayerHandleFaintingCry,
@@ -1610,7 +1610,7 @@ static void RecordedPlayerHandleHitAnimation(void)
}
}
-static void RecordedPlayerHandleCmd42(void)
+static void RecordedPlayerHandleCantSwitch(void)
{
RecordedPlayerBufferExecCompleted();
}
diff --git a/src/battle_controller_safari.c b/src/battle_controller_safari.c
index 22c01586d..0fdf32fb6 100644
--- a/src/battle_controller_safari.c
+++ b/src/battle_controller_safari.c
@@ -67,7 +67,7 @@ static void SafariHandleSetUnkVar(void);
static void SafariHandleClearUnkFlag(void);
static void SafariHandleToggleUnkFlag(void);
static void SafariHandleHitAnimation(void);
-static void SafariHandleCmd42(void);
+static void SafariHandleCantSwitch(void);
static void SafariHandlePlaySE(void);
static void SafariHandlePlayFanfareOrBGM(void);
static void SafariHandleFaintingCry(void);
@@ -131,7 +131,7 @@ static void (*const sSafariBufferCommands[CONTROLLER_CMDS_COUNT])(void) =
[CONTROLLER_CLEARUNKFLAG] = SafariHandleClearUnkFlag,
[CONTROLLER_TOGGLEUNKFLAG] = SafariHandleToggleUnkFlag,
[CONTROLLER_HITANIMATION] = SafariHandleHitAnimation,
- [CONTROLLER_42] = SafariHandleCmd42,
+ [CONTROLLER_CANTSWITCH] = SafariHandleCantSwitch,
[CONTROLLER_PLAYSE] = SafariHandlePlaySE,
[CONTROLLER_PLAYFANFAREORBGM] = SafariHandlePlayFanfareOrBGM,
[CONTROLLER_FAINTINGCRY] = SafariHandleFaintingCry,
@@ -580,7 +580,7 @@ static void SafariHandleHitAnimation(void)
SafariBufferExecCompleted();
}
-static void SafariHandleCmd42(void)
+static void SafariHandleCantSwitch(void)
{
SafariBufferExecCompleted();
}
diff --git a/src/battle_controller_wally.c b/src/battle_controller_wally.c
index 8b3863c85..0d1515213 100644
--- a/src/battle_controller_wally.c
+++ b/src/battle_controller_wally.c
@@ -75,7 +75,7 @@ static void WallyHandleSetUnkVar(void);
static void WallyHandleClearUnkFlag(void);
static void WallyHandleToggleUnkFlag(void);
static void WallyHandleHitAnimation(void);
-static void WallyHandleCmd42(void);
+static void WallyHandleCantSwitch(void);
static void WallyHandlePlaySE(void);
static void WallyHandlePlayFanfareOrBGM(void);
static void WallyHandleFaintingCry(void);
@@ -144,7 +144,7 @@ static void (*const sWallyBufferCommands[CONTROLLER_CMDS_COUNT])(void) =
[CONTROLLER_CLEARUNKFLAG] = WallyHandleClearUnkFlag,
[CONTROLLER_TOGGLEUNKFLAG] = WallyHandleToggleUnkFlag,
[CONTROLLER_HITANIMATION] = WallyHandleHitAnimation,
- [CONTROLLER_42] = WallyHandleCmd42,
+ [CONTROLLER_CANTSWITCH] = WallyHandleCantSwitch,
[CONTROLLER_PLAYSE] = WallyHandlePlaySE,
[CONTROLLER_PLAYFANFAREORBGM] = WallyHandlePlayFanfareOrBGM,
[CONTROLLER_FAINTINGCRY] = WallyHandleFaintingCry,
@@ -190,7 +190,7 @@ static void WallyHandleActions(void)
switch (gBattleStruct->wallyBattleState)
{
case 0:
- gBattleStruct->wallyWaitFrames = 64;
+ gBattleStruct->wallyWaitFrames = B_WAIT_TIME_LONG;
gBattleStruct->wallyBattleState++;
case 1:
if (--gBattleStruct->wallyWaitFrames == 0)
@@ -200,7 +200,7 @@ static void WallyHandleActions(void)
WallyBufferExecCompleted();
gBattleStruct->wallyBattleState++;
gBattleStruct->wallyMovesState = 0;
- gBattleStruct->wallyWaitFrames = 64;
+ gBattleStruct->wallyWaitFrames = B_WAIT_TIME_LONG;
}
break;
case 2:
@@ -211,17 +211,17 @@ static void WallyHandleActions(void)
WallyBufferExecCompleted();
gBattleStruct->wallyBattleState++;
gBattleStruct->wallyMovesState = 0;
- gBattleStruct->wallyWaitFrames = 64;
+ gBattleStruct->wallyWaitFrames = B_WAIT_TIME_LONG;
}
break;
case 3:
if (--gBattleStruct->wallyWaitFrames == 0)
{
- BtlController_EmitTwoReturnValues(1, 9, 0);
+ BtlController_EmitTwoReturnValues(1, B_ACTION_WALLY_THROW, 0);
WallyBufferExecCompleted();
gBattleStruct->wallyBattleState++;
gBattleStruct->wallyMovesState = 0;
- gBattleStruct->wallyWaitFrames = 64;
+ gBattleStruct->wallyWaitFrames = B_WAIT_TIME_LONG;
}
break;
case 4:
@@ -230,7 +230,7 @@ static void WallyHandleActions(void)
PlaySE(SE_SELECT);
ActionSelectionDestroyCursorAt(0);
ActionSelectionCreateCursorAt(1, 0);
- gBattleStruct->wallyWaitFrames = 64;
+ gBattleStruct->wallyWaitFrames = B_WAIT_TIME_LONG;
gBattleStruct->wallyBattleState++;
}
break;
@@ -1385,7 +1385,7 @@ static void WallyHandleHitAnimation(void)
}
}
-static void WallyHandleCmd42(void)
+static void WallyHandleCantSwitch(void)
{
WallyBufferExecCompleted();
}
diff --git a/src/battle_controllers.c b/src/battle_controllers.c
index a9f3ab610..0f3234579 100644
--- a/src/battle_controllers.c
+++ b/src/battle_controllers.c
@@ -1385,12 +1385,12 @@ void BtlController_EmitHitAnimation(u8 bufferId)
PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, 4);
}
-void BtlController_EmitCmd42(u8 bufferId)
+void BtlController_EmitCantSwitch(u8 bufferId)
{
- sBattleBuffersTransferData[0] = CONTROLLER_42;
- sBattleBuffersTransferData[1] = CONTROLLER_42;
- sBattleBuffersTransferData[2] = CONTROLLER_42;
- sBattleBuffersTransferData[3] = CONTROLLER_42;
+ sBattleBuffersTransferData[0] = CONTROLLER_CANTSWITCH;
+ sBattleBuffersTransferData[1] = CONTROLLER_CANTSWITCH;
+ sBattleBuffersTransferData[2] = CONTROLLER_CANTSWITCH;
+ sBattleBuffersTransferData[3] = CONTROLLER_CANTSWITCH;
PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, 4);
}
diff --git a/src/battle_main.c b/src/battle_main.c
index 9bb2268a6..8a85c27f5 100644
--- a/src/battle_main.c
+++ b/src/battle_main.c
@@ -3959,7 +3959,7 @@ u8 IsRunningFromBattleImpossible(void)
{
gBattleScripting.battler = i;
gLastUsedAbility = gBattleMons[i].ability;
- gBattleCommunication[MULTISTRING_CHOOSER] = 2;
+ gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_PREVENTS_ESCAPE;
return 2;
}
if (side != GetBattlerSide(i)
@@ -3969,7 +3969,7 @@ u8 IsRunningFromBattleImpossible(void)
{
gBattleScripting.battler = i;
gLastUsedAbility = gBattleMons[i].ability;
- gBattleCommunication[MULTISTRING_CHOOSER] = 2;
+ gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_PREVENTS_ESCAPE;
return 2;
}
}
@@ -3978,18 +3978,18 @@ u8 IsRunningFromBattleImpossible(void)
{
gBattleScripting.battler = i - 1;
gLastUsedAbility = gBattleMons[i - 1].ability;
- gBattleCommunication[MULTISTRING_CHOOSER] = 2;
+ gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_PREVENTS_ESCAPE;
return 2;
}
if ((gBattleMons[gActiveBattler].status2 & (STATUS2_ESCAPE_PREVENTION | STATUS2_WRAPPED))
|| (gStatuses3[gActiveBattler] & STATUS3_ROOTED))
{
- gBattleCommunication[MULTISTRING_CHOOSER] = 0;
+ gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_CANT_ESCAPE;
return 1;
}
if (gBattleTypeFlags & BATTLE_TYPE_FIRST_BATTLE)
{
- gBattleCommunication[MULTISTRING_CHOOSER] = 1;
+ gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_DONT_LEAVE_BIRCH;
return 1;
}
return 0;
diff --git a/src/battle_message.c b/src/battle_message.c
index 219a33bb9..2e752dcca 100644
--- a/src/battle_message.c
+++ b/src/battle_message.c
@@ -305,11 +305,11 @@ static const u8 sText_StatSharply[] = _("sharply ");
const u8 gText_StatRose[] = _("rose!");
static const u8 sText_StatHarshly[] = _("harshly ");
static const u8 sText_StatFell[] = _("fell!");
-static const u8 sText_PkmnsStatChanged[] = _("{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}");
-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_PkmnsStatChanged3[] = _("{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_AttackersStatRose[] = _("{B_ATK_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_UsingItemTheStatOfPkmnRose[] = _("Using {B_LAST_ITEM}, the {B_BUFF1}\nof {B_SCR_ACTIVE_NAME_WITH_PREFIX} {B_BUFF2}");
+static const u8 sText_AttackersStatFell[] = _("{B_ATK_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_StatsWontDecrease2[] = _("{B_DEF_NAME_WITH_PREFIX}'s stats won't\ngo any lower!");
static const u8 sText_CriticalHit[] = _("A critical hit!");
@@ -721,10 +721,10 @@ const u8 * const gBattleStringsTable[BATTLESTRINGS_COUNT] =
[STRINGID_STATROSE - 12] = gText_StatRose,
[STRINGID_STATHARSHLY - 12] = sText_StatHarshly,
[STRINGID_STATFELL - 12] = sText_StatFell,
- [STRINGID_PKMNSSTATCHANGED - 12] = sText_PkmnsStatChanged,
- [STRINGID_PKMNSSTATCHANGED2 - 12] = gText_PkmnsStatChanged2,
- [STRINGID_PKMNSSTATCHANGED3 - 12] = sText_PkmnsStatChanged3,
- [STRINGID_PKMNSSTATCHANGED4 - 12] = sText_PkmnsStatChanged4,
+ [STRINGID_ATTACKERSSTATROSE - 12] = sText_AttackersStatRose,
+ [STRINGID_DEFENDERSSTATROSE - 12] = gText_DefendersStatRose,
+ [STRINGID_ATTACKERSSTATFELL - 12] = sText_AttackersStatFell,
+ [STRINGID_DEFENDERSSTATFELL - 12] = sText_DefendersStatFell,
[STRINGID_CRITICALHIT - 12] = sText_CriticalHit,
[STRINGID_ONEHITKO - 12] = sText_OneHitKO,
[STRINGID_123POOF - 12] = sText_123Poof,
@@ -833,7 +833,7 @@ const u8 * const gBattleStringsTable[BATTLESTRINGS_COUNT] =
[STRINGID_SOOTHINGAROMA - 12] = sText_SoothingAroma,
[STRINGID_ITEMSCANTBEUSEDNOW - 12] = sText_ItemsCantBeUsedNow,
[STRINGID_FORXCOMMAYZ - 12] = sText_ForXCommaYZ,
- [STRINGID_USINGXTHEYOFZN - 12] = sText_UsingXTheYOfZN,
+ [STRINGID_USINGITEMSTATOFPKMNROSE - 12] = sText_UsingItemTheStatOfPkmnRose,
[STRINGID_PKMNUSEDXTOGETPUMPED - 12] = sText_PkmnUsedXToGetPumped,
[STRINGID_PKMNSXMADEYUSELESS - 12] = sText_PkmnsXMadeYUseless,
[STRINGID_PKMNTRAPPEDBYSANDTOMB - 12] = sText_PkmnTrappedBySandTomb,
@@ -893,112 +893,149 @@ const u8 * const gBattleStringsTable[BATTLESTRINGS_COUNT] =
const u16 gMissStringIds[] =
{
- STRINGID_ATTACKMISSED, STRINGID_PKMNPROTECTEDITSELF,
- STRINGID_PKMNAVOIDEDATTACK, STRINGID_AVOIDEDDAMAGE,
- STRINGID_PKMNMAKESGROUNDMISS
+ [B_MSG_MISSED] = STRINGID_ATTACKMISSED,
+ [B_MSG_PROTECTED] = STRINGID_PKMNPROTECTEDITSELF,
+ [B_MSG_AVOIDED_ATK] = STRINGID_PKMNAVOIDEDATTACK,
+ [B_MSG_AVOIDED_DMG] = STRINGID_AVOIDEDDAMAGE,
+ [B_MSG_GROUND_MISS] = STRINGID_PKMNMAKESGROUNDMISS
};
const u16 gNoEscapeStringIds[] =
{
- STRINGID_CANTESCAPE, STRINGID_DONTLEAVEBIRCH, STRINGID_PREVENTSESCAPE,
- STRINGID_CANTESCAPE2, STRINGID_ATTACKERCANTESCAPE
+ [B_MSG_CANT_ESCAPE] = STRINGID_CANTESCAPE,
+ [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[] =
{
- STRINGID_STARTEDTORAIN, STRINGID_DOWNPOURSTARTED, STRINGID_BUTITFAILED,
- STRINGID_SANDSTORMBREWED, STRINGID_SUNLIGHTGOTBRIGHT, STRINGID_STARTEDHAIL
+ [B_MSG_STARTED_RAIN] = STRINGID_STARTEDTORAIN,
+ [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[] =
{
- STRINGID_SANDSTORMRAGES, STRINGID_HAILCONTINUES
+ [B_MSG_SANDSTORM] = STRINGID_SANDSTORMRAGES,
+ [B_MSG_HAIL] = STRINGID_HAILCONTINUES
};
const u16 gSandStormHailDmgStringIds[] =
{
- STRINGID_PKMNBUFFETEDBYSANDSTORM, STRINGID_PKMNPELTEDBYHAIL
+ [B_MSG_SANDSTORM] = STRINGID_PKMNBUFFETEDBYSANDSTORM,
+ [B_MSG_HAIL] = STRINGID_PKMNPELTEDBYHAIL
};
const u16 gSandStormHailEndStringIds[] =
{
- STRINGID_SANDSTORMSUBSIDED, STRINGID_HAILSTOPPED
+ [B_MSG_SANDSTORM] = STRINGID_SANDSTORMSUBSIDED,
+ [B_MSG_HAIL] = STRINGID_HAILSTOPPED
};
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[] =
{
- 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[] =
{
- STRINGID_BUTITFAILED, STRINGID_PKMNRAISEDDEF, STRINGID_PKMNRAISEDDEFALITTLE,
- STRINGID_PKMNRAISEDSPDEF, STRINGID_PKMNRAISEDSPDEFALITTLE, STRINGID_PKMNCOVEREDBYVEIL
+ [B_MSG_SIDE_STATUS_FAILED] = STRINGID_BUTITFAILED,
+ [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[] =
{
- STRINGID_PKMNSEEDED, STRINGID_PKMNEVADEDATTACK,
- STRINGID_ITDOESNTAFFECT, STRINGID_PKMNSAPPEDBYLEECHSEED, STRINGID_ITSUCKEDLIQUIDOOZE,
+ [B_MSG_LEECH_SEED_SET] = STRINGID_PKMNSEEDED,
+ [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[] =
{
- STRINGID_PKMNWENTTOSLEEP, STRINGID_PKMNSLEPTHEALTHY
+ [B_MSG_REST] = STRINGID_PKMNWENTTOSLEEP,
+ [B_MSG_REST_STATUSED] = STRINGID_PKMNSLEPTHEALTHY
};
const u16 gUproarOverTurnStringIds[] =
{
- STRINGID_PKMNMAKINGUPROAR, STRINGID_PKMNCALMEDDOWN
+ [B_MSG_UPROAR_CONTINUES] = STRINGID_PKMNMAKINGUPROAR,
+ [B_MSG_UPROAR_ENDS] = STRINGID_PKMNCALMEDDOWN
};
const u16 gStockpileUsedStringIds[] =
{
- STRINGID_PKMNSTOCKPILED, STRINGID_PKMNCANTSTOCKPILE,
+ [B_MSG_STOCKPILED] = STRINGID_PKMNSTOCKPILED,
+ [B_MSG_CANT_STOCKPILE] = STRINGID_PKMNCANTSTOCKPILE,
};
const u16 gWokeUpStringIds[] =
{
- STRINGID_PKMNWOKEUP, STRINGID_PKMNWOKEUPINUPROAR
+ [B_MSG_WOKE_UP] = STRINGID_PKMNWOKEUP,
+ [B_MSG_WOKE_UP_UPROAR] = STRINGID_PKMNWOKEUPINUPROAR
};
const u16 gSwallowFailStringIds[] =
{
- STRINGID_FAILEDTOSWALLOW, STRINGID_PKMNHPFULL
+ [B_MSG_SWALLOW_FAILED] = STRINGID_FAILEDTOSWALLOW,
+ [B_MSG_SWALLOW_FULL_HP] = STRINGID_PKMNHPFULL
};
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[] =
{
- STRINGID_PKMNSSTATCHANGED, STRINGID_PKMNSSTATCHANGED2, STRINGID_STATSWONTINCREASE,
- STRINGID_EMPTYSTRING3, STRINGID_USINGXTHEYOFZN, STRINGID_PKMNUSEDXTOGETPUMPED
+ [B_MSG_ATTACKER_STAT_ROSE] = STRINGID_ATTACKERSSTATROSE,
+ [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[] =
{
- 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
const u16 gFirstTurnOfTwoStringIds[] =
{
- STRINGID_PKMNWHIPPEDWHIRLWIND, // MOVE_RAZOR_WIND
- STRINGID_PKMNTOOKSUNLIGHT, // MOVE_SOLAR_BEAM
- STRINGID_PKMNLOWEREDHEAD, // MOVE_SKULL_BASH
- STRINGID_PKMNISGLOWING, // MOVE_SKY_ATTACK
- STRINGID_PKMNFLEWHIGH, // MOVE_FLY
- STRINGID_PKMNDUGHOLE, // MOVE_DIG
- STRINGID_PKMNHIDUNDERWATER, // MOVE_DIVE
- STRINGID_PKMNSPRANGUP // MOVE_BOUNCE
+ [B_MSG_TURN1_RAZOR_WIND] = STRINGID_PKMNWHIPPEDWHIRLWIND,
+ [B_MSG_TURN1_SOLAR_BEAM] = STRINGID_PKMNTOOKSUNLIGHT,
+ [B_MSG_TURN1_SKULL_BASH] = STRINGID_PKMNLOWEREDHEAD,
+ [B_MSG_TURN1_SKY_ATTACK] = STRINGID_PKMNISGLOWING,
+ [B_MSG_TURN1_FLY] = STRINGID_PKMNFLEWHIGH,
+ [B_MSG_TURN1_DIG] = STRINGID_PKMNDUGHOLE,
+ [B_MSG_TURN1_DIVE] = STRINGID_PKMNHIDUNDERWATER,
+ [B_MSG_TURN1_BOUNCE] = STRINGID_PKMNSPRANGUP,
};
// Index copied from move's index in gTrappingMoves
@@ -1014,89 +1051,109 @@ const u16 gWrappedStringIds[] =
const u16 gMistUsedStringIds[] =
{
- STRINGID_PKMNSHROUDEDINMIST, STRINGID_BUTITFAILED
+ [B_MSG_SET_MIST] = STRINGID_PKMNSHROUDEDINMIST,
+ [B_MSG_MIST_FAILED] = STRINGID_BUTITFAILED
};
const u16 gFocusEnergyUsedStringIds[] =
{
- STRINGID_PKMNGETTINGPUMPED, STRINGID_BUTITFAILED
+ [B_MSG_GETTING_PUMPED] = STRINGID_PKMNGETTINGPUMPED,
+ [B_MSG_FOCUS_ENERGY_FAILED] = STRINGID_BUTITFAILED
};
const u16 gTransformUsedStringIds[] =
{
- STRINGID_PKMNTRANSFORMEDINTO, STRINGID_BUTITFAILED
+ [B_MSG_TRANSFORMED] = STRINGID_PKMNTRANSFORMEDINTO,
+ [B_MSG_TRANSFORM_FAILED] = STRINGID_BUTITFAILED
};
const u16 gSubsituteUsedStringIds[] =
{
- STRINGID_PKMNMADESUBSTITUTE, STRINGID_TOOWEAKFORSUBSTITUTE
+ [B_MSG_SET_SUBSTITUTE] = STRINGID_PKMNMADESUBSTITUTE,
+ [B_MSG_SUBSTITUTE_FAILED] = STRINGID_TOOWEAKFORSUBSTITUTE
};
const u16 gGotPoisonedStringIds[] =
{
- STRINGID_PKMNWASPOISONED, STRINGID_PKMNPOISONEDBY
+ [B_MSG_STATUSED] = STRINGID_PKMNWASPOISONED,
+ [B_MSG_STATUSED_BY_ABILITY] = STRINGID_PKMNPOISONEDBY
};
const u16 gGotParalyzedStringIds[] =
{
- STRINGID_PKMNWASPARALYZED, STRINGID_PKMNWASPARALYZEDBY
+ [B_MSG_STATUSED] = STRINGID_PKMNWASPARALYZED,
+ [B_MSG_STATUSED_BY_ABILITY] = STRINGID_PKMNWASPARALYZEDBY
};
const u16 gFellAsleepStringIds[] =
{
- STRINGID_PKMNFELLASLEEP, STRINGID_PKMNMADESLEEP,
+ [B_MSG_STATUSED] = STRINGID_PKMNFELLASLEEP,
+ [B_MSG_STATUSED_BY_ABILITY] = STRINGID_PKMNMADESLEEP,
};
const u16 gGotBurnedStringIds[] =
{
- STRINGID_PKMNWASBURNED, STRINGID_PKMNBURNEDBY
+ [B_MSG_STATUSED] = STRINGID_PKMNWASBURNED,
+ [B_MSG_STATUSED_BY_ABILITY] = STRINGID_PKMNBURNEDBY
};
const u16 gGotFrozenStringIds[] =
{
- STRINGID_PKMNWASFROZEN, STRINGID_PKMNFROZENBY
+ [B_MSG_STATUSED] = STRINGID_PKMNWASFROZEN,
+ [B_MSG_STATUSED_BY_ABILITY] = STRINGID_PKMNFROZENBY
};
const u16 gGotDefrostedStringIds[] =
{
- STRINGID_PKMNWASDEFROSTED2, STRINGID_PKMNWASDEFROSTEDBY
+ [B_MSG_DEFROSTED] = STRINGID_PKMNWASDEFROSTED2,
+ [B_MSG_DEFROSTED_BY_MOVE] = STRINGID_PKMNWASDEFROSTEDBY
};
const u16 gKOFailedStringIds[] =
{
- STRINGID_ATTACKMISSED, STRINGID_PKMNUNAFFECTED
+ [B_MSG_KO_MISS] = STRINGID_ATTACKMISSED,
+ [B_MSG_KO_UNAFFECTED] = STRINGID_PKMNUNAFFECTED
};
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[] =
{
- STRINGID_ELECTRICITYWEAKENED, STRINGID_FIREWEAKENED
+ [B_MSG_WEAKEN_ELECTRIC] = STRINGID_ELECTRICITYWEAKENED,
+ [B_MSG_WEAKEN_FIRE] = STRINGID_FIREWEAKENED
};
const u16 gPartyStatusHealStringIds[] =
{
- STRINGID_BELLCHIMED, STRINGID_BELLCHIMED, STRINGID_BELLCHIMED, STRINGID_BELLCHIMED,
- // interesting how there are four instances of the same string
- STRINGID_SOOTHINGAROMA
+ [B_MSG_BELL] = STRINGID_BELLCHIMED,
+ [B_MSG_BELL_SOUNDPROOF_ATTACKER] = STRINGID_BELLCHIMED,
+ [B_MSG_BELL_SOUNDPROOF_PARTNER] = STRINGID_BELLCHIMED,
+ [B_MSG_BELL_BOTH_SOUNDPROOF] = STRINGID_BELLCHIMED,
+ [B_MSG_SOOTHING_AROMA] = STRINGID_SOOTHINGAROMA
};
const u16 gFutureMoveUsedStringIds[] =
{
- STRINGID_PKMNFORESAWATTACK, STRINGID_PKMNCHOSEXASDESTINY
+ [B_MSG_FUTURE_SIGHT] = STRINGID_PKMNFORESAWATTACK,
+ [B_MSG_DOOM_DESIRE] = STRINGID_PKMNCHOSEXASDESTINY
};
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."
@@ -1122,59 +1179,82 @@ const u16 gWeatherStartsStringIds[] =
const u16 gInobedientStringIds[] =
{
- STRINGID_PKMNLOAFING, STRINGID_PKMNWONTOBEY, STRINGID_PKMNTURNEDAWAY,
- STRINGID_PKMNPRETENDNOTNOTICE, STRINGID_PKMNINCAPABLEOFPOWER
+ [B_MSG_LOAFING] = STRINGID_PKMNLOAFING,
+ [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[] =
{
- STRINGID_CREPTCLOSER, STRINGID_CANTGETCLOSER
+ [B_MSG_CREPT_CLOSER] = STRINGID_CREPTCLOSER,
+ [B_MSG_CANT_GET_CLOSER] = STRINGID_CANTGETCLOSER
};
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[] =
{
- STRINGID_PKMNSITEMSNAPPEDOUT, STRINGID_PKMNSITEMCUREDPARALYSIS, STRINGID_PKMNSITEMDEFROSTEDIT,
- STRINGID_PKMNSITEMHEALEDBURN, STRINGID_PKMNSITEMCUREDPOISON, STRINGID_PKMNSITEMWOKEIT
+ [AI_HEAL_CONFUSION] = STRINGID_PKMNSITEMSNAPPEDOUT,
+ [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[] =
{
- STRINGID_PKMNSITEMCUREDPROBLEM, STRINGID_PKMNSITEMNORMALIZEDSTATUS
+ [B_MSG_CURED_PROBLEM] = STRINGID_PKMNSITEMCUREDPROBLEM,
+ [B_MSG_NORMALIZED_STATUS] = STRINGID_PKMNSITEMNORMALIZEDSTATUS
};
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[] =
{
- 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[] =
{
- 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[] =
{
- 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[] =
{
- STRINGID_PKMNRAISEDFIREPOWERWITH, STRINGID_PKMNSXMADEYINEFFECTIVE
+ [B_MSG_FLASH_FIRE_BOOST] = STRINGID_PKMNRAISEDFIREPOWERWITH,
+ [B_MSG_FLASH_FIRE_NO_BOOST] = STRINGID_PKMNSXMADEYINEFFECTIVE
};
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[] =
@@ -1216,7 +1296,8 @@ static const u8 sText_Defense[] = _("DEFENSE");
static const u8 sText_SpAtk[] = _("SP. ATK");
static const u8 sText_SpDef[] = _("SP. DEF");
-const u8 * const gStatNamesTable2[] =
+// Unused
+static const u8 * const sStatNamesTable2[] =
{
sText_HP, sText_SpAtk, sText_Attack,
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[] =
{
- STRINGID_GLINTAPPEARSINEYE,
- STRINGID_PKMNGETTINGINTOPOSITION,
- STRINGID_PKMNBEGANGROWLINGDEEPLY,
- STRINGID_PKMNEAGERFORMORE
+ [B_MSG_GLINT_IN_EYE] = STRINGID_GLINTAPPEARSINEYE,
+ [B_MSG_GETTING_IN_POS] = STRINGID_PKMNGETTINGINTOPOSITION,
+ [B_MSG_GROWL_DEEPLY] = STRINGID_PKMNBEGANGROWLINGDEEPLY,
+ [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!");
@@ -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_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_RefJudgement1[] = _("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_RefJudgement3[] = _("REFEREE: Judgment: 3 to 3!\nWe have a draw!\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_RefOpponentWon[] = _("REFEREE: Judgment: {B_BUFF1} to {B_BUFF2}!\nThe winner is {B_TRAINER1_NAME}'s {B_OPPONENT_MON1_NAME}!\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_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!");
@@ -1330,15 +1411,15 @@ static const u8 sText_RefCommenceBattle[] = _("REFEREE: {B_PLAYER_MON1_NAME} VS
const u8 * const gRefereeStringsTable[] =
{
- sText_RefIfNothingIsDecided,
- sText_RefThatsIt,
- sText_RefJudgeMind,
- sText_RefJudgeSkill,
- sText_RefJudgeBody,
- sText_RefJudgement1,
- sText_RefJudgement2,
- sText_RefJudgement3,
- sText_RefCommenceBattle,
+ [B_MSG_REF_NOTHING_IS_DECIDED] = sText_RefIfNothingIsDecided,
+ [B_MSG_REF_THATS_IT] = sText_RefThatsIt,
+ [B_MSG_REF_JUDGE_MIND] = sText_RefJudgeMind,
+ [B_MSG_REF_JUDGE_SKILL] = sText_RefJudgeSkill,
+ [B_MSG_REF_JUDGE_BODY] = sText_RefJudgeBody,
+ [B_MSG_REF_PLAYER_WON] = sText_RefPlayerWon,
+ [B_MSG_REF_OPPONENT_WON] = sText_RefOpponentWon,
+ [B_MSG_REF_DRAW] = sText_RefDraw,
+ [B_MSG_REF_COMMENCE_BATTLE] = sText_RefCommenceBattle,
};
static const u8 sText_QuestionForfeitMatch[] = _("Would you like to forfeit the match\nand quit now?");
diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c
index 8f89a02b3..33c6ce0e5 100644
--- a/src/battle_script_commands.c
+++ b/src/battle_script_commands.c
@@ -876,34 +876,33 @@ const ALIGNED(4) u8 gBattlePalaceNatureToMoveGroupLikelihood[NUM_NATURES][4] =
[NATURE_QUIRKY] = PALACE_STYLE(56, 22, 56, 22) // 22%, 22%
};
-// Indices into gBattlePalaceFlavorTextTable
static const u8 sBattlePalaceNatureToFlavorTextId[NUM_NATURES] =
{
- [NATURE_HARDY] = 3,
- [NATURE_LONELY] = 0,
- [NATURE_BRAVE] = 1,
- [NATURE_ADAMANT] = 0,
- [NATURE_NAUGHTY] = 0,
- [NATURE_BOLD] = 1,
- [NATURE_DOCILE] = 3,
- [NATURE_RELAXED] = 0,
- [NATURE_IMPISH] = 1,
- [NATURE_LAX] = 2,
- [NATURE_TIMID] = 2,
- [NATURE_HASTY] = 0,
- [NATURE_SERIOUS] = 3,
- [NATURE_JOLLY] = 1,
- [NATURE_NAIVE] = 3,
- [NATURE_MODEST] = 1,
- [NATURE_MILD] = 2,
- [NATURE_QUIET] = 3,
- [NATURE_BASHFUL] = 3,
- [NATURE_RASH] = 2,
- [NATURE_CALM] = 1,
- [NATURE_GENTLE] = 0,
- [NATURE_SASSY] = 2,
- [NATURE_CAREFUL] = 2,
- [NATURE_QUIRKY] = 3,
+ [NATURE_HARDY] = B_MSG_EAGER_FOR_MORE,
+ [NATURE_LONELY] = B_MSG_GLINT_IN_EYE,
+ [NATURE_BRAVE] = B_MSG_GETTING_IN_POS,
+ [NATURE_ADAMANT] = B_MSG_GLINT_IN_EYE,
+ [NATURE_NAUGHTY] = B_MSG_GLINT_IN_EYE,
+ [NATURE_BOLD] = B_MSG_GETTING_IN_POS,
+ [NATURE_DOCILE] = B_MSG_EAGER_FOR_MORE,
+ [NATURE_RELAXED] = B_MSG_GLINT_IN_EYE,
+ [NATURE_IMPISH] = B_MSG_GETTING_IN_POS,
+ [NATURE_LAX] = B_MSG_GROWL_DEEPLY,
+ [NATURE_TIMID] = B_MSG_GROWL_DEEPLY,
+ [NATURE_HASTY] = B_MSG_GLINT_IN_EYE,
+ [NATURE_SERIOUS] = B_MSG_EAGER_FOR_MORE,
+ [NATURE_JOLLY] = B_MSG_GETTING_IN_POS,
+ [NATURE_NAIVE] = B_MSG_EAGER_FOR_MORE,
+ [NATURE_MODEST] = B_MSG_GETTING_IN_POS,
+ [NATURE_MILD] = B_MSG_GROWL_DEEPLY,
+ [NATURE_QUIET] = B_MSG_EAGER_FOR_MORE,
+ [NATURE_BASHFUL] = B_MSG_EAGER_FOR_MORE,
+ [NATURE_RASH] = B_MSG_GROWL_DEEPLY,
+ [NATURE_CALM] = B_MSG_GETTING_IN_POS,
+ [NATURE_GENTLE] = B_MSG_GLINT_IN_EYE,
+ [NATURE_SASSY] = B_MSG_GROWL_DEEPLY,
+ [NATURE_CAREFUL] = B_MSG_GROWL_DEEPLY,
+ [NATURE_QUIRKY] = B_MSG_EAGER_FOR_MORE,
};
static void Cmd_attackcanceler(void)
@@ -991,7 +990,7 @@ static void Cmd_attackcanceler(void)
gMoveResultFlags |= MOVE_RESULT_MISSED;
gLastLandedMoves[gBattlerTarget] = 0;
gLastHitByType[gBattlerTarget] = 0;
- gBattleCommunication[6] = 1;
+ gBattleCommunication[MISS_TYPE] = B_MSG_PROTECTED;
gBattlescriptCurrInstr++;
}
else
@@ -1024,7 +1023,7 @@ static void Cmd_jumpifaffectedbyprotect(void)
{
gMoveResultFlags |= MOVE_RESULT_MISSED;
JumpIfMoveFailed(5, 0);
- gBattleCommunication[6] = 1;
+ gBattleCommunication[MISS_TYPE] = B_MSG_PROTECTED;
}
else
{
@@ -1039,7 +1038,7 @@ bool8 JumpIfMoveAffectedByProtect(u16 move)
{
gMoveResultFlags |= MOVE_RESULT_MISSED;
JumpIfMoveFailed(7, move);
- gBattleCommunication[6] = 1;
+ gBattleCommunication[MISS_TYPE] = B_MSG_PROTECTED;
affected = TRUE;
}
return affected;
@@ -1172,9 +1171,9 @@ static void Cmd_accuracycheck(void)
gMoveResultFlags |= MOVE_RESULT_MISSED;
if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE &&
(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
- gBattleCommunication[6] = 0;
+ gBattleCommunication[MISS_TYPE] = B_MSG_MISSED;
CheckWonderGuardAndLevitate();
}
@@ -1370,7 +1369,7 @@ static void Cmd_typecalc(void)
gMoveResultFlags |= (MOVE_RESULT_MISSED | MOVE_RESULT_DOESNT_AFFECT_FOE);
gLastLandedMoves[gBattlerTarget] = 0;
gLastHitByType[gBattlerTarget] = 0;
- gBattleCommunication[6] = moveType;
+ gBattleCommunication[MISS_TYPE] = B_MSG_GROUND_MISS;
RecordAbilityBattle(gBattlerTarget, gLastUsedAbility);
}
else
@@ -1406,7 +1405,7 @@ static void Cmd_typecalc(void)
gMoveResultFlags |= MOVE_RESULT_MISSED;
gLastLandedMoves[gBattlerTarget] = 0;
gLastHitByType[gBattlerTarget] = 0;
- gBattleCommunication[6] = 3;
+ gBattleCommunication[MISS_TYPE] = B_MSG_AVOIDED_DMG;
RecordAbilityBattle(gBattlerTarget, gLastUsedAbility);
}
if (gMoveResultFlags & MOVE_RESULT_DOESNT_AFFECT_FOE)
@@ -1429,7 +1428,7 @@ static void CheckWonderGuardAndLevitate(void)
if (gBattleMons[gBattlerTarget].ability == ABILITY_LEVITATE && moveType == TYPE_GROUND)
{
gLastUsedAbility = ABILITY_LEVITATE;
- gBattleCommunication[6] = moveType;
+ gBattleCommunication[MISS_TYPE] = B_MSG_GROUND_MISS;
RecordAbilityBattle(gBattlerTarget, ABILITY_LEVITATE);
return;
}
@@ -1484,7 +1483,7 @@ static void CheckWonderGuardAndLevitate(void)
if (((flags & 2) || !(flags & 1)) && gBattleMoves[gCurrentMove].power)
{
gLastUsedAbility = ABILITY_WONDER_GUARD;
- gBattleCommunication[6] = 3;
+ gBattleCommunication[MISS_TYPE] = B_MSG_AVOIDED_DMG;
RecordAbilityBattle(gBattlerTarget, ABILITY_WONDER_GUARD);
}
}
@@ -2019,9 +2018,9 @@ static void Cmd_resultmessage(void)
if (gBattleControllerExecFlags)
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;
}
else
@@ -2273,12 +2272,12 @@ void SetMoveEffect(bool8 primary, u8 certain)
if (gHitMarker & HITMARKER_IGNORE_SAFEGUARD)
{
- gBattleCommunication[MULTISTRING_CHOOSER] = 1;
+ gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_ABILITY_PREVENTS_ABILITY_STATUS;
gHitMarker &= ~(HITMARKER_IGNORE_SAFEGUARD);
}
else
{
- gBattleCommunication[MULTISTRING_CHOOSER] = 0;
+ gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_ABILITY_PREVENTS_MOVE_STATUS;
}
RESET_RETURN
}
@@ -2289,7 +2288,7 @@ void SetMoveEffect(bool8 primary, u8 certain)
BattleScriptPush(gBattlescriptCurrInstr + 1);
gBattlescriptCurrInstr = BattleScript_PSNPrevention;
- gBattleCommunication[MULTISTRING_CHOOSER] = 2;
+ gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_STATUS_HAD_NO_EFFECT;
RESET_RETURN
}
if (IS_BATTLER_OF_TYPE(gEffectBattler, TYPE_POISON))
@@ -2314,12 +2313,12 @@ void SetMoveEffect(bool8 primary, u8 certain)
gBattlescriptCurrInstr = BattleScript_BRNPrevention;
if (gHitMarker & HITMARKER_IGNORE_SAFEGUARD)
{
- gBattleCommunication[MULTISTRING_CHOOSER] = 1;
+ gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_ABILITY_PREVENTS_ABILITY_STATUS;
gHitMarker &= ~(HITMARKER_IGNORE_SAFEGUARD);
}
else
{
- gBattleCommunication[MULTISTRING_CHOOSER] = 0;
+ gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_ABILITY_PREVENTS_MOVE_STATUS;
}
RESET_RETURN
}
@@ -2330,7 +2329,7 @@ void SetMoveEffect(bool8 primary, u8 certain)
BattleScriptPush(gBattlescriptCurrInstr + 1);
gBattlescriptCurrInstr = BattleScript_BRNPrevention;
- gBattleCommunication[MULTISTRING_CHOOSER] = 2;
+ gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_STATUS_HAD_NO_EFFECT;
RESET_RETURN
}
if (IS_BATTLER_OF_TYPE(gEffectBattler, TYPE_FIRE))
@@ -2370,12 +2369,12 @@ void SetMoveEffect(bool8 primary, u8 certain)
if (gHitMarker & HITMARKER_IGNORE_SAFEGUARD)
{
- gBattleCommunication[MULTISTRING_CHOOSER] = 1;
+ gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_ABILITY_PREVENTS_ABILITY_STATUS;
gHitMarker &= ~(HITMARKER_IGNORE_SAFEGUARD);
}
else
{
- gBattleCommunication[MULTISTRING_CHOOSER] = 0;
+ gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_ABILITY_PREVENTS_MOVE_STATUS;
}
RESET_RETURN
}
@@ -2398,12 +2397,12 @@ void SetMoveEffect(bool8 primary, u8 certain)
if (gHitMarker & HITMARKER_IGNORE_SAFEGUARD)
{
- gBattleCommunication[MULTISTRING_CHOOSER] = 1;
+ gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_ABILITY_PREVENTS_ABILITY_STATUS;
gHitMarker &= ~(HITMARKER_IGNORE_SAFEGUARD);
}
else
{
- gBattleCommunication[MULTISTRING_CHOOSER] = 0;
+ gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_ABILITY_PREVENTS_MOVE_STATUS;
}
RESET_RETURN
}
@@ -2414,7 +2413,7 @@ void SetMoveEffect(bool8 primary, u8 certain)
BattleScriptPush(gBattlescriptCurrInstr + 1);
gBattlescriptCurrInstr = BattleScript_PSNPrevention;
- gBattleCommunication[MULTISTRING_CHOOSER] = 2;
+ gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_STATUS_HAD_NO_EFFECT;
RESET_RETURN
}
if (gBattleMons[gEffectBattler].status1)
@@ -2453,12 +2452,12 @@ void SetMoveEffect(bool8 primary, u8 certain)
if (gHitMarker & HITMARKER_IGNORE_SAFEGUARD)
{
- gBattleCommunication[MULTISTRING_CHOOSER] = 1;
+ gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_STATUSED_BY_ABILITY;
gHitMarker &= ~(HITMARKER_IGNORE_SAFEGUARD);
}
else
{
- gBattleCommunication[MULTISTRING_CHOOSER] = 0;
+ gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_STATUSED;
}
// for synchronize
@@ -3579,7 +3578,7 @@ static void MoveValuesCleanUp(void)
gBattleScripting.dmgMultiplier = 1;
gCritMultiplier = 1;
gBattleCommunication[MOVE_EFFECT_BYTE] = 0;
- gBattleCommunication[6] = 0;
+ gBattleCommunication[MISS_TYPE] = 0;
gHitMarker &= ~(HITMARKER_DESTINYBOND);
gHitMarker &= ~(HITMARKER_SYNCHRONISE_EFFECT);
}
@@ -4459,7 +4458,7 @@ static void Cmd_typecalc2(void)
gLastUsedAbility = gBattleMons[gBattlerTarget].ability;
gMoveResultFlags |= (MOVE_RESULT_MISSED | MOVE_RESULT_DOESNT_AFFECT_FOE);
gLastLandedMoves[gBattlerTarget] = 0;
- gBattleCommunication[6] = moveType;
+ gBattleCommunication[MISS_TYPE] = B_MSG_GROUND_MISS;
RecordAbilityBattle(gBattlerTarget, gLastUsedAbility);
}
else
@@ -4534,7 +4533,7 @@ static void Cmd_typecalc2(void)
gLastUsedAbility = ABILITY_WONDER_GUARD;
gMoveResultFlags |= MOVE_RESULT_MISSED;
gLastLandedMoves[gBattlerTarget] = 0;
- gBattleCommunication[6] = 3;
+ gBattleCommunication[MISS_TYPE] = B_MSG_AVOIDED_DMG;
RecordAbilityBattle(gBattlerTarget, gLastUsedAbility);
}
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->monToSwitchIntoId + gActiveBattler) = PARTY_SIZE;
@@ -4823,7 +4824,7 @@ static void Cmd_openpartyscreen(void)
flags = 0;
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)
{
@@ -4831,7 +4832,7 @@ static void Cmd_openpartyscreen(void)
{
if (gHitMarker & HITMARKER_FAINTED(gActiveBattler))
{
- if (HasNoMonsToSwitch(gActiveBattler, 6, 6))
+ if (HasNoMonsToSwitch(gActiveBattler, PARTY_SIZE, PARTY_SIZE))
{
gAbsentBattlerFlags |= gBitTable[gActiveBattler];
gHitMarker &= ~(HITMARKER_FAINTED(gActiveBattler));
@@ -4840,7 +4841,7 @@ static void Cmd_openpartyscreen(void)
}
else if (!gSpecialStatuses[gActiveBattler].flag40)
{
- sub_804CF10(PARTY_SIZE);
+ ChooseMonToSendOut(PARTY_SIZE);
gSpecialStatuses[gActiveBattler].flag40 = 1;
}
}
@@ -4860,16 +4861,16 @@ static void Cmd_openpartyscreen(void)
if (gBitTable[0] & hitmarkerFaintBits)
{
gActiveBattler = 0;
- if (HasNoMonsToSwitch(0, 6, 6))
+ if (HasNoMonsToSwitch(0, PARTY_SIZE, PARTY_SIZE))
{
gAbsentBattlerFlags |= gBitTable[gActiveBattler];
gHitMarker &= ~(HITMARKER_FAINTED(gActiveBattler));
- BtlController_EmitCmd42(0);
+ BtlController_EmitCantSwitch(0);
MarkBattlerForControllerExec(gActiveBattler);
}
else if (!gSpecialStatuses[gActiveBattler].flag40)
{
- sub_804CF10(gBattleStruct->monToSwitchIntoId[2]);
+ ChooseMonToSendOut(gBattleStruct->monToSwitchIntoId[2]);
gSpecialStatuses[gActiveBattler].flag40 = 1;
}
else
@@ -4882,16 +4883,16 @@ static void Cmd_openpartyscreen(void)
if (gBitTable[2] & hitmarkerFaintBits && !(gBitTable[0] & hitmarkerFaintBits))
{
gActiveBattler = 2;
- if (HasNoMonsToSwitch(2, 6, 6))
+ if (HasNoMonsToSwitch(2, PARTY_SIZE, PARTY_SIZE))
{
gAbsentBattlerFlags |= gBitTable[gActiveBattler];
gHitMarker &= ~(HITMARKER_FAINTED(gActiveBattler));
- BtlController_EmitCmd42(0);
+ BtlController_EmitCantSwitch(0);
MarkBattlerForControllerExec(gActiveBattler);
}
else if (!gSpecialStatuses[gActiveBattler].flag40)
{
- sub_804CF10(gBattleStruct->monToSwitchIntoId[0]);
+ ChooseMonToSendOut(gBattleStruct->monToSwitchIntoId[0]);
gSpecialStatuses[gActiveBattler].flag40 = 1;
}
else if (!(flags & 1))
@@ -4903,16 +4904,16 @@ static void Cmd_openpartyscreen(void)
if (gBitTable[1] & hitmarkerFaintBits)
{
gActiveBattler = 1;
- if (HasNoMonsToSwitch(1, 6, 6))
+ if (HasNoMonsToSwitch(1, PARTY_SIZE, PARTY_SIZE))
{
gAbsentBattlerFlags |= gBitTable[gActiveBattler];
gHitMarker &= ~(HITMARKER_FAINTED(gActiveBattler));
- BtlController_EmitCmd42(0);
+ BtlController_EmitCantSwitch(0);
MarkBattlerForControllerExec(gActiveBattler);
}
else if (!gSpecialStatuses[gActiveBattler].flag40)
{
- sub_804CF10(gBattleStruct->monToSwitchIntoId[3]);
+ ChooseMonToSendOut(gBattleStruct->monToSwitchIntoId[3]);
gSpecialStatuses[gActiveBattler].flag40 = 1;
}
else
@@ -4925,16 +4926,16 @@ static void Cmd_openpartyscreen(void)
if (gBitTable[3] & hitmarkerFaintBits && !(gBitTable[1] & hitmarkerFaintBits))
{
gActiveBattler = 3;
- if (HasNoMonsToSwitch(3, 6, 6))
+ if (HasNoMonsToSwitch(3, PARTY_SIZE, PARTY_SIZE))
{
gAbsentBattlerFlags |= gBitTable[gActiveBattler];
gHitMarker &= ~(HITMARKER_FAINTED(gActiveBattler));
- BtlController_EmitCmd42(0);
+ BtlController_EmitCantSwitch(0);
MarkBattlerForControllerExec(gActiveBattler);
}
else if (!gSpecialStatuses[gActiveBattler].flag40)
{
- sub_804CF10(gBattleStruct->monToSwitchIntoId[1]);
+ ChooseMonToSendOut(gBattleStruct->monToSwitchIntoId[1]);
gSpecialStatuses[gActiveBattler].flag40 = 1;
}
else if (!(flags & 2))
@@ -4978,7 +4979,7 @@ static void Cmd_openpartyscreen(void)
}
gBattlescriptCurrInstr += 6;
}
- else if (gBattlescriptCurrInstr[1] == 6)
+ else if (gBattlescriptCurrInstr[1] == BS_UNK_6)
{
if (!(gBattleTypeFlags & BATTLE_TYPE_MULTI))
{
@@ -4988,32 +4989,32 @@ static void Cmd_openpartyscreen(void)
if (gBitTable[2] & hitmarkerFaintBits && gBitTable[0] & hitmarkerFaintBits)
{
gActiveBattler = 2;
- if (HasNoMonsToSwitch(2, gBattleBufferB[0][1], 6))
+ if (HasNoMonsToSwitch(2, gBattleBufferB[0][1], PARTY_SIZE))
{
gAbsentBattlerFlags |= gBitTable[gActiveBattler];
gHitMarker &= ~(HITMARKER_FAINTED(gActiveBattler));
- BtlController_EmitCmd42(0);
+ BtlController_EmitCantSwitch(0);
MarkBattlerForControllerExec(gActiveBattler);
}
else if (!gSpecialStatuses[gActiveBattler].flag40)
{
- sub_804CF10(gBattleStruct->monToSwitchIntoId[0]);
+ ChooseMonToSendOut(gBattleStruct->monToSwitchIntoId[0]);
gSpecialStatuses[gActiveBattler].flag40 = 1;
}
}
if (gBitTable[3] & hitmarkerFaintBits && hitmarkerFaintBits & gBitTable[1])
{
gActiveBattler = 3;
- if (HasNoMonsToSwitch(3, gBattleBufferB[1][1], 6))
+ if (HasNoMonsToSwitch(3, gBattleBufferB[1][1], PARTY_SIZE))
{
gAbsentBattlerFlags |= gBitTable[gActiveBattler];
gHitMarker &= ~(HITMARKER_FAINTED(gActiveBattler));
- BtlController_EmitCmd42(0);
+ BtlController_EmitCantSwitch(0);
MarkBattlerForControllerExec(gActiveBattler);
}
else if (!gSpecialStatuses[gActiveBattler].flag40)
{
- sub_804CF10(gBattleStruct->monToSwitchIntoId[1]);
+ ChooseMonToSendOut(gBattleStruct->monToSwitchIntoId[1]);
gSpecialStatuses[gActiveBattler].flag40 = 1;
}
}
@@ -5041,17 +5042,17 @@ static void Cmd_openpartyscreen(void)
}
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.
else
hitmarkerFaintBits = PARTY_ACTION_SEND_OUT;
- battlerId = GetBattlerForBattleScript(gBattlescriptCurrInstr[1] & ~(0x80));
+ battlerId = GetBattlerForBattleScript(gBattlescriptCurrInstr[1] & ~(PARTY_SCREEN_OPTIONAL));
if (gSpecialStatuses[battlerId].flag40)
{
gBattlescriptCurrInstr += 6;
}
- else if (HasNoMonsToSwitch(battlerId, 6, 6))
+ else if (HasNoMonsToSwitch(battlerId, PARTY_SIZE, PARTY_SIZE))
{
gActiveBattler = battlerId;
gAbsentBattlerFlags |= gBitTable[gActiveBattler];
@@ -6373,10 +6374,10 @@ static void Cmd_various(void)
break;
case VARIOUS_ARENA_JUDGMENT_STRING:
BattleStringExpandPlaceholdersToDisplayedString(gRefereeStringsTable[gBattlescriptCurrInstr[1]]);
- BattlePutTextOnWindow(gDisplayedStringBattle, 0x16);
+ BattlePutTextOnWindow(gDisplayedStringBattle, 22);
break;
case VARIOUS_ARENA_WAIT_STRING:
- if (IsTextPrinterActive(0x16))
+ if (IsTextPrinterActive(22))
return;
break;
case VARIOUS_WAIT_CRY:
@@ -6446,19 +6447,19 @@ static void Cmd_setprotectlike(void) // protect and endure
if (gBattleMoves[gCurrentMove].effect == EFFECT_PROTECT)
{
gProtectStructs[gBattlerAttacker].protected = 1;
- gBattleCommunication[MULTISTRING_CHOOSER] = 0;
+ gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_PROTECTED_ITSELF;
}
if (gBattleMoves[gCurrentMove].effect == EFFECT_ENDURE)
{
gProtectStructs[gBattlerAttacker].endured = 1;
- gBattleCommunication[MULTISTRING_CHOOSER] = 1;
+ gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_BRACED_ITSELF;
}
gDisableStructs[gBattlerAttacker].protectUses++;
}
else
{
gDisableStructs[gBattlerAttacker].protectUses = 0;
- gBattleCommunication[MULTISTRING_CHOOSER] = 2;
+ gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_PROTECT_FAILED;
gMoveResultFlags |= MOVE_RESULT_MISSED;
}
@@ -6611,12 +6612,12 @@ static void Cmd_setrain(void)
if (gBattleWeather & WEATHER_RAIN_ANY)
{
gMoveResultFlags |= MOVE_RESULT_MISSED;
- gBattleCommunication[MULTISTRING_CHOOSER] = 2;
+ gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_WEATHER_FAILED;
}
else
{
gBattleWeather = WEATHER_RAIN_TEMPORARY;
- gBattleCommunication[MULTISTRING_CHOOSER] = 0;
+ gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_STARTED_RAIN;
gWishFutureKnock.weatherDuration = 5;
}
gBattlescriptCurrInstr++;
@@ -6627,7 +6628,7 @@ static void Cmd_setreflect(void)
if (gSideStatuses[GET_BATTLER_SIDE(gBattlerAttacker)] & SIDE_STATUS_REFLECT)
{
gMoveResultFlags |= MOVE_RESULT_MISSED;
- gBattleCommunication[MULTISTRING_CHOOSER] = 0;
+ gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SIDE_STATUS_FAILED;
}
else
{
@@ -6636,9 +6637,9 @@ static void Cmd_setreflect(void)
gSideTimers[GET_BATTLER_SIDE(gBattlerAttacker)].reflectBattlerId = gBattlerAttacker;
if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE && CountAliveMonsInBattle(BATTLE_ALIVE_ATK_SIDE) == 2)
- gBattleCommunication[MULTISTRING_CHOOSER] = 2;
+ gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SET_REFLECT_DOUBLE;
else
- gBattleCommunication[MULTISTRING_CHOOSER] = 1;
+ gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SET_REFLECT_SINGLE;
}
gBattlescriptCurrInstr++;
}
@@ -6648,18 +6649,18 @@ static void Cmd_setseeded(void)
if (gMoveResultFlags & MOVE_RESULT_NO_EFFECT || gStatuses3[gBattlerTarget] & STATUS3_LEECHSEED)
{
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))
{
gMoveResultFlags |= MOVE_RESULT_MISSED;
- gBattleCommunication[MULTISTRING_CHOOSER] = 2;
+ gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_LEECH_SEED_FAIL;
}
else
{
gStatuses3[gBattlerTarget] |= gBattlerAttacker;
gStatuses3[gBattlerTarget] |= STATUS3_LEECHSEED;
- gBattleCommunication[MULTISTRING_CHOOSER] = 0;
+ gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_LEECH_SEED_SET;
}
gBattlescriptCurrInstr++;
@@ -6700,11 +6701,11 @@ static void Cmd_trysetrest(void)
else
{
if (gBattleMons[gBattlerTarget].status1 & ((u8)(~STATUS1_SLEEP)))
- gBattleCommunication[MULTISTRING_CHOOSER] = 1;
+ gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_REST_STATUSED;
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);
MarkBattlerForControllerExec(gActiveBattler);
gBattlescriptCurrInstr += 5;
@@ -6740,9 +6741,9 @@ bool8 UproarWakeUpCheck(u8 battlerId)
if (gBattlerTarget == 0xFF)
gBattlerTarget = i;
else if (gBattlerTarget == i)
- gBattleCommunication[MULTISTRING_CHOOSER] = 0;
+ gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_CANT_SLEEP_UPROAR;
else
- gBattleCommunication[MULTISTRING_CHOOSER] = 1;
+ gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_UPROAR_KEPT_AWAKE;
break;
}
@@ -6765,7 +6766,7 @@ static void Cmd_jumpifcantmakeasleep(void)
|| gBattleMons[gBattlerTarget].ability == ABILITY_VITAL_SPIRIT)
{
gLastUsedAbility = gBattleMons[gBattlerTarget].ability;
- gBattleCommunication[MULTISTRING_CHOOSER] = 2;
+ gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_STAYED_AWAKE_USING;
gBattlescriptCurrInstr = jumpPtr;
RecordAbilityBattle(gBattlerTarget, gLastUsedAbility);
}
@@ -6780,7 +6781,7 @@ static void Cmd_stockpile(void)
if (gDisableStructs[gBattlerAttacker].stockpileCounter == 3)
{
gMoveResultFlags |= MOVE_RESULT_MISSED;
- gBattleCommunication[MULTISTRING_CHOOSER] = 1;
+ gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_CANT_STOCKPILE;
}
else
{
@@ -6788,7 +6789,7 @@ static void Cmd_stockpile(void)
PREPARE_BYTE_NUMBER_BUFFER(gBattleTextBuff1, 1, gDisableStructs[gBattlerAttacker].stockpileCounter)
- gBattleCommunication[MULTISTRING_CHOOSER] = 0;
+ gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_STOCKPILED;
}
gBattlescriptCurrInstr++;
}
@@ -6802,7 +6803,7 @@ static void Cmd_stockpiletobasedamage(void)
}
else
{
- if (gBattleCommunication[6] != 1)
+ if (gBattleCommunication[MISS_TYPE] != B_MSG_PROTECTED)
{
gBattleMoveDamage = CalculateBaseDamage(&gBattleMons[gBattlerAttacker], &gBattleMons[gBattlerTarget], gCurrentMove,
gSideStatuses[GET_BATTLER_SIDE(gBattlerTarget)], 0,
@@ -6826,14 +6827,14 @@ static void Cmd_stockpiletohpheal(void)
if (gDisableStructs[gBattlerAttacker].stockpileCounter == 0)
{
gBattlescriptCurrInstr = jumpPtr;
- gBattleCommunication[MULTISTRING_CHOOSER] = 0;
+ gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SWALLOW_FAILED;
}
else if (gBattleMons[gBattlerAttacker].maxHP == gBattleMons[gBattlerAttacker].hp)
{
gDisableStructs[gBattlerAttacker].stockpileCounter = 0;
gBattlescriptCurrInstr = jumpPtr;
gBattlerTarget = gBattlerAttacker;
- gBattleCommunication[MULTISTRING_CHOOSER] = 1;
+ gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SWALLOW_FULL_HP;
}
else
{
@@ -6985,9 +6986,9 @@ static u8 ChangeStatBuffs(s8 statValue, u8 statId, u8 flags, const u8 *BS_ptr)
gBattleTextBuff2[index] = B_BUFF_EOS;
if (gBattleMons[gActiveBattler].statStages[statId] == MIN_STAT_STAGE)
- gBattleCommunication[MULTISTRING_CHOOSER] = 2;
+ gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_STAT_WONT_DECREASE;
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;
if (gBattleMons[gActiveBattler].statStages[statId] == MAX_STAT_STAGE)
- gBattleCommunication[MULTISTRING_CHOOSER] = 2;
+ gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_STAT_WONT_INCREASE;
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;
@@ -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)
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;
- 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_WORKED;
@@ -7314,7 +7315,7 @@ static void Cmd_tryconversiontypechange(void) // randomly changes user's type to
do
{
- while ((moveChecked = Random() & 3) >= validMoves);
+ while ((moveChecked = Random() & (MAX_MON_MOVES - 1)) >= validMoves);
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)
{
gMoveResultFlags |= MOVE_RESULT_MISSED;
- gBattleCommunication[MULTISTRING_CHOOSER] = 0;
+ gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SIDE_STATUS_FAILED;
}
else
{
@@ -7367,9 +7368,9 @@ static void Cmd_setlightscreen(void)
gSideTimers[GET_BATTLER_SIDE(gBattlerAttacker)].lightscreenBattlerId = gBattlerAttacker;
if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE && CountAliveMonsInBattle(BATTLE_ALIVE_ATK_SIDE) == 2)
- gBattleCommunication[MULTISTRING_CHOOSER] = 4;
+ gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SET_LIGHTSCREEN_DOUBLE;
else
- gBattleCommunication[MULTISTRING_CHOOSER] = 3;
+ gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SET_LIGHTSCREEN_SINGLE;
}
gBattlescriptCurrInstr++;
@@ -7453,9 +7454,9 @@ static void Cmd_tryKO(void)
{
gMoveResultFlags |= MOVE_RESULT_MISSED;
if (gBattleMons[gBattlerAttacker].level >= gBattleMons[gBattlerTarget].level)
- gBattleCommunication[MULTISTRING_CHOOSER] = 0;
+ gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_KO_MISS;
else
- gBattleCommunication[MULTISTRING_CHOOSER] = 1;
+ gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_KO_UNAFFECTED;
gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1);
}
}
@@ -7475,12 +7476,12 @@ static void Cmd_setsandstorm(void)
if (gBattleWeather & WEATHER_SANDSTORM_ANY)
{
gMoveResultFlags |= MOVE_RESULT_MISSED;
- gBattleCommunication[MULTISTRING_CHOOSER] = 2;
+ gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_WEATHER_FAILED;
}
else
{
gBattleWeather = WEATHER_SANDSTORM_TEMPORARY;
- gBattleCommunication[MULTISTRING_CHOOSER] = 3;
+ gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_STARTED_SANDSTORM;
gWishFutureKnock.weatherDuration = 5;
}
gBattlescriptCurrInstr++;
@@ -7621,14 +7622,14 @@ static void Cmd_setmist(void)
if (gSideTimers[GET_BATTLER_SIDE(gBattlerAttacker)].mistTimer)
{
gMoveResultFlags |= MOVE_RESULT_FAILED;
- gBattleCommunication[MULTISTRING_CHOOSER] = 1;
+ gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_MIST_FAILED;
}
else
{
gSideTimers[GET_BATTLER_SIDE(gBattlerAttacker)].mistTimer = 5;
gSideTimers[GET_BATTLER_SIDE(gBattlerAttacker)].mistBattlerId = gBattlerAttacker;
gSideStatuses[GET_BATTLER_SIDE(gBattlerAttacker)] |= SIDE_STATUS_MIST;
- gBattleCommunication[MULTISTRING_CHOOSER] = 0;
+ gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SET_MIST;
}
gBattlescriptCurrInstr++;
}
@@ -7638,12 +7639,12 @@ static void Cmd_setfocusenergy(void)
if (gBattleMons[gBattlerAttacker].status2 & STATUS2_FOCUS_ENERGY)
{
gMoveResultFlags |= MOVE_RESULT_FAILED;
- gBattleCommunication[MULTISTRING_CHOOSER] = 1;
+ gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_FOCUS_ENERGY_FAILED;
}
else
{
gBattleMons[gBattlerAttacker].status2 |= STATUS2_FOCUS_ENERGY;
- gBattleCommunication[MULTISTRING_CHOOSER] = 0;
+ gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_GETTING_PUMPED;
}
gBattlescriptCurrInstr++;
}
@@ -7656,7 +7657,7 @@ static void Cmd_transformdataexecution(void)
|| gStatuses3[gBattlerTarget] & STATUS3_SEMI_INVULNERABLE)
{
gMoveResultFlags |= MOVE_RESULT_FAILED;
- gBattleCommunication[MULTISTRING_CHOOSER] = 1;
+ gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_TRANSFORM_FAILED;
}
else
{
@@ -7688,7 +7689,7 @@ static void Cmd_transformdataexecution(void)
gActiveBattler = gBattlerAttacker;
BtlController_EmitResetActionMoveSelection(0, RESET_MOVE_SELECTION);
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)
{
gBattleMoveDamage = 0;
- gBattleCommunication[MULTISTRING_CHOOSER] = 1;
+ gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SUBSTITUTE_FAILED;
}
else
{
@@ -7712,7 +7713,7 @@ static void Cmd_setsubstitute(void)
gBattleMons[gBattlerAttacker].status2 |= STATUS2_SUBSTITUTE;
gBattleMons[gBattlerAttacker].status2 &= ~(STATUS2_WRAPPED);
gDisableStructs[gBattlerAttacker].substituteHP = gBattleMoveDamage;
- gBattleCommunication[MULTISTRING_CHOOSER] = 0;
+ gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SET_SUBSTITUTE;
gHitMarker |= HITMARKER_IGNORE_SUBSTITUTE;
}
@@ -8139,7 +8140,7 @@ static void Cmd_trychoosesleeptalkmove(void)
do
{
- movePosition = Random() & 3;
+ movePosition = Random() & (MAX_MON_MOVES - 1);
} while ((gBitTable[movePosition] & unusableMovesBits));
gCalledMove = gBattleMons[gBattlerAttacker].moves[movePosition];
@@ -8250,7 +8251,7 @@ static void Cmd_healpartystatus(void)
struct Pokemon *party;
s32 i;
- gBattleCommunication[MULTISTRING_CHOOSER] = 0;
+ gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_BELL;
if (GetBattlerSide(gBattlerAttacker) == B_SIDE_PLAYER)
party = gPlayerParty;
@@ -8265,7 +8266,7 @@ static void Cmd_healpartystatus(void)
else
{
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);
@@ -8281,10 +8282,12 @@ static void Cmd_healpartystatus(void)
else
{
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++)
{
u16 species = GetMonData(&party[i], MON_DATA_SPECIES2);
@@ -8310,7 +8313,7 @@ static void Cmd_healpartystatus(void)
}
else // Aromatherapy
{
- gBattleCommunication[MULTISTRING_CHOOSER] = 4;
+ gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SOOTHING_AROMA;
toHeal = 0x3F;
gBattleMons[gBattlerAttacker].status1 = 0;
@@ -8514,14 +8517,14 @@ static void Cmd_setsafeguard(void)
if (gSideStatuses[GET_BATTLER_SIDE(gBattlerAttacker)] & SIDE_STATUS_SAFEGUARD)
{
gMoveResultFlags |= MOVE_RESULT_MISSED;
- gBattleCommunication[MULTISTRING_CHOOSER] = 0;
+ gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SIDE_STATUS_FAILED;
}
else
{
gSideStatuses[GET_BATTLER_SIDE(gBattlerAttacker)] |= SIDE_STATUS_SAFEGUARD;
gSideTimers[GET_BATTLER_SIDE(gBattlerAttacker)].safeguardTimer = 5;
gSideTimers[GET_BATTLER_SIDE(gBattlerAttacker)].safeguardBattlerId = gBattlerAttacker;
- gBattleCommunication[MULTISTRING_CHOOSER] = 5;
+ gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SET_SAFEGUARD;
}
gBattlescriptCurrInstr++;
@@ -8630,12 +8633,12 @@ static void Cmd_setsunny(void)
if (gBattleWeather & WEATHER_SUN_ANY)
{
gMoveResultFlags |= MOVE_RESULT_MISSED;
- gBattleCommunication[MULTISTRING_CHOOSER] = 2;
+ gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_WEATHER_FAILED;
}
else
{
gBattleWeather = WEATHER_SUN_TEMPORARY;
- gBattleCommunication[MULTISTRING_CHOOSER] = 4;
+ gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_STARTED_SUNLIGHT;
gWishFutureKnock.weatherDuration = 5;
}
@@ -8806,9 +8809,9 @@ static void Cmd_trysetfutureattack(void)
gWishFutureKnock.futureSightDmg[gBattlerTarget] = gWishFutureKnock.futureSightDmg[gBattlerTarget] * 15 / 10;
if (gCurrentMove == MOVE_DOOM_DESIRE)
- gBattleCommunication[MULTISTRING_CHOOSER] = 1;
+ gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_DOOM_DESIRE;
else
- gBattleCommunication[MULTISTRING_CHOOSER] = 0;
+ gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_FUTURE_SIGHT;
gBattlescriptCurrInstr += 5;
}
@@ -8912,12 +8915,12 @@ static void Cmd_sethail(void)
if (gBattleWeather & WEATHER_HAIL_ANY)
{
gMoveResultFlags |= MOVE_RESULT_MISSED;
- gBattleCommunication[MULTISTRING_CHOOSER] = 2;
+ gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_WEATHER_FAILED;
}
else
{
gBattleWeather = WEATHER_HAIL;
- gBattleCommunication[MULTISTRING_CHOOSER] = 5;
+ gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_STARTED_HAIL;
gWishFutureKnock.weatherDuration = 5;
}
@@ -8928,7 +8931,7 @@ static void Cmd_jumpifattackandspecialattackcannotfall(void) // memento
{
if (gBattleMons[gBattlerTarget].statStages[STAT_ATK] == 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);
}
@@ -9113,11 +9116,11 @@ static void Cmd_tryswapitems(void) // trick
PREPARE_ITEM_BUFFER(gBattleTextBuff2, oldItemAtk)
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)
- gBattleCommunication[MULTISTRING_CHOOSER] = 0; // nothing -> <- target's item
+ gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_ITEM_SWAP_TAKEN; // nothing -> <- target's item
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))
{
gStatuses3[gBattlerAttacker] |= STATUS3_MUDSPORT;
- gBattleCommunication[MULTISTRING_CHOOSER] = 0;
+ gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_WEAKEN_ELECTRIC;
worked = TRUE;
}
}
@@ -9614,7 +9617,7 @@ static void Cmd_settypebasedhalvers(void) // water and mud sport
if (!(gStatuses3[gBattlerAttacker] & STATUS3_WATERSPORT))
{
gStatuses3[gBattlerAttacker] |= STATUS3_WATERSPORT;
- gBattleCommunication[MULTISTRING_CHOOSER] = 1;
+ gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_WEAKEN_FIRE;
worked = TRUE;
}
}
@@ -9883,7 +9886,6 @@ static void Cmd_handleballthrow(void)
else // not caught
{
gBattleCommunication[MULTISTRING_CHOOSER] = shakes;
- // Maybe inject SpriteCB_TestBallThrow here
gBattlescriptCurrInstr = BattleScript_ShakeBallThrow;
}
}
@@ -9896,7 +9898,7 @@ static void Cmd_givecaughtmon(void)
{
if (!ShouldShowBoxWasFullMessage())
{
- gBattleCommunication[MULTISTRING_CHOOSER] = 0;
+ gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SENT_SOMEONES_PC;
StringCopy(gStringVar1, GetBoxNamePtr(VarGet(VAR_PC_BOX_TO_SEND_MON)));
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
GetMonData(&gEnemyParty[gBattlerPartyIndexes[gBattlerAttacker ^ BIT_SIDE]], MON_DATA_NICKNAME, gStringVar2);
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))
gBattleCommunication[MULTISTRING_CHOOSER]++;
}
diff --git a/src/battle_tv.c b/src/battle_tv.c
index 8c8ea90ab..a61f5ff29 100644
--- a/src/battle_tv.c
+++ b/src/battle_tv.c
@@ -666,7 +666,7 @@ void BattleTv_SetDataBasedOnString(u16 stringId)
case STRINGID_CRITICALHIT:
AddMovePoints(PTS_CRITICAL_HIT, moveSlot, 0, 0);
break;
- case STRINGID_PKMNSSTATCHANGED:
+ case STRINGID_ATTACKERSSTATROSE:
if (gBattleTextBuff1[2] != 0)
{
if (*statStringId == STRINGID_STATSHARPLY)
@@ -675,7 +675,7 @@ void BattleTv_SetDataBasedOnString(u16 stringId)
AddMovePoints(PTS_STAT_INCREASE_1, moveSlot, gBattleTextBuff1[2] - 1, 0);
}
break;
- case STRINGID_PKMNSSTATCHANGED2:
+ case STRINGID_DEFENDERSSTATROSE:
if (gBattleTextBuff1[2] != 0)
{
if (gBattlerAttacker == gBattlerTarget)
@@ -691,11 +691,11 @@ void BattleTv_SetDataBasedOnString(u16 stringId)
}
}
break;
- case STRINGID_PKMNSSTATCHANGED3:
+ case STRINGID_ATTACKERSSTATFELL:
if (gBattleTextBuff1[2] != 0)
AddMovePoints(PTS_STAT_DECREASE_SELF, moveSlot, gBattleTextBuff1[2] - 1, 0);
break;
- case STRINGID_PKMNSSTATCHANGED4:
+ case STRINGID_DEFENDERSSTATFELL:
if (gBattleTextBuff1[2] != 0)
{
if (*statStringId == STRINGID_STATHARSHLY)
diff --git a/src/battle_util.c b/src/battle_util.c
index c0d897707..cbcd445b7 100644
--- a/src/battle_util.c
+++ b/src/battle_util.c
@@ -49,7 +49,29 @@ extern const u8 *const gBattlescriptsForRunningByItem[];
extern const u8 *const gBattlescriptsForUsingItem[];
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 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)
{
gCurrentActionFuncId = B_ACTION_FINISHED;
@@ -249,13 +270,13 @@ void HandleAction_UseMove(void)
}
else if (gPalaceSelectionBattleScripts[gBattlerAttacker] != NULL)
{
- gBattleCommunication[MULTISTRING_CHOOSER] = 4;
+ gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_INCAPABLE_OF_POWER;
gBattlescriptCurrInstr = gPalaceSelectionBattleScripts[gBattlerAttacker];
gPalaceSelectionBattleScripts[gBattlerAttacker] = NULL;
}
else
{
- gBattleCommunication[MULTISTRING_CHOOSER] = 4;
+ gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_INCAPABLE_OF_POWER;
gBattlescriptCurrInstr = BattleScript_MoveUsedLoafingAround;
}
}
@@ -318,26 +339,29 @@ void HandleAction_UseItem(void)
case AI_ITEM_HEAL_HP:
break;
case AI_ITEM_CURE_CONDITION:
- gBattleCommunication[MULTISTRING_CHOOSER] = 0;
- if (*(gBattleStruct->AI_itemFlags + gBattlerAttacker / 2) & 1)
+ gBattleCommunication[MULTISTRING_CHOOSER] = AI_HEAL_CONFUSION;
+ if (*(gBattleStruct->AI_itemFlags + gBattlerAttacker / 2) & (1 << AI_HEAL_CONFUSION))
{
if (*(gBattleStruct->AI_itemFlags + gBattlerAttacker / 2) & 0x3E)
- gBattleCommunication[MULTISTRING_CHOOSER] = 5;
+ gBattleCommunication[MULTISTRING_CHOOSER] = AI_HEAL_SLEEP;
}
else
{
+ // Check for other statuses, stopping at first (shouldn't be more than one)
while (!(*(gBattleStruct->AI_itemFlags + gBattlerAttacker / 2) & 1))
{
*(gBattleStruct->AI_itemFlags + gBattlerAttacker / 2) >>= 1;
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;
case AI_ITEM_X_STAT:
- gBattleCommunication[MULTISTRING_CHOOSER] = 4;
- if (*(gBattleStruct->AI_itemFlags + (gBattlerAttacker >> 1)) & 0x80)
+ gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_STAT_ROSE_ITEM;
+ if (*(gBattleStruct->AI_itemFlags + (gBattlerAttacker >> 1)) & (1 << AI_DIRE_HIT))
{
- gBattleCommunication[MULTISTRING_CHOOSER] = 5;
+ gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_USED_DIRE_HIT;
}
else
{
@@ -354,11 +378,20 @@ void HandleAction_UseItem(void)
gBattleScripting.animArg2 = 0;
}
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)
gBattleCommunication[MULTISTRING_CHOOSER] = 2;
else
- gBattleCommunication[MULTISTRING_CHOOSER] = 0;
+#endif
+ gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SET_MIST;
break;
}
@@ -479,7 +512,7 @@ void HandleAction_Run(void)
if (!TryRunFromBattle(gBattlerAttacker)) // failed to run away
{
ClearFuryCutterDestinyBondGrudge(gBattlerAttacker);
- gBattleCommunication[MULTISTRING_CHOOSER] = 3;
+ gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_CANT_ESCAPE_2;
gBattlescriptCurrInstr = BattleScript_PrintFailedToRunString;
gCurrentActionFuncId = B_ACTION_EXEC_SCRIPT;
}
@@ -488,7 +521,7 @@ void HandleAction_Run(void)
{
if (gBattleMons[gBattlerAttacker].status2 & (STATUS2_WRAPPED | STATUS2_ESCAPE_PREVENTION))
{
- gBattleCommunication[MULTISTRING_CHOOSER] = 4;
+ gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_ATTACKER_CANT_ESCAPE;
gBattlescriptCurrInstr = BattleScript_PrintFailedToRunString;
gCurrentActionFuncId = B_ACTION_EXEC_SCRIPT;
}
@@ -567,11 +600,11 @@ void HandleAction_GoNear(void)
if (gBattleStruct->safariGoNearCounter < 3)
{
gBattleStruct->safariGoNearCounter++;
- gBattleCommunication[MULTISTRING_CHOOSER] = 0;
+ gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_CREPT_CLOSER;
}
else
{
- gBattleCommunication[MULTISTRING_CHOOSER] = 1; // Can't get closer.
+ gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_CANT_GET_CLOSER;
}
gBattlescriptCurrInstr = gBattlescriptsForSafariActions[1];
gCurrentActionFuncId = B_ACTION_EXEC_SCRIPT;
@@ -1295,20 +1328,20 @@ u8 DoFieldEndTurnEffects(void)
{
gBattleWeather &= ~WEATHER_RAIN_TEMPORARY;
gBattleWeather &= ~WEATHER_RAIN_DOWNPOUR;
- gBattleCommunication[MULTISTRING_CHOOSER] = 2;
+ gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_RAIN_STOPPED;
}
else if (gBattleWeather & WEATHER_RAIN_DOWNPOUR)
- gBattleCommunication[MULTISTRING_CHOOSER] = 1;
+ gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_DOWNPOUR_CONTINUES;
else
- gBattleCommunication[MULTISTRING_CHOOSER] = 0;
+ gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_RAIN_CONTINUES;
}
else if (gBattleWeather & WEATHER_RAIN_DOWNPOUR)
{
- gBattleCommunication[MULTISTRING_CHOOSER] = 1;
+ gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_DOWNPOUR_CONTINUES;
}
else
{
- gBattleCommunication[MULTISTRING_CHOOSER] = 0;
+ gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_RAIN_CONTINUES;
}
BattleScriptExecute(BattleScript_RainContinuesOrEnds);
@@ -1330,7 +1363,7 @@ u8 DoFieldEndTurnEffects(void)
}
gBattleScripting.animArg1 = B_ANIM_SANDSTORM_CONTINUES;
- gBattleCommunication[MULTISTRING_CHOOSER] = 0;
+ gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SANDSTORM;
BattleScriptExecute(gBattlescriptCurrInstr);
effect++;
}
@@ -1368,7 +1401,7 @@ u8 DoFieldEndTurnEffects(void)
}
gBattleScripting.animArg1 = B_ANIM_HAIL_CONTINUES;
- gBattleCommunication[MULTISTRING_CHOOSER] = 1;
+ gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_HAIL;
BattleScriptExecute(gBattlescriptCurrInstr);
effect++;
}
@@ -1597,16 +1630,16 @@ u8 DoBattlerEndTurnEffects(void)
if (WasUnableToUseMove(gActiveBattler))
{
CancelMultiTurnMoves(gActiveBattler);
- gBattleCommunication[MULTISTRING_CHOOSER] = 1;
+ gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_UPROAR_ENDS;
}
else if (gBattleMons[gActiveBattler].status2 & STATUS2_UPROAR)
{
- gBattleCommunication[MULTISTRING_CHOOSER] = 0;
+ gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_UPROAR_CONTINUES;
gBattleMons[gActiveBattler].status2 |= STATUS2_MULTIPLETURNS;
}
else
{
- gBattleCommunication[MULTISTRING_CHOOSER] = 1;
+ gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_UPROAR_ENDS;
CancelMultiTurnMoves(gActiveBattler);
}
BattleScriptExecute(BattleScript_PrintUproarOverTurns);
@@ -1749,9 +1782,9 @@ bool8 HandleWishPerishSongOnTurnEnd(void)
&& gBattleMons[gActiveBattler].hp != 0)
{
if (gWishFutureKnock.futureSightMove[gActiveBattler] == MOVE_FUTURE_SIGHT)
- gBattleCommunication[MULTISTRING_CHOOSER] = 0;
+ gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_FUTURE_SIGHT;
else
- gBattleCommunication[MULTISTRING_CHOOSER] = 1;
+ gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_DOOM_DESIRE;
PREPARE_MOVE_BUFFER(gBattleTextBuff1, gWishFutureKnock.futureSightMove[gActiveBattler]);
@@ -1850,7 +1883,7 @@ bool8 HandleFaintedMonActions(void)
gBattleStruct->faintedActionsState++;
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]);
}
// fall through
@@ -1962,7 +1995,7 @@ u8 AtkCanceller_UnableToUseMove(void)
gBattleMons[gBattlerAttacker].status1 &= ~(STATUS1_SLEEP);
gBattleMons[gBattlerAttacker].status2 &= ~(STATUS2_NIGHTMARE);
BattleScriptPushCursor();
- gBattleCommunication[MULTISTRING_CHOOSER] = 1;
+ gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_WOKE_UP_UPROAR;
gBattlescriptCurrInstr = BattleScript_MoveUsedWokeUp;
effect = 2;
}
@@ -1990,7 +2023,7 @@ u8 AtkCanceller_UnableToUseMove(void)
{
gBattleMons[gBattlerAttacker].status2 &= ~(STATUS2_NIGHTMARE);
BattleScriptPushCursor();
- gBattleCommunication[MULTISTRING_CHOOSER] = 0;
+ gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_WOKE_UP;
gBattlescriptCurrInstr = BattleScript_MoveUsedWokeUp;
effect = 2;
}
@@ -2019,7 +2052,7 @@ u8 AtkCanceller_UnableToUseMove(void)
gBattleMons[gBattlerAttacker].status1 &= ~(STATUS1_FREEZE);
BattleScriptPushCursor();
gBattlescriptCurrInstr = BattleScript_MoveUsedUnfroze;
- gBattleCommunication[MULTISTRING_CHOOSER] = 0;
+ gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_DEFROSTED;
}
effect = 2;
}
@@ -2030,7 +2063,7 @@ u8 AtkCanceller_UnableToUseMove(void)
{
CancelMultiTurnMoves(gBattlerAttacker);
gHitMarker |= HITMARKER_UNABLE_TO_USE_MOVE;
- gBattleCommunication[MULTISTRING_CHOOSER] = 0;
+ gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_LOAFING;
gBattlescriptCurrInstr = BattleScript_MoveUsedLoafingAround;
gMoveResultFlags |= MOVE_RESULT_MISSED;
effect = 1;
@@ -2103,12 +2136,14 @@ u8 AtkCanceller_UnableToUseMove(void)
{
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();
}
else // confusion dmg
{
- gBattleCommunication[MULTISTRING_CHOOSER] = 1;
+ gBattleCommunication[MULTISTRING_CHOOSER] = TRUE;
gBattlerTarget = gBattlerAttacker;
gBattleMoveDamage = CalculateBaseDamage(&gBattleMons[gBattlerAttacker], &gBattleMons[gBattlerAttacker], MOVE_POUND, 0, 40, 0, gBattlerAttacker, gBattlerAttacker);
gProtectStructs[gBattlerAttacker].confusionSelfDmg = 1;
@@ -2195,7 +2230,7 @@ u8 AtkCanceller_UnableToUseMove(void)
gBattleMons[gBattlerAttacker].status1 &= ~(STATUS1_FREEZE);
BattleScriptPushCursor();
gBattlescriptCurrInstr = BattleScript_MoveUsedUnfroze;
- gBattleCommunication[MULTISTRING_CHOOSER] = 1;
+ gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_DEFROSTED_BY_MOVE;
}
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)
{
gBattleMons[battler].statStages[STAT_SPEED]++;
- gBattleScripting.animArg1 = 0x11;
+ gBattleScripting.animArg1 = 14 + STAT_SPEED;
gBattleScripting.animArg2 = 0;
BattleScriptPushCursorAndCallback(BattleScript_SpeedBoostActivates);
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))
{
- gBattleCommunication[MULTISTRING_CHOOSER] = 0;
+ gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_FLASH_FIRE_BOOST;
if (gProtectStructs[gBattlerAttacker].notFirstStrike)
gBattlescriptCurrInstr = BattleScript_FlashFireBoost;
else
@@ -2666,7 +2701,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u8 ability, u8 special, u16 moveA
}
else
{
- gBattleCommunication[MULTISTRING_CHOOSER] = 1;
+ gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_FLASH_FIRE_NO_BOOST;
if (gProtectStructs[gBattlerAttacker].notFirstStrike)
gBattlescriptCurrInstr = BattleScript_FlashFireBoost;
else
@@ -3431,7 +3466,7 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn)
gEffectBattler = battlerId;
SET_STATCHANGER(STAT_ATK, 1, FALSE);
- gBattleScripting.animArg1 = 0xE + STAT_ATK;
+ gBattleScripting.animArg1 = 14 + STAT_ATK;
gBattleScripting.animArg2 = 0;
BattleScriptExecute(BattleScript_BerryStatRaiseEnd2);
effect = ITEM_STATS_CHANGE;
@@ -3445,7 +3480,7 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn)
gEffectBattler = battlerId;
SET_STATCHANGER(STAT_DEF, 1, FALSE);
- gBattleScripting.animArg1 = 0xE + STAT_DEF;
+ gBattleScripting.animArg1 = 14 + STAT_DEF;
gBattleScripting.animArg2 = 0;
BattleScriptExecute(BattleScript_BerryStatRaiseEnd2);
effect = ITEM_STATS_CHANGE;
@@ -3459,7 +3494,7 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn)
gEffectBattler = battlerId;
SET_STATCHANGER(STAT_SPEED, 1, FALSE);
- gBattleScripting.animArg1 = 0xE + STAT_SPEED;
+ gBattleScripting.animArg1 = 14 + STAT_SPEED;
gBattleScripting.animArg2 = 0;
BattleScriptExecute(BattleScript_BerryStatRaiseEnd2);
effect = ITEM_STATS_CHANGE;
@@ -3473,7 +3508,7 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn)
gEffectBattler = battlerId;
SET_STATCHANGER(STAT_SPATK, 1, FALSE);
- gBattleScripting.animArg1 = 0xE + STAT_SPATK;
+ gBattleScripting.animArg1 = 14 + STAT_SPATK;
gBattleScripting.animArg2 = 0;
BattleScriptExecute(BattleScript_BerryStatRaiseEnd2);
effect = ITEM_STATS_CHANGE;
@@ -3487,7 +3522,7 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn)
gEffectBattler = battlerId;
SET_STATCHANGER(STAT_SPDEF, 1, FALSE);
- gBattleScripting.animArg1 = 0xE + STAT_SPDEF;
+ gBattleScripting.animArg1 = 14 + STAT_SPDEF;
gBattleScripting.animArg2 = 0;
BattleScriptExecute(BattleScript_BerryStatRaiseEnd2);
effect = ITEM_STATS_CHANGE;
@@ -3622,9 +3657,9 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn)
i++;
}
if (!(i > 1))
- gBattleCommunication[MULTISTRING_CHOOSER] = 0;
+ gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_CURED_PROBLEM;
else
- gBattleCommunication[MULTISTRING_CHOOSER] = 1;
+ gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_NORMALIZED_STATUS;
gBattleMons[battlerId].status1 = 0;
gBattleMons[battlerId].status2 &= ~(STATUS2_CONFUSION);
BattleScriptExecute(BattleScript_BerryCureChosenStatusEnd2);
@@ -3637,7 +3672,7 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn)
gBattleMons[battlerId].status2 &= ~(STATUS2_INFATUATION);
StringCopy(gBattleTextBuff1, gStatusConditionString_LoveJpn);
BattleScriptExecute(BattleScript_BerryCureChosenStatusEnd2);
- gBattleCommunication[MULTISTRING_CHOOSER] = 0;
+ gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_CURED_PROBLEM;
effect = ITEM_EFFECT_OTHER;
}
break;
@@ -3740,7 +3775,7 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn)
gBattleMons[battlerId].status2 &= ~(STATUS2_INFATUATION);
StringCopy(gBattleTextBuff1, gStatusConditionString_LoveJpn);
BattleScriptPushCursor();
- gBattleCommunication[MULTISTRING_CHOOSER] = 0;
+ gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_CURED_PROBLEM;
gBattlescriptCurrInstr = BattleScript_BerryCureChosenStatusRet;
effect = ITEM_EFFECT_OTHER;
}
@@ -3776,7 +3811,7 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn)
gBattleMons[battlerId].status1 = 0;
gBattleMons[battlerId].status2 &= ~(STATUS2_CONFUSION);
BattleScriptPushCursor();
- gBattleCommunication[MULTISTRING_CHOOSER] = 0;
+ gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_CURED_PROBLEM;
gBattlescriptCurrInstr = BattleScript_BerryCureChosenStatusRet;
effect = ITEM_STATUS_CHANGE;
}
@@ -4016,7 +4051,9 @@ u8 IsMonDisobedient(void)
calc = CheckMoveLimitations(gBattlerAttacker, gBitTable[gCurrMovePos], 0xFF);
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;
return 1;
}
@@ -4024,7 +4061,7 @@ u8 IsMonDisobedient(void)
{
do
{
- gCurrMovePos = gChosenMovePos = Random() & 3;
+ gCurrMovePos = gChosenMovePos = Random() & (MAX_MON_MOVES - 1);
} while (gBitTable[gCurrMovePos] & calc);
gCalledMove = gBattleMons[gBattlerAttacker].moves[gCurrMovePos];
@@ -4065,7 +4102,9 @@ u8 IsMonDisobedient(void)
}
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;
return 1;
}
diff --git a/src/battle_util2.c b/src/battle_util2.c
index 6d51f51e7..def7302d3 100644
--- a/src/battle_util2.c
+++ b/src/battle_util2.c
@@ -10,6 +10,7 @@
#include "constants/abilities.h"
#include "random.h"
#include "battle_scripts.h"
+#include "constants/battle_string_ids.h"
void AllocateBattleResources(void)
{
@@ -136,7 +137,7 @@ u32 sub_805725C(u8 battlerId)
gBattleMons[battlerId].status1 &= ~(STATUS1_SLEEP);
gBattleMons[battlerId].status2 &= ~(STATUS2_NIGHTMARE);
BattleScriptPushCursor();
- gBattleCommunication[MULTISTRING_CHOOSER] = 1;
+ gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_WOKE_UP_UPROAR;
gBattlescriptCurrInstr = BattleScript_MoveUsedWokeUp;
effect = 2;
}
@@ -163,7 +164,7 @@ u32 sub_805725C(u8 battlerId)
{
gBattleMons[battlerId].status2 &= ~(STATUS2_NIGHTMARE);
BattleScriptPushCursor();
- gBattleCommunication[MULTISTRING_CHOOSER] = 0;
+ gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_WOKE_UP;
gBattlescriptCurrInstr = BattleScript_MoveUsedWokeUp;
effect = 2;
}
@@ -183,7 +184,7 @@ u32 sub_805725C(u8 battlerId)
gBattleMons[battlerId].status1 &= ~(STATUS1_FREEZE);
BattleScriptPushCursor();
gBattlescriptCurrInstr = BattleScript_MoveUsedUnfroze;
- gBattleCommunication[MULTISTRING_CHOOSER] = 0;
+ gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_DEFROSTED;
}
effect = 2;
}
diff --git a/src/lilycove_lady.c b/src/lilycove_lady.c
index 5bad07420..22155ffd5 100644
--- a/src/lilycove_lady.c
+++ b/src/lilycove_lady.c
@@ -762,25 +762,16 @@ void BufferContestName(u8 *dest, u8 category)
StringCopy(dest, sContestNames[category]);
}
-// used in tv.c to determine sTVShowState for Contest Lady show
-// if return val is 1, sTVShowState is 1
-// if return val is 2, sTVShowState is 3
-// if return val is 0, sTVShowState is 2
-u8 sub_818E880(void)
+// Used by the Contest Lady's TV show to determine how well she performed
+u8 GetContestLadyPokeblockState(void)
{
sContestLadyPtr = &gSaveBlock1Ptr->lilycoveLady.contest;
if (sContestLadyPtr->numGoodPokeblocksGiven >= LILYCOVE_LADY_GIFT_THRESHOLD)
- {
- return 1;
- }
+ return CONTEST_LADY_GOOD;
else if (sContestLadyPtr->numGoodPokeblocksGiven == 0)
- {
- return 2;
- }
+ return CONTEST_LADY_BAD;
else
- {
- return 0;
- }
+ return CONTEST_LADY_NORMAL;
}
diff --git a/src/pokemon.c b/src/pokemon.c
index e28fba1b4..9fe008d56 100644
--- a/src/pokemon.c
+++ b/src/pokemon.c
@@ -5366,7 +5366,7 @@ static void BufferStatRoseMessage(s32 arg0)
gBattlerTarget = gBattlerInMenuId;
StringCopy(gBattleTextBuff1, gStatNamesTable[sStatsToRaise[arg0]]);
StringCopy(gBattleTextBuff2, gText_StatRose);
- BattleStringExpandPlaceholdersToDisplayedString(gText_PkmnsStatChanged2);
+ BattleStringExpandPlaceholdersToDisplayedString(gText_DefendersStatRose);
}
u8 *UseStatIncreaseItem(u16 itemId)
diff --git a/src/tv.c b/src/tv.c
index 691b343d8..0466ee713 100644
--- a/src/tv.c
+++ b/src/tv.c
@@ -38,6 +38,7 @@
#include "constants/contest.h"
#include "constants/items.h"
#include "constants/layouts.h"
+#include "constants/lilycove_lady.h"
#include "constants/maps.h"
#include "constants/metatile_behaviors.h"
#include "constants/moves.h"
@@ -179,7 +180,7 @@ static void DoTVShowPokemonNewsBattleFrontier(void);
static void DoTVShowWhatsNo1InHoennToday(void);
static void DoTVShowSecretBaseSecrets(void);
static void DoTVShowSafariFanClub(void);
-static void DoTVShowPokemonContestLiveUpdates2(void);
+static void DoTVShowLilycoveContestLady(void);
// .rodata
@@ -461,11 +462,11 @@ static const u8 *const sTVNameRaterTextGroup[] = {
gTVNameRaterText18
};
-static const u8 *const sTVPokemonContestLiveUpdates2TextGroup[] = {
- gTVPokemonContestLiveUpdates2Text00,
- gTVPokemonContestLiveUpdates2Text01,
- gTVPokemonContestLiveUpdates2Text02,
- gTVPokemonContestLiveUpdates2Text03
+static const u8 *const sTVLilycoveContestLadyTextGroup[] = {
+ [CONTESTLADYLIVE_STATE_INTRO] = ContestLadyShow_Text_Intro,
+ [CONTESTLADYLIVE_STATE_WON] = ContestLadyShow_Text_Won,
+ [CONTESTLADYLIVE_STATE_LOST] = ContestLadyShow_Text_Lost,
+ [CONTESTLADYLIVE_STATE_LOST_BADLY] = ContestLadyShow_Text_LostBadly
};
static const u8 *const sTVPokemonTodayFailedTextGroup[] = {
@@ -1661,13 +1662,13 @@ void PutLilycoveContestLadyShowOnTheAir(void)
if (gSpecialVar_Result != TRUE)
{
show = &gSaveBlock1Ptr->tvShows[sCurTVShowSlot];
- BufferContestLadyLanguage(&show->contestLiveUpdates2.language);
- show->contestLiveUpdates2.pokemonNameLanguage = GAME_LANGUAGE;
- show->contestLiveUpdates2.kind = TVSHOW_CONTEST_LIVE_UPDATES_2;
- show->contestLiveUpdates2.active = TRUE;
- BufferContestLadyPlayerName(show->contestLiveUpdates2.playerName);
- BufferContestLadyMonName(&show->contestLiveUpdates2.contestCategory, show->contestLiveUpdates2.nickname);
- show->contestLiveUpdates2.pokeblockState = sub_818E880();
+ BufferContestLadyLanguage(&show->contestLady.language);
+ show->contestLady.pokemonNameLanguage = GAME_LANGUAGE;
+ show->contestLady.kind = TVSHOW_LILYCOVE_CONTEST_LADY;
+ show->contestLady.active = TRUE;
+ BufferContestLadyPlayerName(show->contestLady.playerName);
+ BufferContestLadyMonName(&show->contestLady.contestCategory, show->contestLady.nickname);
+ show->contestLady.pokeblockState = GetContestLadyPokeblockState();
tv_store_id_2x(show);
}
}
@@ -3812,9 +3813,8 @@ static void sub_80F0708(void) // FIXME: register allocation shenanigans
break;
case TVSHOW_FAN_CLUB_SPECIAL:
break;
- case TVSHOW_CONTEST_LIVE_UPDATES_2:
+ case TVSHOW_LILYCOVE_CONTEST_LADY:
break;
-
case TVSHOW_OFF_AIR:
break;
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.idolNameLanguage = TV_GetStringLanguage(curShow->fanClubSpecial.idolName);
break;
- case TVSHOW_CONTEST_LIVE_UPDATES_2:
- curShow->contestLiveUpdates2.language = TV_GetStringLanguage(curShow->contestLiveUpdates2.playerName);
- curShow->contestLiveUpdates2.pokemonNameLanguage = TV_GetStringLanguage(curShow->contestLiveUpdates2.nickname);
+ case TVSHOW_LILYCOVE_CONTEST_LADY:
+ curShow->contestLady.language = TV_GetStringLanguage(curShow->contestLady.playerName);
+ curShow->contestLady.pokemonNameLanguage = TV_GetStringLanguage(curShow->contestLady.nickname);
break;
-
case TVSHOW_POKEMON_TODAY_CAUGHT:
curShow->pokemonToday.language = TV_GetStringLanguage(curShow->pokemonToday.playerName);
curShow->pokemonToday.language2 = TV_GetStringLanguage(curShow->pokemonToday.nickname);
@@ -4492,8 +4491,8 @@ void DoTVShow(void)
case TVSHOW_SAFARI_FAN_CLUB:
DoTVShowSafariFanClub();
break;
- case TVSHOW_CONTEST_LIVE_UPDATES_2:
- DoTVShowPokemonContestLiveUpdates2();
+ case TVSHOW_LILYCOVE_CONTEST_LADY:
+ DoTVShowLilycoveContestLady();
break;
}
}
@@ -7174,7 +7173,8 @@ static void DoTVShowSafariFanClub(void)
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;
u8 state;
@@ -7184,30 +7184,30 @@ static void DoTVShowPokemonContestLiveUpdates2(void)
state = sTVShowState;
switch (state)
{
- case 0:
- BufferContestName(gStringVar1, show->contestLiveUpdates2.contestCategory);
- if (show->contestLiveUpdates2.pokeblockState == 1)
- {
- sTVShowState = 1;
- }
- else if (show->contestLiveUpdates2.pokeblockState == 0)
- {
- sTVShowState = 2;
- }
- else
- {
- sTVShowState = 3;
- }
- break;
- case 1:
- case 2:
- TVShowConvertInternationalString(gStringVar3, show->contestLiveUpdates2.playerName, show->contestLiveUpdates2.language);
- case 3:
- TVShowConvertInternationalString(gStringVar2, show->contestLiveUpdates2.nickname, show->contestLiveUpdates2.pokemonNameLanguage);
- TVShowDone();
- break;
+ case CONTESTLADYLIVE_STATE_INTRO:
+ BufferContestName(gStringVar1, show->contestLady.contestCategory);
+ if (show->contestLady.pokeblockState == CONTEST_LADY_GOOD)
+ {
+ sTVShowState = CONTESTLADYLIVE_STATE_WON;
+ }
+ else if (show->contestLady.pokeblockState == CONTEST_LADY_NORMAL)
+ {
+ sTVShowState = CONTESTLADYLIVE_STATE_LOST;
+ }
+ else // CONTEST_LADY_BAD
+ {
+ sTVShowState = CONTESTLADYLIVE_STATE_LOST_BADLY;
+ }
+ break;
+ case CONTESTLADYLIVE_STATE_WON:
+ case CONTESTLADYLIVE_STATE_LOST:
+ TVShowConvertInternationalString(gStringVar3, show->contestLady.playerName, show->contestLady.language);
+ case CONTESTLADYLIVE_STATE_LOST_BADLY:
+ TVShowConvertInternationalString(gStringVar2, show->contestLady.nickname, show->contestLady.pokemonNameLanguage);
+ TVShowDone();
+ break;
}
- ShowFieldMessage(sTVPokemonContestLiveUpdates2TextGroup[state]);
+ ShowFieldMessage(sTVLilycoveContestLadyTextGroup[state]);
}
void TVShowDone(void)