pokeemerald/data/maps/SlateportCity_BattleTentBattleRoom/scripts.inc

108 lines
3.5 KiB
PHP
Raw Normal View History

.set LOCALID_OPPONENT, 2
.set LOCALID_PLAYER, 3
2021-07-20 21:18:31 +02:00
SlateportCity_BattleTentBattleRoom_MapScripts::
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
@ 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
compare VAR_RESULT, MALE
2019-12-15 06:55:21 +01:00
goto_if_eq SlateportCity_BattleTentBattleRoom_EventScript_SetPlayerGfxMale
compare VAR_RESULT, FEMALE
2019-12-15 06:55:21 +01:00
goto_if_eq 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::
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::
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
hideobjectat OBJ_EVENT_ID_PLAYER, MAP_FALLARBOR_TOWN_BATTLE_TENT_BATTLE_ROOM
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::
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
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
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
warp MAP_SLATEPORT_CITY_BATTLE_TENT_LOBBY, 255, 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
warp MAP_SLATEPORT_CITY_BATTLE_TENT_CORRIDOR, 255, 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
warp MAP_SLATEPORT_CITY_BATTLE_TENT_LOBBY, 255, 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:
walk_up
walk_up
walk_up
walk_in_place_fastest_right
2017-11-10 02:21:31 +01:00
step_end
2021-07-20 21:18:31 +02:00
SlateportCity_BattleTentBattleRoom_Movement_OpponentEnter:
walk_down
walk_down
walk_down
walk_down
walk_in_place_fastest_left
2017-11-10 02:21:31 +01:00
step_end