Skip to content

Commit

Permalink
Added a macro to flush the text box in battles (#3442)
Browse files Browse the repository at this point in the history
  • Loading branch information
mrgriffin committed Oct 22, 2023
2 parents a34c260 + 620998e commit 551dc62
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 64 deletions.
5 changes: 5 additions & 0 deletions asm/macros/battle_script.inc
Original file line number Diff line number Diff line change
Expand Up @@ -2383,3 +2383,8 @@
getbattlerfainted \battler
jumpifbyte CMP_EQUAL, gBattleCommunication, \value, \ptr
.endm

.macro flushtextbox
printstring STRINGID_EMPTYSTRING3
waitmessage 1
.endm
101 changes: 37 additions & 64 deletions data/battle_scripts_1.s
Original file line number Diff line number Diff line change
Expand Up @@ -762,8 +762,7 @@ BattleScript_AffectionBasedStatusHeal_Continue:
end2

BattleScript_ShellTrapSetUp::
printstring STRINGID_EMPTYSTRING3
waitmessage 0x1
flushtextbox
playanimation BS_ATTACKER, B_ANIM_SHELL_TRAP_SETUP, NULL
printstring STRINGID_PREPARESHELLTRAP
waitmessage B_WAIT_TIME_LONG
Expand Down Expand Up @@ -836,8 +835,7 @@ BattleScript_EffectCourtChange::

BattleScript_BeakBlastSetUp::
setbeakblast BS_ATTACKER
printstring STRINGID_EMPTYSTRING3
waitmessage 1
flushtextbox
playanimation BS_ATTACKER, B_ANIM_BEAK_BLAST_SETUP, NULL
printstring STRINGID_HEATUPBEAK
waitmessage B_WAIT_TIME_LONG
Expand All @@ -861,7 +859,7 @@ BattleScript_EffectMeteorBeam::

BattleScript_FirstChargingTurnMeteorBeam::
attackcanceler
printstring STRINGID_EMPTYSTRING3
flushtextbox
ppreduce
attackanimation
waitanimation
Expand Down Expand Up @@ -1541,8 +1539,7 @@ BattleScript_MoveEffectCoreEnforcer::
waitmessage B_WAIT_TIME_LONG
trytoclearprimalweather
tryrevertweatherform
printstring STRINGID_EMPTYSTRING3
waitmessage 1
flushtextbox
BattleScript_CoreEnforcerRet:
return

Expand Down Expand Up @@ -1636,8 +1633,7 @@ BattleScript_EffectPartingShotSwitch:
switchindataupdate BS_ATTACKER
hpthresholds BS_ATTACKER
trytoclearprimalweather
printstring STRINGID_EMPTYSTRING3
waitmessage 1
flushtextbox
printstring STRINGID_SWITCHINMON
switchinanim BS_ATTACKER, TRUE
waitstate
Expand Down Expand Up @@ -1992,8 +1988,7 @@ BattleScript_SynchronoiseLoop:
waitmessage B_WAIT_TIME_LONG
resultmessage
waitmessage B_WAIT_TIME_LONG
printstring STRINGID_EMPTYSTRING3
waitmessage 1
flushtextbox
tryfaintmon BS_TARGET
BattleScript_SynchronoiseMoveTargetEnd:
moveendto MOVEEND_NEXT_TARGET
Expand Down Expand Up @@ -2677,8 +2672,7 @@ BattleScript_EffectSimpleBeam:
waitmessage B_WAIT_TIME_LONG
trytoclearprimalweather
tryrevertweatherform
printstring STRINGID_EMPTYSTRING3
waitmessage 1
flushtextbox
tryendneutralizinggas BS_TARGET
goto BattleScript_MoveEnd

Expand Down Expand Up @@ -2731,8 +2725,7 @@ BattleScript_EffectHealingWish:
switchindataupdate BS_ATTACKER
hpthresholds BS_ATTACKER
trytoclearprimalweather
printstring STRINGID_EMPTYSTRING3
waitmessage 1
flushtextbox
printstring STRINGID_SWITCHINMON
switchinanim BS_ATTACKER, TRUE
waitstate
Expand Down Expand Up @@ -2777,8 +2770,7 @@ BattleScript_EffectWorrySeed:
waitmessage B_WAIT_TIME_LONG
trytoclearprimalweather
tryrevertweatherform
printstring STRINGID_EMPTYSTRING3
waitmessage 1
flushtextbox
goto BattleScript_MoveEnd

BattleScript_EffectPowerSplit:
Expand Down Expand Up @@ -2909,8 +2901,7 @@ BattleScript_EffectGastroAcid:
waitmessage B_WAIT_TIME_LONG
trytoclearprimalweather
tryrevertweatherform
printstring STRINGID_EMPTYSTRING3
waitmessage 1
flushtextbox
tryendneutralizinggas BS_TARGET
goto BattleScript_MoveEnd

Expand Down Expand Up @@ -3120,8 +3111,7 @@ BattleScript_EffectHitEscape:
switchindataupdate BS_ATTACKER
hpthresholds BS_ATTACKER
trytoclearprimalweather
printstring STRINGID_EMPTYSTRING3
waitmessage 1
flushtextbox
printstring STRINGID_SWITCHINMON
switchinanim BS_ATTACKER, TRUE
waitstate
Expand Down Expand Up @@ -3777,8 +3767,7 @@ BattleScript_DoMultiHit::
critmessage
waitmessage B_WAIT_TIME_LONG
multihitresultmessage
printstring STRINGID_EMPTYSTRING3
waitmessage 1
flushtextbox
addbyte sMULTIHIT_STRING + 4, 1
moveendto MOVEEND_NEXT_TARGET
jumpifbyte CMP_COMMON_BITS, gMoveResultFlags, MOVE_RESULT_FOE_ENDURED, BattleScript_MultiHitPrintStrings
Expand Down Expand Up @@ -3969,7 +3958,7 @@ BattleScript_TwoTurnMovesSecondTurn::

BattleScriptFirstChargingTurn::
attackcanceler
printstring STRINGID_EMPTYSTRING3
flushtextbox
ppreduce
attackstring
BattleScriptFirstChargingTurnAfterAttackString:
Expand Down Expand Up @@ -4144,8 +4133,7 @@ BattleScript_EffectTransform::
attackstring
ppreduce
trytoclearprimalweather
printstring STRINGID_EMPTYSTRING3
waitmessage 1
flushtextbox
transformdataexecution
attackanimation
waitanimation
Expand Down Expand Up @@ -5046,8 +5034,7 @@ BattleScript_EffectBatonPass::
switchindataupdate BS_ATTACKER
hpthresholds BS_ATTACKER
trytoclearprimalweather
printstring STRINGID_EMPTYSTRING3
waitmessage 1
flushtextbox
printstring STRINGID_SWITCHINMON
switchinanim BS_ATTACKER, TRUE
waitstate
Expand Down Expand Up @@ -6374,8 +6361,7 @@ BattleScript_FaintedMonTryChoose:
switchindataupdate BS_ATTACKER
hpthresholds BS_ATTACKER
trytoclearprimalweather
printstring STRINGID_EMPTYSTRING3
waitmessage 1
flushtextbox
printstring STRINGID_SWITCHINMON
hidepartystatussummary BS_ATTACKER
switchinanim BS_ATTACKER, 0
Expand All @@ -6387,8 +6373,7 @@ BattleScript_FaintedMonSendOutNew:
switchindataupdate BS_FAINTED
hpthresholds BS_FAINTED
trytoclearprimalweather
printstring STRINGID_EMPTYSTRING3
waitmessage 1
flushtextbox
printstring STRINGID_SWITCHINMON
hidepartystatussummary BS_FAINTED
switchinanim BS_FAINTED, FALSE
Expand Down Expand Up @@ -6422,8 +6407,7 @@ BattleScript_LinkHandleFaintedMonLoop::
switchindataupdate BS_FAINTED
hpthresholds BS_FAINTED
trytoclearprimalweather
printstring STRINGID_EMPTYSTRING3
waitmessage 1
flushtextbox
printstring STRINGID_SWITCHINMON
hidepartystatussummary BS_FAINTED
switchinanim BS_FAINTED, FALSE
Expand Down Expand Up @@ -6647,8 +6631,7 @@ BattleScript_DoSwitchOut::
switchindataupdate BS_ATTACKER
hpthresholds BS_ATTACKER
trytoclearprimalweather
printstring STRINGID_EMPTYSTRING3
waitmessage 1
flushtextbox
printstring STRINGID_SWITCHINMON
hidepartystatussummary BS_ATTACKER
switchinanim BS_ATTACKER, FALSE
Expand Down Expand Up @@ -6943,8 +6926,7 @@ BattleScript_RoarSuccessSwitch::
getswitchedmondata BS_TARGET
switchindataupdate BS_TARGET
trytoclearprimalweather
printstring STRINGID_EMPTYSTRING3
waitmessage 1
flushtextbox
switchinanim BS_TARGET, FALSE
waitstate
printstring STRINGID_PKMNWASDRAGGEDOUT
Expand Down Expand Up @@ -7770,15 +7752,14 @@ BattleScript_MoveEffectClearSmog::
return

BattleScript_FocusPunchSetUp::
printstring STRINGID_EMPTYSTRING3
waitmessage 1
flushtextbox
playanimation BS_ATTACKER, B_ANIM_FOCUS_PUNCH_SETUP
printstring STRINGID_PKMNTIGHTENINGFOCUS
waitmessage B_WAIT_TIME_LONG
end3

BattleScript_MegaEvolution::
printstring STRINGID_EMPTYSTRING3
flushtextbox
trytrainerslidemegaevolutionmsg BS_ATTACKER
printstring STRINGID_MEGAEVOREACTING
BattleScript_MegaEvolutionAfterString:
Expand All @@ -7794,7 +7775,7 @@ BattleScript_MegaEvolutionAfterString:
end3

BattleScript_WishMegaEvolution::
printstring STRINGID_EMPTYSTRING3
flushtextbox
trytrainerslidemegaevolutionmsg BS_ATTACKER
printstring STRINGID_FERVENTWISHREACHED
goto BattleScript_MegaEvolutionAfterString
Expand All @@ -7809,8 +7790,7 @@ BattleScript_PrimalReversionRestoreAttacker::
end2

BattleScript_PrimalReversionRet::
printstring STRINGID_EMPTYSTRING3
waitmessage 1
flushtextbox
setbyte gIsCriticalHit, 0
handleprimalreversion BS_ATTACKER, 0
handleprimalreversion BS_ATTACKER, 1
Expand All @@ -7823,7 +7803,7 @@ BattleScript_PrimalReversionRet::
return

BattleScript_UltraBurst::
printstring STRINGID_EMPTYSTRING3
flushtextbox
trytrainerslidezmovemsg BS_ATTACKER
printstring STRINGID_ULTRABURSTREACTING
waitmessage B_WAIT_TIME_LONG
Expand All @@ -7841,8 +7821,7 @@ BattleScript_AttackerFormChange::
pause 5
copybyte gBattlerAbility, gBattlerAttacker
call BattleScript_AbilityPopUp
printstring STRINGID_EMPTYSTRING3
waitmessage 1
flushtextbox
BattleScript_AttackerFormChangeNoPopup::
handleformchange BS_ATTACKER, 0
handleformchange BS_ATTACKER, 1
Expand Down Expand Up @@ -7889,8 +7868,7 @@ BattleScript_CudChewActivates::
end3

BattleScript_TargetFormChangeNoPopup:
printstring STRINGID_EMPTYSTRING3
waitmessage 1
flushtextbox
handleformchange BS_TARGET, 0
handleformchange BS_TARGET, 1
playanimation BS_TARGET, B_ANIM_FORM_CHANGE
Expand Down Expand Up @@ -7921,8 +7899,7 @@ BattleScript_TargetFormChangeWithStringNoPopup::
BattleScript_BattlerFormChangeWithStringEnd3::
pause 5
call BattleScript_AbilityPopUp
printstring STRINGID_EMPTYSTRING3
waitmessage 1
flushtextbox
handleformchange BS_SCRIPTING, 0
handleformchange BS_SCRIPTING, 1
playanimation BS_SCRIPTING, B_ANIM_FORM_CHANGE, NULL
Expand Down Expand Up @@ -9799,7 +9776,7 @@ BattleScript_ActionSelectionItemsCantBeUsed::
endselectionscript

BattleScript_FlushMessageBox::
printstring STRINGID_EMPTYSTRING3
flushtextbox
return

BattleScript_PalacePrintFlavorText::
Expand Down Expand Up @@ -9986,25 +9963,22 @@ BattleScript_AnnounceAirLockCloudNine::
end3

BattleScript_QuickClawActivation::
printstring STRINGID_EMPTYSTRING3
waitmessage 1
flushtextbox
playanimation BS_ATTACKER, B_ANIM_HELD_ITEM_EFFECT
waitanimation
printstring STRINGID_CANACTFASTERTHANKSTO
waitmessage B_WAIT_TIME_LONG
end2

BattleScript_QuickDrawActivation::
printstring STRINGID_EMPTYSTRING3
waitmessage 1
flushtextbox
call BattleScript_AbilityPopUp
printstring STRINGID_CANACTFASTERTHANKSTO
waitmessage B_WAIT_TIME_LONG
end2

BattleScript_CustapBerryActivation::
printstring STRINGID_EMPTYSTRING3
waitmessage 1
flushtextbox
playanimation BS_ATTACKER, B_ANIM_HELD_ITEM_EFFECT
waitanimation
printstring STRINGID_CANACTFASTERTHANKSTO
Expand Down Expand Up @@ -10052,7 +10026,7 @@ BattleScript_JabocaRowapBerryActivate_Dmg:

@ z moves / effects
BattleScript_ZMoveActivateDamaging::
printstring STRINGID_EMPTYSTRING3
flushtextbox
trytrainerslidezmovemsg BS_ATTACKER
printstring STRINGID_ZPOWERSURROUNDS
playanimation BS_ATTACKER, B_ANIM_ZMOVE_ACTIVATE, NULL
Expand All @@ -10061,7 +10035,7 @@ BattleScript_ZMoveActivateDamaging::
return

BattleScript_ZMoveActivateStatus::
printstring STRINGID_EMPTYSTRING3
flushtextbox
trytrainerslidezmovemsg BS_ATTACKER
savetarget
printstring STRINGID_ZPOWERSURROUNDS
Expand Down Expand Up @@ -10272,8 +10246,7 @@ BattleScript_EjectButtonActivates::
switchindataupdate BS_SCRIPTING
hpthresholds BS_SCRIPTING
trytoclearprimalweather
printstring STRINGID_EMPTYSTRING3
waitmessage 1
flushtextbox
printstring 0x3
switchinanim BS_SCRIPTING 0x1
waitstate
Expand Down Expand Up @@ -10653,7 +10626,7 @@ BattleScript_EffectSteelsurge::
@@@ END MAX MOVES @@@

BattleScript_DynamaxBegins::
printstring STRINGID_EMPTYSTRING3
flushtextbox
returnatktoball
pause B_WAIT_TIME_SHORT
returntoball BS_SCRIPTING
Expand All @@ -10664,7 +10637,7 @@ BattleScript_DynamaxBegins::
end3

BattleScript_DynamaxEnds::
printstring STRINGID_EMPTYSTRING3
flushtextbox
updatedynamax
playanimation BS_SCRIPTING, B_ANIM_FORM_CHANGE
waitanimation
Expand Down

0 comments on commit 551dc62

Please sign in to comment.