pokeemerald/data/maps/VerdanturfTown_BattleTentBattleRoom/scripts.inc

180 lines
6.8 KiB
PHP
Raw Normal View History

.set LOCALID_PLAYER, 1
.set LOCALID_OPPONENT, 2
.set LOCALID_ATTENDANT, 3
2021-07-20 21:18:31 +02:00
VerdanturfTown_BattleTentBattleRoom_MapScripts::
map_script MAP_SCRIPT_ON_TRANSITION, VerdanturfTown_BattleTentBattleRoom_OnTransition
2019-12-15 06:55:21 +01:00
map_script MAP_SCRIPT_ON_FRAME_TABLE, VerdanturfTown_BattleTentBattleRoom_OnFrame
map_script MAP_SCRIPT_ON_WARP_INTO_MAP_TABLE, VerdanturfTown_BattleTentBattleRoom_OnWarp
2017-11-10 02:21:31 +01:00
.byte 0
2019-12-15 06:55:21 +01:00
@ On this map the player (OBJ_EVENT_ID_PLAYER) is hidden
@ The player is represented instead by object event 1, which has the gfx id VAR_OBJ_GFX_ID_1
@ The opponent is represented by object event 2, which has the gfx id VAR_OBJ_GFX_ID_0
2021-07-20 21:18:31 +02:00
VerdanturfTown_BattleTentBattleRoom_OnTransition:
2019-12-15 06:55:21 +01:00
call VerdanturfTown_BattleTentBattleRoom_EventScript_SetPlayerGfx
2017-11-10 02:21:31 +01:00
end
2021-07-20 21:18:31 +02:00
VerdanturfTown_BattleTentBattleRoom_EventScript_SetPlayerGfx::
2017-11-10 02:21:31 +01:00
checkplayergender
goto_if_eq VAR_RESULT, MALE, VerdanturfTown_BattleTentBattleRoom_EventScript_SetPlayerGfxMale
goto_if_eq VAR_RESULT, FEMALE, VerdanturfTown_BattleTentBattleRoom_EventScript_SetPlayerGfxFemale
2017-11-10 02:21:31 +01:00
return
2021-07-20 21:18:31 +02:00
VerdanturfTown_BattleTentBattleRoom_EventScript_SetPlayerGfxMale::
setvar VAR_OBJ_GFX_ID_1, OBJ_EVENT_GFX_RIVAL_BRENDAN_NORMAL
setvar VAR_OBJ_GFX_ID_0, OBJ_EVENT_GFX_RIVAL_BRENDAN_NORMAL
2017-11-10 02:21:31 +01:00
return
2021-07-20 21:18:31 +02:00
VerdanturfTown_BattleTentBattleRoom_EventScript_SetPlayerGfxFemale::
setvar VAR_OBJ_GFX_ID_1, OBJ_EVENT_GFX_RIVAL_MAY_NORMAL
setvar VAR_OBJ_GFX_ID_0, OBJ_EVENT_GFX_RIVAL_MAY_NORMAL
2017-11-10 02:21:31 +01:00
return
2021-07-20 21:18:31 +02:00
VerdanturfTown_BattleTentBattleRoom_OnFrame:
2019-12-15 06:55:21 +01:00
map_script_2 VAR_TEMP_0, 0, VerdanturfTown_BattleTentBattleRoom_EventScript_EnterRoom
2017-11-10 02:21:31 +01:00
.2byte 0
2021-07-20 21:18:31 +02:00
VerdanturfTown_BattleTentBattleRoom_EventScript_EnterRoom::
showobjectat LOCALID_PLAYER, MAP_VERDANTURF_TOWN_BATTLE_TENT_BATTLE_ROOM
applymovement LOCALID_PLAYER, VerdanturfTown_BattleTentBattleRoom_Movement_PlayerEnter
2017-11-10 02:21:31 +01:00
waitmovement 0
2019-11-24 22:58:40 +01:00
frontier_get FRONTIER_DATA_BATTLE_NUM
goto_if_ne VAR_RESULT, 0, VerdanturfTown_BattleTentBattleRoom_EventScript_AskContinueChallenge
2021-07-20 21:18:31 +02:00
VerdanturfTown_BattleTentBattleRoom_EventScript_NextOpponentEnter::
2019-11-29 04:46:39 +01:00
tower_setopponent
addobject LOCALID_OPPONENT
applymovement LOCALID_OPPONENT, VerdanturfTown_BattleTentBattleRoom_Movement_OpponentEnter
2017-11-10 02:21:31 +01:00
waitmovement 0
2019-12-02 20:49:22 +01:00
battletent_getopponentintro
msgbox gStringVar4, MSGBOX_DEFAULT
2017-11-10 02:21:31 +01:00
waitmessage
2019-12-07 03:25:46 +01:00
call BattleFrontier_BattlePalaceBattleRoom_EventScript_DoPalaceBattle
2017-11-10 02:21:31 +01:00
switch VAR_RESULT
2019-12-15 06:55:21 +01:00
case 1, VerdanturfTown_BattleTentBattleRoom_EventScript_DefeatedOpponent
2021-07-20 21:18:31 +02:00
VerdanturfTown_BattleTentBattleRoom_EventScript_WarpToLobbyLost::
2019-11-24 22:58:40 +01:00
frontier_set FRONTIER_DATA_CHALLENGE_STATUS, CHALLENGE_STATUS_LOST
2018-04-29 14:21:59 +02:00
special LoadPlayerParty
warp MAP_VERDANTURF_TOWN_BATTLE_TENT_LOBBY, 6, 6
2017-11-10 02:21:31 +01:00
waitstate
2021-07-20 21:18:31 +02:00
VerdanturfTown_BattleTentBattleRoom_EventScript_DefeatedOpponent::
2019-11-24 22:58:40 +01:00
frontier_get FRONTIER_DATA_BATTLE_NUM
2017-11-10 02:21:31 +01:00
addvar VAR_RESULT, 1
2019-11-24 22:58:40 +01:00
frontier_set FRONTIER_DATA_BATTLE_NUM, VAR_RESULT
2017-11-10 02:21:31 +01:00
switch VAR_RESULT
2019-12-15 06:55:21 +01:00
case 3, VerdanturfTown_BattleTentBattleRoom_EventScript_WarpToLobbyWon
applymovement LOCALID_OPPONENT, VerdanturfTown_BattleTentBattleRoom_Movement_OpponentExit
2017-11-10 02:21:31 +01:00
waitmovement 0
removeobject LOCALID_OPPONENT
applymovement LOCALID_ATTENDANT, Common_Movement_WalkInPlaceFasterDown
applymovement LOCALID_PLAYER, Common_Movement_WalkInPlaceFasterUp
2017-11-10 02:21:31 +01:00
waitmovement 0
2019-12-07 03:25:46 +01:00
msgbox BattleFrontier_BattlePalaceBattleRoom_Text_LetMeRestoreYourMons, MSGBOX_DEFAULT
2018-04-29 14:21:59 +02:00
special LoadPlayerParty
special SavePlayerParty
2019-11-24 22:58:40 +01:00
frontier_setpartyorder FRONTIER_PARTY_SIZE
2020-08-21 00:02:00 +02:00
playfanfare MUS_HEAL
2017-11-10 02:21:31 +01:00
waitfanfare
2017-12-16 00:08:23 +01:00
special HealPlayerParty
2017-11-10 02:21:31 +01:00
2021-07-20 21:18:31 +02:00
VerdanturfTown_BattleTentBattleRoom_EventScript_AskContinueChallenge::
2019-11-24 22:58:40 +01:00
frontier_get FRONTIER_DATA_BATTLE_NUM
call_if_eq VAR_RESULT, 1, VerdanturfTown_BattleTentBattleRoom_EventScript_ReadyFor2ndOpponent
call_if_eq VAR_RESULT, 2, VerdanturfTown_BattleTentBattleRoom_EventScript_ReadyFor3rdOpponent
2021-03-31 06:35:56 +02:00
multichoice 20, 6, MULTI_GO_ON_REST_RETIRE, TRUE
2017-11-10 02:21:31 +01:00
switch VAR_RESULT
2019-12-15 06:55:21 +01:00
case 0, VerdanturfTown_BattleTentBattleRoom_EventScript_ContinueChallenge
case 1, VerdanturfTown_BattleTentBattleRoom_EventScript_AskPauseChallenge
case 2, VerdanturfTown_BattleTentBattleRoom_EventScript_AskRetireChallenge
2017-11-10 02:21:31 +01:00
2021-07-20 21:18:31 +02:00
VerdanturfTown_BattleTentBattleRoom_EventScript_AskPauseChallenge::
2019-12-07 03:25:46 +01:00
msgbox BattleFrontier_BattlePalaceBattleRoom_Text_SaveAndQuitGame, MSGBOX_YESNO
2017-11-10 02:21:31 +01:00
switch VAR_RESULT
2019-12-15 06:55:21 +01:00
case NO, VerdanturfTown_BattleTentBattleRoom_EventScript_AskContinueChallenge
case YES, VerdanturfTown_BattleTentBattleRoom_EventScript_PauseChallenge
case MULTI_B_PRESSED, VerdanturfTown_BattleTentBattleRoom_EventScript_AskContinueChallenge
2017-11-10 02:21:31 +01:00
2021-07-20 21:18:31 +02:00
VerdanturfTown_BattleTentBattleRoom_EventScript_AskRetireChallenge::
2019-12-07 03:25:46 +01:00
message BattleFrontier_BattlePalaceBattleRoom_Text_WishToQuitChallenge
2017-11-10 02:21:31 +01:00
waitmessage
2021-03-31 06:35:56 +02:00
multichoicedefault 20, 8, MULTI_YESNO, 1, FALSE
2017-11-10 02:21:31 +01:00
switch VAR_RESULT
2019-12-15 06:55:21 +01:00
case 1, VerdanturfTown_BattleTentBattleRoom_EventScript_AskContinueChallenge
case 0, VerdanturfTown_BattleTentBattleRoom_EventScript_WarpToLobbyLost
case MULTI_B_PRESSED, VerdanturfTown_BattleTentBattleRoom_EventScript_AskContinueChallenge
2017-11-10 02:21:31 +01:00
2021-07-20 21:18:31 +02:00
VerdanturfTown_BattleTentBattleRoom_EventScript_ContinueChallenge::
applymovement LOCALID_ATTENDANT, Common_Movement_WalkInPlaceFasterRight
applymovement LOCALID_PLAYER, Common_Movement_WalkInPlaceFasterRight
2017-11-10 02:21:31 +01:00
waitmovement 0
closemessage
2019-12-15 06:55:21 +01:00
goto VerdanturfTown_BattleTentBattleRoom_EventScript_NextOpponentEnter
2017-11-10 02:21:31 +01:00
2021-07-20 21:18:31 +02:00
VerdanturfTown_BattleTentBattleRoom_EventScript_WarpToLobbyWon::
2019-11-24 22:58:40 +01:00
frontier_set FRONTIER_DATA_CHALLENGE_STATUS, CHALLENGE_STATUS_WON
2018-04-29 14:21:59 +02:00
special LoadPlayerParty
warp MAP_VERDANTURF_TOWN_BATTLE_TENT_LOBBY, 6, 6
2017-11-10 02:21:31 +01:00
waitstate
2021-07-20 21:18:31 +02:00
VerdanturfTown_BattleTentBattleRoom_EventScript_PauseChallenge::
2019-12-07 03:25:46 +01:00
message BattleFrontier_BattlePalaceBattleRoom_Text_SavingData
2017-11-10 02:21:31 +01:00
waitmessage
2019-12-02 20:49:22 +01:00
verdanturftent_save CHALLENGE_STATUS_PAUSED
2017-11-10 02:21:31 +01:00
playse SE_SAVE
waitse
2019-12-15 17:42:50 +01:00
fadescreen FADE_TO_BLACK
2019-11-24 22:58:40 +01:00
frontier_reset
2017-11-10 02:21:31 +01:00
end
2021-07-20 21:18:31 +02:00
VerdanturfTown_BattleTentBattleRoom_OnWarp:
2019-12-15 06:55:21 +01:00
map_script_2 VAR_TEMP_1, 0, VerdanturfTown_BattleTentBattleRoom_EventScript_SetUpObjects
2017-11-10 02:21:31 +01:00
.2byte 0
2021-07-20 21:18:31 +02:00
VerdanturfTown_BattleTentBattleRoom_EventScript_SetUpObjects::
hideobjectat LOCALID_PLAYER, MAP_VERDANTURF_TOWN_BATTLE_TENT_BATTLE_ROOM
2019-12-15 06:55:21 +01:00
call VerdanturfTown_BattleTentBattleRoom_EventScript_SetPlayerGfx
2018-05-19 18:02:43 +02:00
setvar VAR_TEMP_1, 1
applymovement OBJ_EVENT_ID_PLAYER, VerdanturfTown_BattleTentBattleRoom_Movement_SetInvisible
removeobject LOCALID_OPPONENT
2017-11-10 02:21:31 +01:00
end
2021-07-20 21:18:31 +02:00
VerdanturfTown_BattleTentBattleRoom_EventScript_ReadyFor2ndOpponent::
2019-12-07 03:25:46 +01:00
message BattleFrontier_BattlePalaceBattleRoom_Text_PreparedFor2ndOpponent
2017-11-10 02:21:31 +01:00
waitmessage
return
2021-07-20 21:18:31 +02:00
VerdanturfTown_BattleTentBattleRoom_EventScript_ReadyFor3rdOpponent::
2019-12-07 03:25:46 +01:00
message BattleFrontier_BattlePalaceBattleRoom_Text_PreparedFor3rdOpponent
2017-11-10 02:21:31 +01:00
waitmessage
return
2021-07-20 21:18:31 +02:00
VerdanturfTown_BattleTentBattleRoom_Movement_SetInvisible:
set_invisible
2017-11-10 02:21:31 +01:00
step_end
2021-07-20 21:18:31 +02:00
VerdanturfTown_BattleTentBattleRoom_Movement_PlayerEnter:
set_visible
walk_up
walk_up
walk_up
face_right
2017-11-10 02:21:31 +01:00
step_end
2021-07-20 21:18:31 +02:00
VerdanturfTown_BattleTentBattleRoom_Movement_OpponentEnter:
walk_down
walk_down
walk_down
walk_down
face_left
2017-11-10 02:21:31 +01:00
step_end
2021-07-20 21:18:31 +02:00
VerdanturfTown_BattleTentBattleRoom_Movement_OpponentExit:
walk_up
walk_up
walk_up
walk_up
2017-11-10 02:21:31 +01:00
step_end