pokeemerald/data/scripts/trainer_battle.inc

132 lines
3.6 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
goto_if_ne VAR_RESULT, FALSE, 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
goto_if_ne VAR_RESULT, FALSE, EventScript_NoDoubleTrainerBattle
2018-12-07 23:50:56 +01:00
special HasEnoughMonsForDoubleBattle
goto_if_ne VAR_RESULT, PLAYER_HAS_TWO_USABLE_MONS, 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
2021-11-18 06:32:28 +01:00
dotrainerbattle
2018-12-07 23:50:56 +01:00
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
goto_if_eq VAR_RESULT, FALSE, 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
goto_if_eq VAR_RESULT, FALSE, EventScript_NoDoubleRematchTrainerBattle
2018-12-07 23:50:56 +01:00
special HasEnoughMonsForDoubleBattle
goto_if_ne VAR_RESULT, PLAYER_HAS_TWO_USABLE_MONS, 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
goto_if_eq VAR_RESULT, TRUE, EventScript_TrainerApproach
2018-12-07 23:50:56 +01:00
goto EventScript_DoTrainerBattle
2021-07-20 21:18:31 +02:00
EventScript_DoTrainerBattle::
2021-11-18 06:32:28 +01:00
dotrainerbattle
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
goto_if_eq VAR_RESULT, TRAINER_BATTLE_SINGLE, EventScript_EndTrainerBattle
goto_if_eq VAR_RESULT, TRAINER_BATTLE_CONTINUE_SCRIPT, EventScript_EndTrainerBattle
goto_if_eq VAR_RESULT, TRAINER_BATTLE_CONTINUE_SCRIPT_NO_MUSIC, EventScript_EndTrainerBattle
goto_if_eq VAR_RESULT, TRAINER_BATTLE_CONTINUE_SCRIPT_DOUBLE, EventScript_EndTrainerBattle
goto_if_eq VAR_RESULT, TRAINER_BATTLE_CONTINUE_SCRIPT_DOUBLE_NO_MUSIC, 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::
2021-11-16 16:53:18 +01:00
message NULL
waitmessage
waitbuttonpress
release
return