2020-06-21 07:56:57 +02:00
|
|
|
.set LOCALID_OPPONENT, 2
|
|
|
|
.set LOCALID_PLAYER, 3
|
|
|
|
|
2021-07-20 21:18:31 +02:00
|
|
|
SlateportCity_BattleTentBattleRoom_MapScripts::
|
2019-04-22 22:31:51 +02:00
|
|
|
map_script MAP_SCRIPT_ON_TRANSITION, SlateportCity_BattleTentBattleRoom_OnTransition
|
2019-12-15 06:55:21 +01:00
|
|
|
map_script MAP_SCRIPT_ON_WARP_INTO_MAP_TABLE, SlateportCity_BattleTentBattleRoom_OnWarp
|
|
|
|
map_script MAP_SCRIPT_ON_FRAME_TABLE, SlateportCity_BattleTentBattleRoom_OnFrame
|
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
|
2020-06-21 07:56:57 +02:00
|
|
|
@ The player is represented instead by LOCALID_PLAYER, which has the gfx id VAR_OBJ_GFX_ID_1
|
2019-12-15 06:55:21 +01:00
|
|
|
|
2021-07-20 21:18:31 +02:00
|
|
|
SlateportCity_BattleTentBattleRoom_OnTransition:
|
2019-12-15 06:55:21 +01:00
|
|
|
call SlateportCity_BattleTentBattleRoom_EventScript_SetPlayerGfx
|
2017-11-10 02:21:31 +01:00
|
|
|
end
|
|
|
|
|
2021-07-20 21:18:31 +02:00
|
|
|
SlateportCity_BattleTentBattleRoom_EventScript_SetPlayerGfx::
|
2017-11-10 02:21:31 +01:00
|
|
|
checkplayergender
|
2021-11-19 05:06:30 +01:00
|
|
|
goto_if_eq VAR_RESULT, MALE, SlateportCity_BattleTentBattleRoom_EventScript_SetPlayerGfxMale
|
|
|
|
goto_if_eq VAR_RESULT, FEMALE, SlateportCity_BattleTentBattleRoom_EventScript_SetPlayerGfxFemale
|
2017-11-10 02:21:31 +01:00
|
|
|
return
|
|
|
|
|
2021-07-20 21:18:31 +02:00
|
|
|
SlateportCity_BattleTentBattleRoom_EventScript_SetPlayerGfxMale::
|
2019-11-21 05:12:51 +01:00
|
|
|
setvar VAR_OBJ_GFX_ID_1, OBJ_EVENT_GFX_RIVAL_BRENDAN_NORMAL
|
2017-11-10 02:21:31 +01:00
|
|
|
return
|
|
|
|
|
2021-07-20 21:18:31 +02:00
|
|
|
SlateportCity_BattleTentBattleRoom_EventScript_SetPlayerGfxFemale::
|
2019-11-21 05:12:51 +01:00
|
|
|
setvar VAR_OBJ_GFX_ID_1, OBJ_EVENT_GFX_RIVAL_MAY_NORMAL
|
2017-11-10 02:21:31 +01:00
|
|
|
return
|
|
|
|
|
2021-07-20 21:18:31 +02:00
|
|
|
SlateportCity_BattleTentBattleRoom_OnWarp:
|
2019-12-15 06:55:21 +01:00
|
|
|
map_script_2 VAR_TEMP_1, 0, SlateportCity_BattleTentBattleRoom_EventScript_SetUpObjects
|
2017-11-10 02:21:31 +01:00
|
|
|
.2byte 0
|
|
|
|
|
2021-07-20 21:18:31 +02:00
|
|
|
SlateportCity_BattleTentBattleRoom_EventScript_SetUpObjects::
|
2018-05-19 18:02:43 +02:00
|
|
|
setvar VAR_TEMP_1, 1
|
2019-11-21 05:12:51 +01:00
|
|
|
hideobjectat OBJ_EVENT_ID_PLAYER, MAP_FALLARBOR_TOWN_BATTLE_TENT_BATTLE_ROOM
|
2020-06-21 07:56:57 +02:00
|
|
|
hideobjectat LOCALID_OPPONENT, MAP_SLATEPORT_CITY_BATTLE_TENT_BATTLE_ROOM
|
2017-11-10 02:21:31 +01:00
|
|
|
end
|
|
|
|
|
2021-07-20 21:18:31 +02:00
|
|
|
SlateportCity_BattleTentBattleRoom_OnFrame:
|
2019-12-15 06:55:21 +01:00
|
|
|
map_script_2 VAR_TEMP_0, 0, SlateportCity_BattleTentBattleRoom_EventScript_EnterRoom
|
2017-11-10 02:21:31 +01:00
|
|
|
.2byte 0
|
|
|
|
|
2021-07-20 21:18:31 +02:00
|
|
|
SlateportCity_BattleTentBattleRoom_EventScript_EnterRoom::
|
2020-06-21 07:56:57 +02:00
|
|
|
applymovement LOCALID_PLAYER, SlateportCity_BattleTentBattleRoom_Movement_PlayerEnter
|
2017-11-10 02:21:31 +01:00
|
|
|
waitmovement 0
|
2019-12-02 14:44:34 +01:00
|
|
|
factory_setopponentgfx
|
2020-06-21 07:56:57 +02:00
|
|
|
setobjectxyperm LOCALID_OPPONENT, 5, 1
|
|
|
|
removeobject LOCALID_OPPONENT
|
|
|
|
addobject LOCALID_OPPONENT
|
|
|
|
applymovement LOCALID_OPPONENT, SlateportCity_BattleTentBattleRoom_Movement_OpponentEnter
|
2017-11-10 02:21:31 +01:00
|
|
|
waitmovement 0
|
2019-12-02 20:49:22 +01:00
|
|
|
battletent_getopponentintro
|
2017-11-10 02:21:31 +01:00
|
|
|
lockall
|
2018-12-02 09:37:46 +01:00
|
|
|
msgbox gStringVar4, MSGBOX_DEFAULT
|
2017-11-10 02:21:31 +01:00
|
|
|
waitmessage
|
|
|
|
closemessage
|
2017-12-16 00:08:23 +01:00
|
|
|
special HealPlayerParty
|
2018-10-21 20:13:12 +02:00
|
|
|
setvar VAR_0x8004, SPECIAL_BATTLE_FACTORY
|
2017-11-10 02:21:31 +01:00
|
|
|
setvar VAR_0x8005, 0
|
2018-10-21 20:13:12 +02:00
|
|
|
special DoSpecialTrainerBattle
|
2017-11-10 02:21:31 +01:00
|
|
|
waitstate
|
|
|
|
switch VAR_RESULT
|
2019-12-15 06:55:21 +01:00
|
|
|
case 1, SlateportCity_BattleTentBattleRoom_EventScript_DefeatedOpponent
|
2021-07-20 21:18:31 +02:00
|
|
|
SlateportCity_BattleTent_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
|
2021-11-15 18:04:54 +01:00
|
|
|
warp MAP_SLATEPORT_CITY_BATTLE_TENT_LOBBY, 6, 6
|
2017-11-10 02:21:31 +01:00
|
|
|
waitstate
|
2019-12-15 06:55:21 +01:00
|
|
|
@ forced stop
|
2017-11-10 02:21:31 +01:00
|
|
|
|
2021-07-20 21:18:31 +02:00
|
|
|
SlateportCity_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, SlateportCity_BattleTentBattleRoom_EventScript_WarpToLobbyWon
|
2017-11-10 02:21:31 +01:00
|
|
|
setvar VAR_0x8006, 1
|
2021-11-15 18:04:54 +01:00
|
|
|
warp MAP_SLATEPORT_CITY_BATTLE_TENT_CORRIDOR, 2, 3
|
2017-11-10 02:21:31 +01:00
|
|
|
waitstate
|
2019-12-15 06:55:21 +01:00
|
|
|
@ forced stop
|
2017-11-10 02:21:31 +01:00
|
|
|
|
2021-07-20 21:18:31 +02:00
|
|
|
SlateportCity_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
|
2021-11-15 18:04:54 +01:00
|
|
|
warp MAP_SLATEPORT_CITY_BATTLE_TENT_LOBBY, 6, 6
|
2017-11-10 02:21:31 +01:00
|
|
|
waitstate
|
|
|
|
@ forced stop
|
|
|
|
|
2021-07-20 21:18:31 +02:00
|
|
|
SlateportCity_BattleTentBattleRoom_Movement_PlayerEnter:
|
2018-06-14 01:19:19 +02:00
|
|
|
walk_up
|
|
|
|
walk_up
|
|
|
|
walk_up
|
2021-11-04 19:22:28 +01:00
|
|
|
walk_in_place_faster_right
|
2017-11-10 02:21:31 +01:00
|
|
|
step_end
|
|
|
|
|
2021-07-20 21:18:31 +02:00
|
|
|
SlateportCity_BattleTentBattleRoom_Movement_OpponentEnter:
|
2018-06-14 01:19:19 +02:00
|
|
|
walk_down
|
|
|
|
walk_down
|
|
|
|
walk_down
|
|
|
|
walk_down
|
2021-11-04 19:22:28 +01:00
|
|
|
walk_in_place_faster_left
|
2017-11-10 02:21:31 +01:00
|
|
|
step_end
|
|
|
|
|