pokeemerald/data/maps/FallarborTown_BattleTentBattleRoom/scripts.inc

243 lines
8.9 KiB
PHP
Raw Permalink Normal View History

.set LOCALID_PLAYER, 1
.set LOCALID_ATTENDANT, 2
.set LOCALID_OPPONENT, 3
2021-07-20 21:18:31 +02:00
FallarborTown_BattleTentBattleRoom_MapScripts::
map_script MAP_SCRIPT_ON_TRANSITION, FallarborTown_BattleTentBattleRoom_OnTransition
2019-12-15 06:55:21 +01:00
map_script MAP_SCRIPT_ON_FRAME_TABLE, FallarborTown_BattleTentBattleRoom_OnFrame
map_script MAP_SCRIPT_ON_WARP_INTO_MAP_TABLE, FallarborTown_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 3, which has the gfx id VAR_OBJ_GFX_ID_0
2021-07-20 21:18:31 +02:00
FallarborTown_BattleTentBattleRoom_OnTransition:
2019-12-15 06:55:21 +01:00
call FallarborTown_BattleTentBattleRoom_EventScript_SetPlayerGfx
2017-11-10 02:21:31 +01:00
end
2021-07-20 21:18:31 +02:00
FallarborTown_BattleTentBattleRoom_EventScript_SetPlayerGfx::
2017-11-10 02:21:31 +01:00
checkplayergender
goto_if_eq VAR_RESULT, MALE, FallarborTown_BattleTentBattleRoom_EventScript_SetPlayerGfxMale
goto_if_eq VAR_RESULT, FEMALE, FallarborTown_BattleTentBattleRoom_EventScript_SetPlayerGfxFemale
2017-11-10 02:21:31 +01:00
return
2021-07-20 21:18:31 +02:00
FallarborTown_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
FallarborTown_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
FallarborTown_BattleTentBattleRoom_OnFrame:
2019-12-15 06:55:21 +01:00
map_script_2 VAR_TEMP_0, 0, FallarborTown_BattleTentBattleRoom_EventScript_EnterRoom
2017-11-10 02:21:31 +01:00
.2byte 0
2021-07-20 21:18:31 +02:00
FallarborTown_BattleTentBattleRoom_EventScript_EnterRoom::
2017-11-10 02:21:31 +01:00
lockall
showobjectat LOCALID_PLAYER, MAP_FALLARBOR_TOWN_BATTLE_TENT_BATTLE_ROOM
applymovement LOCALID_PLAYER, FallarborTown_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, FallarborTown_BattleTentBattleRoom_EventScript_ResumeChallenge
2021-07-20 21:18:31 +02:00
FallarborTown_BattleTentBattleRoom_EventScript_NextOpponentEnter::
2019-11-29 04:46:39 +01:00
tower_setopponent
addobject LOCALID_OPPONENT
applymovement LOCALID_OPPONENT, FallarborTown_BattleTentBattleRoom_Movement_OpponentEnter
2017-11-10 02:21:31 +01:00
waitmovement 0
applymovement LOCALID_ATTENDANT, FallarborTown_BattleTentBattleRoom_Movement_AttendantJump
2020-08-21 00:02:00 +02:00
playse SE_M_BELLY_DRUM
2017-11-10 02:21:31 +01:00
waitse
waitmovement 0
2019-11-26 23:20:08 +01:00
msgbox BattleFrontier_BattleArenaBattleRoom_Text_SetKOTourneyBegin, MSGBOX_DEFAULT
2019-12-02 20:49:22 +01:00
battletent_getopponentintro
msgbox gStringVar4, MSGBOX_DEFAULT
2017-11-10 02:21:31 +01:00
waitmessage
2019-11-26 23:20:08 +01:00
call BattleFrontier_BattleArenaBattleRoom_EventScript_DoArenaBattle
2017-11-10 02:21:31 +01:00
switch VAR_RESULT
2019-12-15 06:55:21 +01:00
case 1, FallarborTown_BattleTentBattleRoom_EventScript_DefeatedOpponent
applymovement LOCALID_ATTENDANT, FallarborTown_BattleTentBattleRoom_Movement_AttendantJump
2020-08-21 00:02:00 +02:00
playse SE_M_SNORE
2017-11-10 02:21:31 +01:00
waitse
waitmovement 0
2019-12-02 20:49:22 +01:00
fallarbortent_getopponentname
2019-11-26 23:20:08 +01:00
msgbox BattleFrontier_BattleArenaBattleRoom_Text_WinnerIsOpponent, MSGBOX_DEFAULT
2021-07-20 21:18:31 +02:00
FallarborTown_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_FALLARBOR_TOWN_BATTLE_TENT_LOBBY, 6, 6
2017-11-10 02:21:31 +01:00
waitstate
2021-07-20 21:18:31 +02:00
FallarborTown_BattleTentBattleRoom_EventScript_DefeatedOpponent::
applymovement LOCALID_ATTENDANT, FallarborTown_BattleTentBattleRoom_Movement_AttendantJump
2020-08-21 00:02:00 +02:00
playse SE_BANG
2017-11-10 02:21:31 +01:00
waitse
waitmovement 0
2019-11-26 23:20:08 +01:00
msgbox BattleFrontier_BattleArenaBattleRoom_Text_WinnerIsPlayer, MSGBOX_DEFAULT
2017-11-10 02:21:31 +01:00
closemessage
2021-07-20 21:18:31 +02:00
FallarborTown_BattleTentBattleRoom_EventScript_IncrementBattleNum::
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, FallarborTown_BattleTentBattleRoom_EventScript_WarpToLobbyWon
applymovement LOCALID_OPPONENT, FallarborTown_BattleTentBattleRoom_Movement_OpponentExit
2017-11-10 02:21:31 +01:00
waitmovement 0
removeobject LOCALID_OPPONENT
applymovement LOCALID_ATTENDANT, FallarborTown_BattleTentBattleRoom_Movement_AttendantApproachPlayer
2017-11-10 02:21:31 +01:00
waitmovement 0
applymovement LOCALID_PLAYER, FallarborTown_BattleTentBattleRoom_Movement_PlayerFaceAttendant
2017-11-10 02:21:31 +01:00
waitmovement 0
2019-11-26 23:20:08 +01:00
msgbox BattleFrontier_BattleArenaBattleRoom_Text_MonsWillBeRestored, 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
2021-07-20 21:18:31 +02:00
FallarborTown_BattleTentBattleRoom_EventScript_AskContinueChallenge::
2019-11-24 22:58:40 +01:00
frontier_get FRONTIER_DATA_BATTLE_NUM
call_if_eq VAR_RESULT, 1, FallarborTown_BattleTentBattleRoom_EventScript_ReadyFor2ndOpponent
call_if_eq VAR_RESULT, 2, FallarborTown_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, FallarborTown_BattleTentBattleRoom_EventScript_ContinueChallenge
case 1, FallarborTown_BattleTentBattleRoom_EventScript_AskPauseChallenge
case 2, FallarborTown_BattleTentBattleRoom_EventScript_AskRetireChallenge
2017-11-10 02:21:31 +01:00
2021-07-20 21:18:31 +02:00
FallarborTown_BattleTentBattleRoom_EventScript_AskPauseChallenge::
2019-11-26 23:20:08 +01:00
msgbox BattleFrontier_BattleArenaBattleRoom_Text_SaveAndShutDown, MSGBOX_YESNO
2017-11-10 02:21:31 +01:00
switch VAR_RESULT
2019-12-15 06:55:21 +01:00
case NO, FallarborTown_BattleTentBattleRoom_EventScript_AskContinueChallenge
case YES, FallarborTown_BattleTentBattleRoom_EventScript_PauseChallenge
case MULTI_B_PRESSED, FallarborTown_BattleTentBattleRoom_EventScript_AskContinueChallenge
2017-11-10 02:21:31 +01:00
2021-07-20 21:18:31 +02:00
FallarborTown_BattleTentBattleRoom_EventScript_AskRetireChallenge::
2019-11-26 23:20:08 +01:00
message BattleFrontier_BattleArenaBattleRoom_Text_RetireFromChallenge
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, FallarborTown_BattleTentBattleRoom_EventScript_AskContinueChallenge
case 0, FallarborTown_BattleTentBattleRoom_EventScript_WarpToLobbyLost
case MULTI_B_PRESSED, FallarborTown_BattleTentBattleRoom_EventScript_AskContinueChallenge
2017-11-10 02:21:31 +01:00
2021-07-20 21:18:31 +02:00
FallarborTown_BattleTentBattleRoom_EventScript_ContinueChallenge::
2017-11-10 02:21:31 +01:00
closemessage
applymovement LOCALID_ATTENDANT, FallarborTown_BattleTentBattleRoom_Movement_AttendantReturnToPos
2017-11-10 02:21:31 +01:00
waitmovement 0
applymovement LOCALID_PLAYER, FallarborTown_BattleTentBattleRoom_Movement_PlayerFaceBattle
2017-11-10 02:21:31 +01:00
waitmovement 0
2019-12-15 06:55:21 +01:00
goto FallarborTown_BattleTentBattleRoom_EventScript_NextOpponentEnter
2017-11-10 02:21:31 +01:00
waitstate
2021-07-20 21:18:31 +02:00
FallarborTown_BattleTentBattleRoom_EventScript_WarpToLobbyWon::
2017-11-10 02:21:31 +01:00
delay 60
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_FALLARBOR_TOWN_BATTLE_TENT_LOBBY, 6, 6
2017-11-10 02:21:31 +01:00
waitstate
2019-12-15 06:55:21 +01:00
@ Unreachable code block? The flow into the next block also doesnt make sense
2019-11-29 04:46:39 +01:00
arena_get ARENA_DATA_WIN_STREAK
goto_if_eq VAR_RESULT, MAX_STREAK, FallarborTown_BattleTentBattleRoom_EventScript_IncrementBattleNum
2017-11-10 02:21:31 +01:00
addvar VAR_RESULT, 1
2019-11-29 04:46:39 +01:00
arena_set ARENA_DATA_WIN_STREAK, VAR_RESULT
2019-12-15 06:55:21 +01:00
@ See above
2021-07-20 21:18:31 +02:00
FallarborTown_BattleTentBattleRoom_EventScript_ReadyFor2ndOpponent::
2019-11-26 23:20:08 +01:00
message BattleFrontier_BattleArenaBattleRoom_Text_ReadyFor2ndOpponent
2017-11-10 02:21:31 +01:00
waitmessage
return
2021-07-20 21:18:31 +02:00
FallarborTown_BattleTentBattleRoom_EventScript_ReadyFor3rdOpponent::
2019-11-26 23:20:08 +01:00
message BattleFrontier_BattleArenaBattleRoom_Text_ReadyFor3rdOpponent
2017-11-10 02:21:31 +01:00
waitmessage
return
2021-07-20 21:18:31 +02:00
FallarborTown_BattleTentBattleRoom_EventScript_PauseChallenge::
2019-11-26 23:20:08 +01:00
message BattleFrontier_BattleArenaBattleRoom_Text_SavingPleaseWait
2017-11-10 02:21:31 +01:00
waitmessage
2019-12-02 20:49:22 +01:00
fallarbortent_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
FallarborTown_BattleTentBattleRoom_EventScript_ResumeChallenge::
applymovement LOCALID_ATTENDANT, FallarborTown_BattleTentBattleRoom_Movement_AttendantApproachPlayer
2017-11-10 02:21:31 +01:00
waitmovement 0
applymovement LOCALID_PLAYER, FallarborTown_BattleTentBattleRoom_Movement_PlayerFaceAttendant
2017-11-10 02:21:31 +01:00
waitmovement 0
2019-12-15 06:55:21 +01:00
goto FallarborTown_BattleTentBattleRoom_EventScript_AskContinueChallenge
2017-11-10 02:21:31 +01:00
end
2021-07-20 21:18:31 +02:00
FallarborTown_BattleTentBattleRoom_Movement_PlayerEnter:
walk_up
walk_up
walk_up
walk_in_place_faster_right
2017-11-10 02:21:31 +01:00
step_end
2021-07-20 21:18:31 +02:00
FallarborTown_BattleTentBattleRoom_Movement_PlayerFaceBattle:
walk_in_place_faster_right
2017-11-10 02:21:31 +01:00
step_end
2021-07-20 21:18:31 +02:00
FallarborTown_BattleTentBattleRoom_Movement_PlayerFaceAttendant:
walk_in_place_faster_left
2017-11-10 02:21:31 +01:00
step_end
2021-07-20 21:18:31 +02:00
FallarborTown_BattleTentBattleRoom_Movement_OpponentEnter:
walk_down
walk_down
walk_down
walk_down
walk_in_place_faster_left
2017-11-10 02:21:31 +01:00
step_end
2019-12-15 06:55:21 +01:00
@ Unused
2021-07-20 21:18:31 +02:00
FallarborTown_BattleTentBattleRoom_Movement_OpponentStepForward:
walk_left
step_end
2017-11-10 02:21:31 +01:00
2021-07-20 21:18:31 +02:00
FallarborTown_BattleTentBattleRoom_Movement_OpponentExit:
walk_up
walk_up
walk_up
walk_up
2017-11-10 02:21:31 +01:00
step_end
2021-07-20 21:18:31 +02:00
FallarborTown_BattleTentBattleRoom_Movement_AttendantJump:
disable_jump_landing_ground_effect
jump_in_place_down
2017-11-10 02:21:31 +01:00
step_end
2021-07-20 21:18:31 +02:00
FallarborTown_BattleTentBattleRoom_Movement_AttendantApproachPlayer:
walk_down
walk_down
walk_down
walk_in_place_faster_right
2017-11-10 02:21:31 +01:00
step_end
2021-07-20 21:18:31 +02:00
FallarborTown_BattleTentBattleRoom_Movement_AttendantReturnToPos:
walk_up
walk_up
walk_up
walk_in_place_faster_down
2017-11-10 02:21:31 +01:00
step_end
2021-07-20 21:18:31 +02:00
FallarborTown_BattleTentBattleRoom_OnWarp:
2019-12-15 06:55:21 +01:00
map_script_2 VAR_TEMP_1, 0, FallarborTown_BattleTentBattleRoom_EventScript_SetUpObjects
2017-11-10 02:21:31 +01:00
.2byte 0
2021-07-20 21:18:31 +02:00
FallarborTown_BattleTentBattleRoom_EventScript_SetUpObjects::
hideobjectat OBJ_EVENT_ID_PLAYER, MAP_FALLARBOR_TOWN_BATTLE_TENT_BATTLE_ROOM
hideobjectat LOCALID_PLAYER, MAP_FALLARBOR_TOWN_BATTLE_TENT_BATTLE_ROOM
removeobject LOCALID_OPPONENT
2018-05-19 18:02:43 +02:00
setvar VAR_TEMP_1, 1
2017-11-10 02:21:31 +01:00
end