pokeemerald/data/scripts/trainer_battle.inc

144 lines
3.7 KiB
PHP
Raw Normal View History

2021-07-20 21:18:31 +02:00
EventScript_StartTrainerApproach::
2021-01-26 08:16:26 +01:00
selectapproachingtrainer
lockfortrainer
2021-07-20 21:18:31 +02:00
EventScript_TrainerApproach::
special PlayTrainerEncounterMusic
special DoTrainerApproach
2018-12-07 23:50:56 +01:00
waitstate
goto EventScript_ShowTrainerIntroMsg
2021-07-20 21:18:31 +02:00
EventScript_TryDoNormalTrainerBattle::
2018-12-07 23:50:56 +01:00
lock
faceplayer
applymovement VAR_LAST_TALKED, Movement_RevealTrainer
waitmovement 0
specialvar VAR_RESULT, GetTrainerFlag
compare VAR_RESULT, FALSE
2018-12-22 02:28:24 +01:00
goto_if_ne EventScript_NoNormalTrainerBattle
special PlayTrainerEncounterMusic
special SetTrainerFacingDirection
2018-12-07 23:50:56 +01:00
goto EventScript_ShowTrainerIntroMsg
2021-07-20 21:18:31 +02:00
EventScript_NoNormalTrainerBattle::
2018-12-07 23:50:56 +01:00
gotopostbattlescript
2021-07-20 21:18:31 +02:00
EventScript_TryDoDoubleTrainerBattle::
2018-12-07 23:50:56 +01:00
lock
faceplayer
call EventScript_RevealTrainer
specialvar VAR_RESULT, GetTrainerFlag
compare VAR_RESULT, FALSE
2018-12-22 02:28:24 +01:00
goto_if_ne EventScript_NoDoubleTrainerBattle
2018-12-07 23:50:56 +01:00
special HasEnoughMonsForDoubleBattle
compare VAR_RESULT, PLAYER_HAS_TWO_USABLE_MONS
2018-12-22 02:28:24 +01:00
goto_if_ne EventScript_NotEnoughMonsForDoubleBattle
special PlayTrainerEncounterMusic
special SetTrainerFacingDirection
2018-12-07 23:50:56 +01:00
goto EventScript_ShowTrainerIntroMsg
2021-07-20 21:18:31 +02:00
EventScript_NotEnoughMonsForDoubleBattle::
2018-12-07 23:50:56 +01:00
special ShowTrainerCantBattleSpeech
waitmessage
waitbuttonpress
release
end
2021-07-20 21:18:31 +02:00
EventScript_NoDoubleTrainerBattle::
2018-12-07 23:50:56 +01:00
gotopostbattlescript
2021-07-20 21:18:31 +02:00
EventScript_DoNoIntroTrainerBattle::
2018-12-07 23:50:56 +01:00
applymovement VAR_LAST_TALKED, Movement_RevealTrainer
waitmovement 0
special PlayTrainerEncounterMusic
2018-12-07 23:50:56 +01:00
trainerbattlebegin
gotopostbattlescript
2021-07-20 21:18:31 +02:00
EventScript_TryDoRematchBattle::
2018-12-07 23:50:56 +01:00
call EventScript_RevealTrainer
specialvar VAR_RESULT, IsTrainerReadyForRematch
2020-03-03 20:47:14 +01:00
compare VAR_RESULT, FALSE
2018-12-22 02:28:24 +01:00
goto_if_eq EventScript_NoRematchTrainerBattle
special PlayTrainerEncounterMusic
special SetTrainerFacingDirection
2018-12-07 23:50:56 +01:00
special ShowTrainerIntroSpeech
waitmessage
waitbuttonpress
special BattleSetup_StartRematchBattle
waitstate
releaseall
end
2021-07-20 21:18:31 +02:00
EventScript_NoRematchTrainerBattle::
2018-12-07 23:50:56 +01:00
gotopostbattlescript
2021-07-20 21:18:31 +02:00
EventScript_TryDoDoubleRematchBattle::
2018-12-07 23:50:56 +01:00
specialvar VAR_RESULT, IsTrainerReadyForRematch
2020-03-03 20:47:14 +01:00
compare VAR_RESULT, FALSE
2018-12-22 02:28:24 +01:00
goto_if_eq EventScript_NoDoubleRematchTrainerBattle
2018-12-07 23:50:56 +01:00
special HasEnoughMonsForDoubleBattle
compare VAR_RESULT, PLAYER_HAS_TWO_USABLE_MONS
2018-12-22 02:28:24 +01:00
goto_if_ne EventScript_NotEnoughMonsForDoubleRematchBattle
special PlayTrainerEncounterMusic
special SetTrainerFacingDirection
2018-12-07 23:50:56 +01:00
special ShowTrainerIntroSpeech
waitmessage
waitbuttonpress
special BattleSetup_StartRematchBattle
waitstate
releaseall
end
2021-07-20 21:18:31 +02:00
EventScript_NoDoubleRematchTrainerBattle::
2018-12-07 23:50:56 +01:00
gotopostbattlescript
2021-07-20 21:18:31 +02:00
EventScript_NotEnoughMonsForDoubleRematchBattle::
2018-12-07 23:50:56 +01:00
special ShowTrainerCantBattleSpeech
waitmessage
waitbuttonpress
release
end
2021-07-20 21:18:31 +02:00
EventScript_RevealTrainer::
2018-12-07 23:50:56 +01:00
applymovement VAR_LAST_TALKED, Movement_RevealTrainer
waitmovement 0
return
2021-07-20 21:18:31 +02:00
Movement_RevealTrainer:
2018-12-07 23:50:56 +01:00
reveal_trainer
step_end
2021-07-20 21:18:31 +02:00
EventScript_ShowTrainerIntroMsg::
2018-12-07 23:50:56 +01:00
special ShowTrainerIntroSpeech
waitmessage
waitbuttonpress
special TryPrepareSecondApproachingTrainer
compare VAR_RESULT, TRUE
goto_if_eq EventScript_TrainerApproach
2018-12-07 23:50:56 +01:00
goto EventScript_DoTrainerBattle
2021-07-20 21:18:31 +02:00
EventScript_DoTrainerBattle::
2018-12-07 23:50:56 +01:00
trainerbattlebegin
2020-03-03 20:47:14 +01:00
@ Below battle mode check only needed in FRLG
2018-12-07 23:50:56 +01:00
specialvar VAR_RESULT, GetTrainerBattleMode
compare VAR_RESULT, TRAINER_BATTLE_SINGLE
2018-12-22 02:28:24 +01:00
goto_if_eq EventScript_EndTrainerBattle
2018-12-07 23:50:56 +01:00
compare VAR_RESULT, TRAINER_BATTLE_CONTINUE_SCRIPT
2018-12-22 02:28:24 +01:00
goto_if_eq EventScript_EndTrainerBattle
2018-12-07 23:50:56 +01:00
compare VAR_RESULT, TRAINER_BATTLE_CONTINUE_SCRIPT_NO_MUSIC
2018-12-22 02:28:24 +01:00
goto_if_eq EventScript_EndTrainerBattle
2018-12-07 23:50:56 +01:00
compare VAR_RESULT, TRAINER_BATTLE_CONTINUE_SCRIPT_DOUBLE
2018-12-22 02:28:24 +01:00
goto_if_eq EventScript_EndTrainerBattle
2018-12-07 23:50:56 +01:00
compare VAR_RESULT, TRAINER_BATTLE_CONTINUE_SCRIPT_DOUBLE_NO_MUSIC
2018-12-22 02:28:24 +01:00
goto_if_eq EventScript_EndTrainerBattle
2021-07-20 21:18:31 +02:00
EventScript_EndTrainerBattle::
2018-12-07 23:50:56 +01:00
gotobeatenscript
releaseall
end
2021-07-20 21:18:31 +02:00
Std_MsgboxAutoclose::
message 0x0
waitmessage
waitbuttonpress
release
return