BattleFrontier_BattlePyramidFloor_MapScripts:: map_script MAP_SCRIPT_ON_RESUME, BattleFrontier_BattlePyramidFloor_OnResume map_script MAP_SCRIPT_ON_FRAME_TABLE, BattleFrontier_BattlePyramidFloor_OnFrame map_script MAP_SCRIPT_ON_TRANSITION, BattleFrontier_BattlePyramidFloor_OnTransition .byte 0 BattleFrontier_BattlePyramidFloor_OnFrame: map_script_2 VAR_TEMP_D, 1, BattleFrontier_BattlePyramidFloor_EventScript_UpdateLight map_script_2 VAR_TEMP_PLAYING_PYRAMID_MUSIC, 0, BattleFrontier_BattlePyramidFloor_EventScript_PlayPyramidMusic map_script_2 VAR_TEMP_F, 1, BattleFrontier_BattlePyramidFloor_EventScript_ShowMapName .2byte 0 BattleFrontier_BattlePyramidFloor_EventScript_UpdateLight:: lockall @ pyramid_updatelight, cant use macro because it straddles the loop setvar VAR_0x8004, BATTLE_PYRAMID_FUNC_UPDATE_LIGHT setvar VAR_0x8005, 4 setvar VAR_0x8006, PYRAMID_LIGHT_INCR_RADIUS setvar VAR_0x8007, SE_SAVE setvar VAR_RESULT, 0 BattleFrontier_BattlePyramidFloor_EventScript_UpdateLightLoop:: special CallBattlePyramidFunction delay 2 goto_if_ne VAR_RESULT, 2, BattleFrontier_BattlePyramidFloor_EventScript_UpdateLightLoop setvar VAR_TEMP_D, 0 releaseall end BattleFrontier_BattlePyramidFloor_EventScript_ShowMapName:: special ShowMapNamePopup setvar VAR_TEMP_F, 0 end BattleFrontier_BattlePyramidFloor_EventScript_PlayPyramidMusic:: playbgm MUS_B_PYRAMID, FALSE setvar VAR_TEMP_PLAYING_PYRAMID_MUSIC, 1 end BattleFrontier_BattlePyramidFloor_OnResume: pyramid_setfloorpal frontier_getstatus switch VAR_TEMP_CHALLENGE_STATUS case 0, BattleFrontier_BattlePyramidFloor_EventScript_ReadyChallenge case CHALLENGE_STATUS_SAVING, BattleFrontier_BattlePyramid_EventScript_WarpToLobby case CHALLENGE_STATUS_PAUSED, BattleFrontier_BattlePyramidFloor_EventScript_ReadyChallenge frontier_get FRONTIER_DATA_BATTLE_OUTCOME goto_if_eq VAR_RESULT, B_OUTCOME_RAN, BattleFrontier_BattlePyramidFloor_EventScript_ResetParty goto_if_eq VAR_RESULT, B_OUTCOME_PLAYER_TELEPORTED, BattleFrontier_BattlePyramidFloor_EventScript_ResetParty goto_if_eq VAR_RESULT, 0, BattleFrontier_BattlePyramidFloor_EventScript_ResetParty goto_if_eq VAR_RESULT, B_OUTCOME_LOST, BattleFrontier_BattlePyramid_EventScript_WarpToLobbyLost goto_if_eq VAR_RESULT, B_OUTCOME_DREW, BattleFrontier_BattlePyramid_EventScript_WarpToLobbyLost goto_if_eq VAR_RESULT, B_OUTCOME_FORFEITED, BattleFrontier_BattlePyramid_EventScript_WarpToLobbyLost frontier_isbattletype BATTLE_TYPE_TRAINER @ VAR_RESULT seems to be ignored here setvar VAR_TEMP_D, 1 BattleFrontier_BattlePyramidFloor_EventScript_ResetParty:: pyramid_resetparty end BattleFrontier_BattlePyramid_EventScript_WarpToLobbyLost:: frontier_set FRONTIER_DATA_CHALLENGE_STATUS, CHALLENGE_STATUS_LOST pyramid_set PYRAMID_DATA_TRAINER_FLAGS, 255 BattleFrontier_BattlePyramid_EventScript_WarpToLobby:: pyramid_updatelight 0, PYRAMID_LIGHT_SET_RADIUS pyramid_clearhelditems special HealPlayerParty warpsilent MAP_BATTLE_FRONTIER_BATTLE_PYRAMID_LOBBY, 7, 13 waitstate end BattleFrontier_BattlePyramidFloor_EventScript_ReadyChallenge:: pyramid_save CHALLENGE_STATUS_SAVING special SavePlayerParty frontier_set FRONTIER_DATA_CHALLENGE_STATUS, 0 pyramid_settrainers frontier_setpartyorder FRONTIER_PARTY_SIZE setvar VAR_TEMP_F, 1 end BattleFrontier_BattlePyramidFloor_OnTransition: call BattleFrontier_BattlePyramidFloor_EventScript_SetLightRadius setvar VAR_TEMP_F, 1 end BattleFrontier_BattlePyramidFloor_EventScript_SetLightRadius:: pyramid_updatelight 32, PYRAMID_LIGHT_SET_RADIUS return BattlePyramid_WarpToNextFloor:: call BattleFrontier_EventScript_IncrementWinStreak frontier_get FRONTIER_DATA_BATTLE_NUM @ Floor number addvar VAR_RESULT, 1 frontier_set FRONTIER_DATA_BATTLE_NUM, VAR_RESULT goto_if_eq VAR_RESULT, 7, BattlePyramid_WarpToTop pyramid_seedfloor frontier_set FRONTIER_DATA_CHALLENGE_STATUS, 0 setvar VAR_RESULT, 0 warp MAP_BATTLE_FRONTIER_BATTLE_PYRAMID_FLOOR, 1, 1 waitstate end BattlePyramid_WarpToTop:: warp MAP_BATTLE_FRONTIER_BATTLE_PYRAMID_TOP, 17, 17 waitstate end @ TRAINER_PHILLIP is used as a placeholder BattlePyramid_TrainerBattle:: trainerbattle TRAINER_BATTLE_PYRAMID, TRAINER_PHILLIP, LOCALID_NONE, BattleFacility_TrainerBattle_PlaceholderText, BattleFacility_TrainerBattle_PlaceholderText pyramid_showhint waitmessage waitbuttonpress closemessage releaseall end BattlePyramid_FindItemBall:: pyramid_setitem callstd STD_FIND_ITEM goto_if_eq VAR_0x8007, 0, BattlePyramid_FindItemBallEnd pyramid_hideitem BattlePyramid_FindItemBallEnd:: end BattlePyramid_Retire:: goto BattleFrontier_BattlePyramid_EventScript_WarpToLobbyLost .ifdef FRENCH .include "data/maps/BattleFrontier_BattlePyramidFloor/text_fr.inc" .else .ifdef ITALIAN .include "data/maps/BattleFrontier_BattlePyramidFloor/text_it.inc" .else .ifdef SPANISH .include "data/maps/BattleFrontier_BattlePyramidFloor/text_es.inc" .else .include "data/maps/BattleFrontier_BattlePyramidFloor/text.inc" .endif .endif .endif