mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2024-12-26 11:44:17 +01:00
Set up Battle Tent macros
This commit is contained in:
parent
fdae25eab2
commit
467a103bcc
@ -1 +1,163 @@
|
||||
@ To be populated with macros for CallVerdanturfTentFunction, CallFallarborTentFunction, and CallSlateportTentFunction
|
||||
@ TODO: Add explanatory comments
|
||||
|
||||
@ Verdanturf Tent
|
||||
|
||||
@
|
||||
.macro verdanturftent_init
|
||||
setvar VAR_0x8004, VERDANTURF_TENT_FUNC_INIT
|
||||
special CallVerdanturfTentFunction
|
||||
.endm
|
||||
|
||||
@
|
||||
.macro verdanturftent_getprize
|
||||
setvar VAR_0x8004, VERDANTURF_TENT_FUNC_GET_PRIZE
|
||||
special CallVerdanturfTentFunction
|
||||
.endm
|
||||
|
||||
@ Unused.
|
||||
.macro verdanturftent_setprize
|
||||
setvar VAR_0x8004, VERDANTURF_TENT_FUNC_SET_PRIZE
|
||||
special CallVerdanturfTentFunction
|
||||
.endm
|
||||
|
||||
@ Unused.
|
||||
.macro verdanturftent_setopponentgfx
|
||||
setvar VAR_0x8004, VERDANTURF_TENT_FUNC_SET_OPPONENT_GFX
|
||||
special CallVerdanturfTentFunction
|
||||
.endm
|
||||
|
||||
@ Buffers the opponents intro speech to STR_VAR_4. Despite being a Verdanturf Tent function, it serves the same purpose for all 3 tents.
|
||||
.macro battletent_getopponentintro
|
||||
setvar VAR_0x8004, VERDANTURF_TENT_FUNC_GET_OPPONENT_INTRO
|
||||
special CallVerdanturfTentFunction
|
||||
.endm
|
||||
|
||||
@
|
||||
.macro verdanturftent_save challengeStatus:req
|
||||
setvar VAR_0x8004, VERDANTURF_TENT_FUNC_SAVE
|
||||
setvar VAR_0x8005, \challengeStatus
|
||||
special CallVerdanturfTentFunction
|
||||
.endm
|
||||
|
||||
@
|
||||
.macro verdanturftent_setrandomprize
|
||||
setvar VAR_0x8004, VERDANTURF_TENT_FUNC_SET_RANDOM_PRIZE
|
||||
special CallVerdanturfTentFunction
|
||||
.endm
|
||||
|
||||
@
|
||||
.macro verdanturftent_giveprize
|
||||
setvar VAR_0x8004, VERDANTURF_TENT_FUNC_GIVE_PRIZE
|
||||
special CallVerdanturfTentFunction
|
||||
.endm
|
||||
|
||||
|
||||
@ Fallarbor Tent
|
||||
|
||||
@
|
||||
.macro fallarbortent_init
|
||||
setvar VAR_0x8004, FALLARBOR_TENT_FUNC_INIT
|
||||
special CallFallarborTentFunction
|
||||
.endm
|
||||
|
||||
@
|
||||
.macro fallarbortent_getprize
|
||||
setvar VAR_0x8004, FALLARBOR_TENT_FUNC_GET_PRIZE
|
||||
special CallFallarborTentFunction
|
||||
.endm
|
||||
|
||||
@ Unused.
|
||||
.macro fallarbortent_setprize
|
||||
setvar VAR_0x8004, FALLARBOR_TENT_FUNC_SET_PRIZE
|
||||
special CallFallarborTentFunction
|
||||
.endm
|
||||
|
||||
@
|
||||
.macro fallarbortent_save challengeStatus:req
|
||||
setvar VAR_0x8004, FALLARBOR_TENT_FUNC_SAVE
|
||||
setvar VAR_0x8005, \challengeStatus
|
||||
special CallFallarborTentFunction
|
||||
.endm
|
||||
|
||||
@
|
||||
.macro fallarbortent_setrandomprize
|
||||
setvar VAR_0x8004, FALLARBOR_TENT_FUNC_SET_RANDOM_PRIZE
|
||||
special CallFallarborTentFunction
|
||||
.endm
|
||||
|
||||
@
|
||||
.macro fallarbortent_giveprize
|
||||
setvar VAR_0x8004, FALLARBOR_TENT_FUNC_GIVE_PRIZE
|
||||
special CallFallarborTentFunction
|
||||
.endm
|
||||
|
||||
@
|
||||
.macro fallarbortent_getopponentname
|
||||
setvar VAR_0x8004, FALLARBOR_TENT_FUNC_GET_OPPONENT_NAME
|
||||
special CallFallarborTentFunction
|
||||
.endm
|
||||
|
||||
|
||||
@ Slateport Tent
|
||||
|
||||
@
|
||||
.macro slateporttent_init
|
||||
setvar VAR_0x8004, SLATEPORT_TENT_FUNC_INIT
|
||||
special CallSlateportTentFunction
|
||||
.endm
|
||||
|
||||
@
|
||||
.macro slateporttent_getprize
|
||||
setvar VAR_0x8004, SLATEPORT_TENT_FUNC_GET_PRIZE
|
||||
special CallSlateportTentFunction
|
||||
.endm
|
||||
|
||||
@ Unused.
|
||||
.macro slateporttent_setprize
|
||||
setvar VAR_0x8004, SLATEPORT_TENT_FUNC_SET_PRIZE
|
||||
special CallSlateportTentFunction
|
||||
.endm
|
||||
|
||||
@
|
||||
.macro slateporttent_save challengeStatus:req
|
||||
setvar VAR_0x8004, SLATEPORT_TENT_FUNC_SAVE
|
||||
setvar VAR_0x8005, \challengeStatus
|
||||
special CallSlateportTentFunction
|
||||
.endm
|
||||
|
||||
@
|
||||
.macro slateporttent_setrandomprize
|
||||
setvar VAR_0x8004, SLATEPORT_TENT_FUNC_SET_RANDOM_PRIZE
|
||||
special CallSlateportTentFunction
|
||||
.endm
|
||||
|
||||
@
|
||||
.macro slateporttent_giveprize
|
||||
setvar VAR_0x8004, SLATEPORT_TENT_FUNC_GIVE_PRIZE
|
||||
special CallSlateportTentFunction
|
||||
.endm
|
||||
|
||||
@
|
||||
.macro slateporttent_rentmons
|
||||
setvar VAR_0x8004, SLATEPORT_TENT_FUNC_SELECT_RENT_MONS
|
||||
special CallSlateportTentFunction
|
||||
.endm
|
||||
|
||||
@
|
||||
.macro slateporttent_swapmons
|
||||
setvar VAR_0x8004, SLATEPORT_TENT_FUNC_SWAP_RENT_MONS
|
||||
special CallSlateportTentFunction
|
||||
.endm
|
||||
|
||||
@
|
||||
.macro slateporttent_generateopponentmons
|
||||
setvar VAR_0x8004, SLATEPORT_TENT_FUNC_GENERATE_OPPONENT_MONS
|
||||
special CallSlateportTentFunction
|
||||
.endm
|
||||
|
||||
@
|
||||
.macro slateporttent_generaterentalmons
|
||||
setvar VAR_0x8004, SLATEPORT_TENT_FUNC_GENERATE_RENTAL_MONS
|
||||
special CallSlateportTentFunction
|
||||
.endm
|
||||
|
||||
|
@ -9,6 +9,7 @@
|
||||
#include "constants/battle_pike.h"
|
||||
#include "constants/battle_pyramid.h"
|
||||
#include "constants/battle_setup.h"
|
||||
#include "constants/battle_tent.h"
|
||||
#include "constants/battle_tower.h"
|
||||
#include "constants/berry.h"
|
||||
#include "constants/cable_club.h"
|
||||
|
@ -49,8 +49,7 @@ FallarborTown_BattleTentBattleRoom_EventScript_20090F:: @ 820090F
|
||||
waitse
|
||||
waitmovement 0
|
||||
msgbox BattleFrontier_BattleArenaBattleRoom_Text_SetKOTourneyBegin, MSGBOX_DEFAULT
|
||||
setvar VAR_0x8004, 4
|
||||
special CallVerdanturfTentFunction
|
||||
battletent_getopponentintro
|
||||
msgbox gStringVar4, MSGBOX_DEFAULT
|
||||
waitmessage
|
||||
call BattleFrontier_BattleArenaBattleRoom_EventScript_DoArenaBattle
|
||||
@ -60,8 +59,7 @@ FallarborTown_BattleTentBattleRoom_EventScript_20090F:: @ 820090F
|
||||
playse SE_W173
|
||||
waitse
|
||||
waitmovement 0
|
||||
setvar VAR_0x8004, 6
|
||||
special CallFallarborTentFunction
|
||||
fallarbortent_getopponentname
|
||||
msgbox BattleFrontier_BattleArenaBattleRoom_Text_WinnerIsOpponent, MSGBOX_DEFAULT
|
||||
|
||||
FallarborTown_BattleTentBattleRoom_EventScript_20097E:: @ 820097E
|
||||
@ -160,9 +158,7 @@ FallarborTown_BattleTentBattleRoom_EventScript_200B4A:: @ 8200B4A
|
||||
FallarborTown_BattleTentBattleRoom_EventScript_200B51:: @ 8200B51
|
||||
message BattleFrontier_BattleArenaBattleRoom_Text_SavingPleaseWait
|
||||
waitmessage
|
||||
setvar VAR_0x8004, 3
|
||||
setvar VAR_0x8005, 2
|
||||
special CallFallarborTentFunction
|
||||
fallarbortent_save CHALLENGE_STATUS_PAUSED
|
||||
playse SE_SAVE
|
||||
waitse
|
||||
fadescreen 1
|
||||
|
@ -39,19 +39,15 @@ FallarborTown_BattleTentLobby_EventScript_1FFEED:: @ 81FFEED
|
||||
msgbox FallarborTown_BattleTentLobby_Text_2C4EC3, MSGBOX_DEFAULT
|
||||
message FallarborTown_BattleTentLobby_Text_2C4EFF
|
||||
waitmessage
|
||||
setvar VAR_0x8004, 4
|
||||
special CallFallarborTentFunction
|
||||
fallarbortent_setrandomprize
|
||||
frontier_set FRONTIER_DATA_LVL_MODE, FRONTIER_LVL_50
|
||||
setvar VAR_0x8004, 3
|
||||
setvar VAR_0x8005, 0
|
||||
special CallFallarborTentFunction
|
||||
fallarbortent_save 0
|
||||
playse SE_SAVE
|
||||
waitse
|
||||
|
||||
FallarborTown_BattleTentLobby_EventScript_1FFF27:: @ 81FFF27
|
||||
msgbox FallarborTown_BattleTentLobby_Text_2C4F22, MSGBOX_DEFAULT
|
||||
setvar VAR_0x8004, 5
|
||||
special CallFallarborTentFunction
|
||||
fallarbortent_giveprize
|
||||
switch VAR_RESULT
|
||||
case 0, FallarborTown_BattleTentLobby_EventScript_1FFF73
|
||||
frontier_set FRONTIER_DATA_CHALLENGE_STATUS, 0
|
||||
@ -84,9 +80,7 @@ FallarborTown_BattleTentLobby_EventScript_1FFF93:: @ 81FFF93
|
||||
message FallarborTown_BattleTentLobby_Text_2C4FD7
|
||||
waitmessage
|
||||
frontier_set FRONTIER_DATA_LVL_MODE, FRONTIER_LVL_50
|
||||
setvar VAR_0x8004, 3
|
||||
setvar VAR_0x8005, 0
|
||||
special CallFallarborTentFunction
|
||||
fallarbortent_save 0
|
||||
playse SE_SAVE
|
||||
waitse
|
||||
msgbox FallarborTown_BattleTentLobby_Text_2C501F, MSGBOX_DEFAULT
|
||||
@ -99,9 +93,7 @@ FallarborTown_BattleTentLobby_EventScript_1FFFCD:: @ 81FFFCD
|
||||
lockall
|
||||
message FallarborTown_BattleTentLobby_Text_2C504C
|
||||
waitmessage
|
||||
setvar VAR_0x8004, 3
|
||||
setvar VAR_0x8005, 1
|
||||
special CallFallarborTentFunction
|
||||
fallarbortent_save CHALLENGE_STATUS_SAVING
|
||||
playse SE_SAVE
|
||||
waitse
|
||||
frontier_set FRONTIER_DATA_PAUSED, FALSE
|
||||
@ -111,8 +103,7 @@ FallarborTown_BattleTentLobby_EventScript_1FFFCD:: @ 81FFFCD
|
||||
FallarborTown_BattleTentLobby_EventScript_200001:: @ 8200001
|
||||
lock
|
||||
faceplayer
|
||||
setvar VAR_0x8004, 1
|
||||
special CallFallarborTentFunction
|
||||
fallarbortent_getprize
|
||||
compare VAR_RESULT, 0
|
||||
goto_if_ne FallarborTown_BattleTentLobby_EventScript_1FFF84
|
||||
special SavePlayerParty
|
||||
@ -153,8 +144,7 @@ FallarborTown_BattleTentLobby_EventScript_20005D:: @ 820005D
|
||||
FallarborTown_BattleTentLobby_EventScript_2000E2:: @ 82000E2
|
||||
setvar VAR_TEMP_0, 0
|
||||
frontier_set FRONTIER_DATA_SELECTED_MON_ORDER
|
||||
setvar VAR_0x8004, 0
|
||||
special CallFallarborTentFunction
|
||||
fallarbortent_init
|
||||
frontier_set FRONTIER_DATA_CHALLENGE_STATUS, CHALLENGE_STATUS_SAVING
|
||||
frontier_set FRONTIER_DATA_PAUSED, FALSE
|
||||
special LoadPlayerParty
|
||||
|
@ -47,8 +47,7 @@ SlateportCity_BattleTentBattleRoom_EventScript_2099BE:: @ 82099BE
|
||||
addobject 2
|
||||
applymovement 2, SlateportCity_BattleTentBattleRoom_Movement_209A9E
|
||||
waitmovement 0
|
||||
setvar VAR_0x8004, 4
|
||||
special CallVerdanturfTentFunction
|
||||
battletent_getopponentintro
|
||||
lockall
|
||||
msgbox gStringVar4, MSGBOX_DEFAULT
|
||||
waitmessage
|
||||
|
@ -31,14 +31,11 @@ SlateportCity_BattleTentCorridor_EventScript_208E65:: @ 8208E65
|
||||
waitmovement 0
|
||||
compare VAR_0x8006, 2
|
||||
goto_if_eq SlateportCity_BattleTentCorridor_EventScript_209044
|
||||
setvar VAR_0x8004, 9
|
||||
special CallSlateportTentFunction
|
||||
setvar VAR_0x8004, 8
|
||||
special CallSlateportTentFunction
|
||||
slateporttent_generaterentalmons
|
||||
slateporttent_generateopponentmons
|
||||
msgbox SlateportCity_BattleTentCorridor_Text_25A1C8, MSGBOX_DEFAULT
|
||||
fadescreen 1
|
||||
setvar VAR_0x8004, 6
|
||||
special CallSlateportTentFunction
|
||||
slateporttent_rentmons
|
||||
waitstate
|
||||
SlateportCity_BattleTentCorridor_EventScript_208EB4:: @ 8208EB4
|
||||
msgbox SlateportCity_BattleTentCorridor_Text_25AB96, MSGBOX_DEFAULT
|
||||
@ -92,8 +89,7 @@ SlateportCity_BattleTentCorridor_EventScript_208F89:: @ 8208F89
|
||||
case MULTI_B_PRESSED, SlateportCity_BattleTentCorridor_EventScript_208F0D
|
||||
|
||||
SlateportCity_BattleTentCorridor_EventScript_208FBB:: @ 8208FBB
|
||||
setvar VAR_0x8004, 8
|
||||
special CallSlateportTentFunction
|
||||
slateporttent_generateopponentmons
|
||||
msgbox SlateportCity_BattleTentCorridor_Text_25AB2E, MSGBOX_YESNO
|
||||
switch VAR_RESULT
|
||||
case NO, SlateportCity_BattleTentCorridor_EventScript_208EB4
|
||||
@ -102,8 +98,7 @@ SlateportCity_BattleTentCorridor_EventScript_208FBB:: @ 8208FBB
|
||||
|
||||
SlateportCity_BattleTentCorridor_EventScript_208FF1:: @ 8208FF1
|
||||
fadescreen 1
|
||||
setvar VAR_0x8004, 7
|
||||
special CallSlateportTentFunction
|
||||
slateporttent_swapmons
|
||||
waitstate
|
||||
compare VAR_RESULT, 1
|
||||
goto_if_eq SlateportCity_BattleTentCorridor_EventScript_208EB4
|
||||
@ -123,9 +118,7 @@ SlateportCity_BattleTentCorridor_EventScript_20901B:: @ 820901B
|
||||
SlateportCity_BattleTentCorridor_EventScript_209022:: @ 8209022
|
||||
message SlateportCity_BattleTentCorridor_Text_25ABAE
|
||||
waitmessage
|
||||
setvar VAR_0x8004, 3
|
||||
setvar VAR_0x8005, 2
|
||||
special CallSlateportTentFunction
|
||||
slateporttent_save CHALLENGE_STATUS_PAUSED
|
||||
playse SE_SAVE
|
||||
waitse
|
||||
fadescreen 1
|
||||
|
@ -38,18 +38,14 @@ SlateportCity_BattleTentLobby_EventScript_2087B7:: @ 82087B7
|
||||
lockall
|
||||
message SlateportCity_BattleTentLobby_Text_2C5C6F
|
||||
waitmessage
|
||||
setvar VAR_0x8004, 4
|
||||
special CallSlateportTentFunction
|
||||
slateporttent_setrandomprize
|
||||
frontier_set FRONTIER_DATA_LVL_MODE, FRONTIER_LVL_50
|
||||
setvar VAR_0x8004, 3
|
||||
setvar VAR_0x8005, 0
|
||||
special CallSlateportTentFunction
|
||||
slateporttent_save 0
|
||||
playse SE_SAVE
|
||||
waitse
|
||||
SlateportCity_BattleTentLobby_EventScript_2087E9:: @ 82087E9
|
||||
msgbox SlateportCity_BattleTentLobby_Text_2C5D14, MSGBOX_DEFAULT
|
||||
setvar VAR_0x8004, 5
|
||||
special CallSlateportTentFunction
|
||||
slateporttent_giveprize
|
||||
switch VAR_RESULT
|
||||
case 0, SlateportCity_BattleTentLobby_EventScript_20882A
|
||||
frontier_set FRONTIER_DATA_CHALLENGE_STATUS, 0
|
||||
@ -68,9 +64,7 @@ SlateportCity_BattleTentLobby_EventScript_208837:: @ 8208837
|
||||
message SlateportCity_BattleTentLobby_Text_2C5BA2
|
||||
waitmessage
|
||||
frontier_set FRONTIER_DATA_LVL_MODE, FRONTIER_LVL_50
|
||||
setvar VAR_0x8004, 3
|
||||
setvar VAR_0x8005, 0
|
||||
special CallSlateportTentFunction
|
||||
slateporttent_save 0
|
||||
playse SE_SAVE
|
||||
waitse
|
||||
|
||||
@ -85,9 +79,7 @@ SlateportCity_BattleTentLobby_EventScript_208871:: @ 8208871
|
||||
lockall
|
||||
message SlateportCity_BattleTentLobby_Text_2C5DA7
|
||||
waitmessage
|
||||
setvar VAR_0x8004, 3
|
||||
setvar VAR_0x8005, 1
|
||||
special CallSlateportTentFunction
|
||||
slateporttent_save CHALLENGE_STATUS_SAVING
|
||||
playse SE_SAVE
|
||||
waitse
|
||||
frontier_set FRONTIER_DATA_PAUSED, FALSE
|
||||
@ -98,13 +90,11 @@ SlateportCity_BattleTentLobby_EventScript_208871:: @ 8208871
|
||||
SlateportCity_BattleTentLobby_EventScript_2088AA:: @ 82088AA
|
||||
lock
|
||||
faceplayer
|
||||
setvar VAR_0x8004, 1
|
||||
special CallSlateportTentFunction
|
||||
slateporttent_getprize
|
||||
compare VAR_RESULT, 0
|
||||
goto_if_ne SlateportCity_BattleTentLobby_EventScript_2087E9
|
||||
special SavePlayerParty
|
||||
msgbox SlateportCity_BattleTentLobby_Text_2C5810, MSGBOX_DEFAULT
|
||||
|
||||
SlateportCity_BattleTentLobby_EventScript_2088CA:: @ 82088CA
|
||||
message SlateportCity_BattleTentLobby_Text_2C586A
|
||||
waitmessage
|
||||
@ -128,8 +118,7 @@ SlateportCity_BattleTentLobby_EventScript_208906:: @ 8208906
|
||||
SlateportCity_BattleTentLobby_EventScript_208950:: @ 8208950
|
||||
setvar VAR_TEMP_0, 0
|
||||
frontier_set FRONTIER_DATA_SELECTED_MON_ORDER
|
||||
setvar VAR_0x8004, 0
|
||||
special CallSlateportTentFunction
|
||||
slateporttent_init
|
||||
frontier_set FRONTIER_DATA_CHALLENGE_STATUS, CHALLENGE_STATUS_SAVING
|
||||
frontier_set FRONTIER_DATA_PAUSED, FALSE
|
||||
closemessage
|
||||
|
@ -43,8 +43,7 @@ VerdanturfTown_BattleTentBattleRoom_EventScript_20236F:: @ 820236F
|
||||
addobject 2
|
||||
applymovement 2, VerdanturfTown_BattleTentBattleRoom_Movement_20257B
|
||||
waitmovement 0
|
||||
setvar VAR_0x8004, 4
|
||||
special CallVerdanturfTentFunction
|
||||
battletent_getopponentintro
|
||||
msgbox gStringVar4, MSGBOX_DEFAULT
|
||||
waitmessage
|
||||
call VerdanturfTown_BattleTentBattleRoom_EventScript_24FDF7
|
||||
@ -121,9 +120,7 @@ VerdanturfTown_BattleTentBattleRoom_EventScript_202501:: @ 8202501
|
||||
VerdanturfTown_BattleTentBattleRoom_EventScript_20251F:: @ 820251F
|
||||
message VerdanturfTown_BattleTentBattleRoom_Text_25007E
|
||||
waitmessage
|
||||
setvar VAR_0x8004, 5
|
||||
setvar VAR_0x8005, 2
|
||||
special CallVerdanturfTentFunction
|
||||
verdanturftent_save CHALLENGE_STATUS_PAUSED
|
||||
playse SE_SAVE
|
||||
waitse
|
||||
fadescreen 1
|
||||
|
@ -39,19 +39,15 @@ VerdanturfTown_BattleTentLobby_EventScript_201757:: @ 8201757
|
||||
msgbox VerdanturfTown_BattleTentLobby_Text_2C5731, MSGBOX_DEFAULT
|
||||
message VerdanturfTown_BattleTentLobby_Text_2C5791
|
||||
waitmessage
|
||||
setvar VAR_0x8004, 6
|
||||
special CallVerdanturfTentFunction
|
||||
verdanturftent_setrandomprize
|
||||
frontier_set FRONTIER_DATA_LVL_MODE, FRONTIER_LVL_50
|
||||
setvar VAR_0x8004, 5
|
||||
setvar VAR_0x8005, 0
|
||||
special CallVerdanturfTentFunction
|
||||
verdanturftent_save 0
|
||||
playse SE_SAVE
|
||||
waitse
|
||||
|
||||
VerdanturfTown_BattleTentLobby_EventScript_201791:: @ 8201791
|
||||
msgbox VerdanturfTown_BattleTentLobby_Text_2C57CD, MSGBOX_DEFAULT
|
||||
setvar VAR_0x8004, 7
|
||||
special CallVerdanturfTentFunction
|
||||
verdanturftent_giveprize
|
||||
switch VAR_RESULT
|
||||
case 0, VerdanturfTown_BattleTentLobby_EventScript_2017DD
|
||||
frontier_set FRONTIER_DATA_CHALLENGE_STATUS, 0
|
||||
@ -84,9 +80,7 @@ VerdanturfTown_BattleTentLobby_EventScript_2017FD:: @ 82017FD
|
||||
message VerdanturfTown_BattleTentLobby_Text_2C56B8
|
||||
waitmessage
|
||||
frontier_set FRONTIER_DATA_LVL_MODE, FRONTIER_LVL_50
|
||||
setvar VAR_0x8004, 5
|
||||
setvar VAR_0x8005, 0
|
||||
special CallVerdanturfTentFunction
|
||||
verdanturftent_save 0
|
||||
playse SE_SAVE
|
||||
waitse
|
||||
msgbox VerdanturfTown_BattleTentLobby_Text_2C539A, MSGBOX_DEFAULT
|
||||
@ -100,9 +94,7 @@ VerdanturfTown_BattleTentLobby_EventScript_201837:: @ 8201837
|
||||
msgbox VerdanturfTown_BattleTentLobby_Text_24E5D8, MSGBOX_DEFAULT
|
||||
message VerdanturfTown_BattleTentLobby_Text_24E5F6
|
||||
waitmessage
|
||||
setvar VAR_0x8004, 5
|
||||
setvar VAR_0x8005, 1
|
||||
special CallVerdanturfTentFunction
|
||||
verdanturftent_save CHALLENGE_STATUS_SAVING
|
||||
playse SE_SAVE
|
||||
waitse
|
||||
frontier_set FRONTIER_DATA_PAUSED, FALSE
|
||||
@ -112,8 +104,7 @@ VerdanturfTown_BattleTentLobby_EventScript_201837:: @ 8201837
|
||||
VerdanturfTown_BattleTentLobby_EventScript_201873:: @ 8201873
|
||||
lock
|
||||
faceplayer
|
||||
setvar VAR_0x8004, 1
|
||||
special CallVerdanturfTentFunction
|
||||
verdanturftent_getprize
|
||||
compare VAR_RESULT, 0
|
||||
goto_if_ne VerdanturfTown_BattleTentLobby_EventScript_2017EE
|
||||
special SavePlayerParty
|
||||
@ -154,8 +145,7 @@ VerdanturfTown_BattleTentLobby_EventScript_2018CF:: @ 82018CF
|
||||
VerdanturfTown_BattleTentLobby_EventScript_201954:: @ 8201954
|
||||
setvar VAR_TEMP_0, 0
|
||||
frontier_set FRONTIER_DATA_SELECTED_MON_ORDER
|
||||
setvar VAR_0x8004, 0
|
||||
special CallVerdanturfTentFunction
|
||||
verdanturftent_init
|
||||
frontier_set FRONTIER_DATA_CHALLENGE_STATUS, CHALLENGE_STATUS_SAVING
|
||||
frontier_set FRONTIER_DATA_PAUSED, FALSE
|
||||
special LoadPlayerParty
|
||||
|
32
include/constants/battle_tent.h
Normal file
32
include/constants/battle_tent.h
Normal file
@ -0,0 +1,32 @@
|
||||
#ifndef GUARD_CONSTANTS_BATTLE_TENT_H
|
||||
#define GUARD_CONSTANTS_BATTLE_TENT_H
|
||||
|
||||
#define VERDANTURF_TENT_FUNC_INIT 0
|
||||
#define VERDANTURF_TENT_FUNC_GET_PRIZE 1
|
||||
#define VERDANTURF_TENT_FUNC_SET_PRIZE 2
|
||||
#define VERDANTURF_TENT_FUNC_SET_OPPONENT_GFX 3
|
||||
#define VERDANTURF_TENT_FUNC_GET_OPPONENT_INTRO 4
|
||||
#define VERDANTURF_TENT_FUNC_SAVE 5
|
||||
#define VERDANTURF_TENT_FUNC_SET_RANDOM_PRIZE 6
|
||||
#define VERDANTURF_TENT_FUNC_GIVE_PRIZE 7
|
||||
|
||||
#define FALLARBOR_TENT_FUNC_INIT 0
|
||||
#define FALLARBOR_TENT_FUNC_GET_PRIZE 1
|
||||
#define FALLARBOR_TENT_FUNC_SET_PRIZE 2
|
||||
#define FALLARBOR_TENT_FUNC_SAVE 3
|
||||
#define FALLARBOR_TENT_FUNC_SET_RANDOM_PRIZE 4
|
||||
#define FALLARBOR_TENT_FUNC_GIVE_PRIZE 5
|
||||
#define FALLARBOR_TENT_FUNC_GET_OPPONENT_NAME 6
|
||||
|
||||
#define SLATEPORT_TENT_FUNC_INIT 0
|
||||
#define SLATEPORT_TENT_FUNC_GET_PRIZE 1
|
||||
#define SLATEPORT_TENT_FUNC_SET_PRIZE 2
|
||||
#define SLATEPORT_TENT_FUNC_SAVE 3
|
||||
#define SLATEPORT_TENT_FUNC_SET_RANDOM_PRIZE 4
|
||||
#define SLATEPORT_TENT_FUNC_GIVE_PRIZE 5
|
||||
#define SLATEPORT_TENT_FUNC_SELECT_RENT_MONS 6
|
||||
#define SLATEPORT_TENT_FUNC_SWAP_RENT_MONS 7
|
||||
#define SLATEPORT_TENT_FUNC_GENERATE_OPPONENT_MONS 8
|
||||
#define SLATEPORT_TENT_FUNC_GENERATE_RENTAL_MONS 9
|
||||
|
||||
#endif // GUARD_CONSTANTS_BATTLE_TENT_H
|
@ -11,6 +11,7 @@
|
||||
#include "battle_factory_screen.h"
|
||||
#include "frontier_util.h"
|
||||
#include "string_util.h"
|
||||
#include "constants/battle_tent.h"
|
||||
#include "constants/items.h"
|
||||
#include "constants/layouts.h"
|
||||
#include "constants/region_map_sections.h"
|
||||
@ -41,8 +42,18 @@ static void SetRandomSlateportTentPrize(void);
|
||||
static void GiveSlateportTentPrize(void);
|
||||
static void SelectInitialRentalMons(void);
|
||||
static void SwapRentalMons(void);
|
||||
static void sub_81BA040(void);
|
||||
static void sub_81B9EC0(void);
|
||||
static void GenerateOpponentMons(void);
|
||||
static void GenerateInitialRentalMons(void);
|
||||
|
||||
/*
|
||||
* Battle Tents are mini versions of particular Battle Frontier facilities
|
||||
* As such they each share some scripts and functions with their counterpart
|
||||
*
|
||||
* Verdanturf Battle Tent: Battle Palace
|
||||
* Fallarbor Battle Tent: Battle Arena
|
||||
* Slateport Battle Tent: Battle Factory
|
||||
*
|
||||
*/
|
||||
|
||||
// IWRAM bss
|
||||
static u16 sRandMonSetId;
|
||||
@ -50,43 +61,43 @@ static u16 sRandMonSetId;
|
||||
// const rom data
|
||||
void static (*const sVerdanturfTentFuncs[])(void) =
|
||||
{
|
||||
InitVerdanturfTentChallenge,
|
||||
GetVerdanturfTentPrize,
|
||||
SetVerdanturfTentPrize,
|
||||
SetVerdanturfTentTrainerGfx,
|
||||
BufferVerdanturfTentTrainerIntro,
|
||||
SaveVerdanturfTentChallenge,
|
||||
SetRandomVerdanturfTentPrize,
|
||||
GiveVerdanturfTentPrize
|
||||
[VERDANTURF_TENT_FUNC_INIT] = InitVerdanturfTentChallenge,
|
||||
[VERDANTURF_TENT_FUNC_GET_PRIZE] = GetVerdanturfTentPrize,
|
||||
[VERDANTURF_TENT_FUNC_SET_PRIZE] = SetVerdanturfTentPrize,
|
||||
[VERDANTURF_TENT_FUNC_SET_OPPONENT_GFX] = SetVerdanturfTentTrainerGfx,
|
||||
[VERDANTURF_TENT_FUNC_GET_OPPONENT_INTRO] = BufferVerdanturfTentTrainerIntro,
|
||||
[VERDANTURF_TENT_FUNC_SAVE] = SaveVerdanturfTentChallenge,
|
||||
[VERDANTURF_TENT_FUNC_SET_RANDOM_PRIZE] = SetRandomVerdanturfTentPrize,
|
||||
[VERDANTURF_TENT_FUNC_GIVE_PRIZE] = GiveVerdanturfTentPrize
|
||||
};
|
||||
|
||||
static const u16 sVerdanturfTentRewards[] = {ITEM_NEST_BALL};
|
||||
|
||||
void static (*const sFallarborTentFuncs[])(void) =
|
||||
{
|
||||
InitFallarborTentChallenge,
|
||||
GetFallarborTentPrize,
|
||||
SetFallarborTentPrize,
|
||||
SaveFallarborTentChallenge,
|
||||
SetRandomFallarborTentPrize,
|
||||
GiveFallarborTentPrize,
|
||||
BufferFallarborTentTrainerName
|
||||
[FALLARBOR_TENT_FUNC_INIT] = InitFallarborTentChallenge,
|
||||
[FALLARBOR_TENT_FUNC_GET_PRIZE] = GetFallarborTentPrize,
|
||||
[FALLARBOR_TENT_FUNC_SET_PRIZE] = SetFallarborTentPrize,
|
||||
[FALLARBOR_TENT_FUNC_SAVE] = SaveFallarborTentChallenge,
|
||||
[FALLARBOR_TENT_FUNC_SET_RANDOM_PRIZE] = SetRandomFallarborTentPrize,
|
||||
[FALLARBOR_TENT_FUNC_GIVE_PRIZE] = GiveFallarborTentPrize,
|
||||
[FALLARBOR_TENT_FUNC_GET_OPPONENT_NAME] = BufferFallarborTentTrainerName
|
||||
};
|
||||
|
||||
static const u16 sFallarborTentRewards[] = {ITEM_HYPER_POTION};
|
||||
|
||||
void static (*const sSlateportTentFuncs[])(void) =
|
||||
{
|
||||
InitSlateportTentChallenge,
|
||||
GetSlateportTentPrize,
|
||||
SetSlateportTentPrize,
|
||||
SaveSlateportTentChallenge,
|
||||
SetRandomSlateportTentPrize,
|
||||
GiveSlateportTentPrize,
|
||||
SelectInitialRentalMons,
|
||||
SwapRentalMons,
|
||||
sub_81BA040,
|
||||
sub_81B9EC0
|
||||
[SLATEPORT_TENT_FUNC_INIT] = InitSlateportTentChallenge,
|
||||
[SLATEPORT_TENT_FUNC_GET_PRIZE] = GetSlateportTentPrize,
|
||||
[SLATEPORT_TENT_FUNC_SET_PRIZE] = SetSlateportTentPrize,
|
||||
[SLATEPORT_TENT_FUNC_SAVE] = SaveSlateportTentChallenge,
|
||||
[SLATEPORT_TENT_FUNC_SET_RANDOM_PRIZE] = SetRandomSlateportTentPrize,
|
||||
[SLATEPORT_TENT_FUNC_GIVE_PRIZE] = GiveSlateportTentPrize,
|
||||
[SLATEPORT_TENT_FUNC_SELECT_RENT_MONS] = SelectInitialRentalMons,
|
||||
[SLATEPORT_TENT_FUNC_SWAP_RENT_MONS] = SwapRentalMons,
|
||||
[SLATEPORT_TENT_FUNC_GENERATE_OPPONENT_MONS] = GenerateOpponentMons,
|
||||
[SLATEPORT_TENT_FUNC_GENERATE_RENTAL_MONS] = GenerateInitialRentalMons
|
||||
};
|
||||
|
||||
static const u16 sSlateportTentRewards[] = {ITEM_FULL_HEAL};
|
||||
@ -276,7 +287,7 @@ bool8 InSlateportBattleTent(void)
|
||||
&& (gMapHeader.mapLayoutId == LAYOUT_BATTLE_TENT_CORRIDOR || gMapHeader.mapLayoutId == LAYOUT_BATTLE_TENT_BATTLE_ROOM);
|
||||
}
|
||||
|
||||
static void sub_81B9EC0(void)
|
||||
static void GenerateInitialRentalMons(void)
|
||||
{
|
||||
s32 i, j;
|
||||
u8 firstMonId;
|
||||
@ -338,13 +349,13 @@ static void sub_81B9EC0(void)
|
||||
}
|
||||
}
|
||||
|
||||
static void sub_81BA040(void)
|
||||
static void GenerateOpponentMons(void)
|
||||
{
|
||||
u16 trainerId;
|
||||
s32 i, j, k;
|
||||
register const u16 *monSets asm("r9"); // Fix me. Compiler insists on moving that variable into stack.
|
||||
u16 species[3];
|
||||
u16 heldItems[3];
|
||||
u16 species[FRONTIER_PARTY_SIZE];
|
||||
u16 heldItems[FRONTIER_PARTY_SIZE];
|
||||
s32 setsCount = 0;
|
||||
|
||||
gFacilityTrainers = gSlateportBattleTentTrainers;
|
||||
@ -375,7 +386,7 @@ static void sub_81BA040(void)
|
||||
|
||||
monSets = gFacilityTrainers[gTrainerBattleOpponent_A].monSets;
|
||||
i = 0;
|
||||
while (i != 3)
|
||||
while (i != FRONTIER_PARTY_SIZE)
|
||||
{
|
||||
sRandMonSetId = monSets[Random() % setsCount];
|
||||
for (j = 0; j < 6; j++)
|
||||
|
Loading…
Reference in New Issue
Block a user