pokeemerald/asm/macros/battle_frontier/apprentice.inc

155 lines
5.1 KiB
PHP
Raw Normal View History

2019-12-02 21:26:56 +01:00
@ TRUE if the player has talked to the Apprentice and answered their level mode question
.macro apprentice_gavelvlmode
setvar VAR_0x8004, APPRENTICE_FUNC_GAVE_LVLMODE
special CallApprenticeFunction
.endm
2019-12-02 21:26:56 +01:00
@ Set the level mode the Apprentice should battle in
.macro apprentice_setlvlmode lvlmode:req
setvar VAR_0x8004, APPRENTICE_FUNC_SET_LVLMODE
setorcopyvar VAR_0x8005, \lvlmode
2019-12-02 21:26:56 +01:00
addvar VAR_0x8005, 1 @ Apprentice lvl mode is +1 from regular lvl mode value
special CallApprenticeFunction
.endm
2019-12-02 21:26:56 +01:00
@ Question was answered, increment the number of questions answered
.macro apprentice_answeredquestion
setvar VAR_0x8004, APPRENTICE_FUNC_ANSWERED_QUESTION
special CallApprenticeFunction
.endm
2019-12-02 21:26:56 +01:00
@ Show the response selection box to answer the Apprentice question. Menus are defined as APPRENTICE_ASK_*
.macro apprentice_menu which:req
setvar VAR_0x8004, APPRENTICE_FUNC_MENU
setvar VAR_0x8005, \which
special CallApprenticeFunction
waitstate
.endm
2019-12-02 21:26:56 +01:00
@ Shuffle and set the Apprentice party mons to pick between from their list of possible party species
.macro apprentice_shufflespecies
setvar VAR_0x8004, APPRENTICE_FUNC_SHUFFLE_SPECIES
special CallApprenticeFunction
.endm
2019-12-02 21:26:56 +01:00
@ Randomize the question data (e.g. moves to pick between) and shuffle the order to ask them in
.macro apprentice_randomizequestions
setvar VAR_0x8004, APPRENTICE_FUNC_RANDOMIZE_QUESTIONS
special CallApprenticeFunction
.endm
2019-12-02 21:26:56 +01:00
@ Print the APPRENTICE_MSG_* text for the current Apprentice
.macro apprentice_msg waitbuttonpress:req, which:req
setvar VAR_0x8004, APPRENTICE_FUNC_PRINT_MSG
setvar VAR_0x8005, \waitbuttonpress
setvar VAR_0x8006, \which
special CallApprenticeFunction
waitstate
.endm
2019-12-02 21:26:56 +01:00
@ Clear the data for the current Player Apprentice
.macro apprentice_reset
setvar VAR_0x8004, APPRENTICE_FUNC_RESET
special CallApprenticeFunction
.endm
2019-12-02 21:26:56 +01:00
@ Always returns TRUE. No side effect. May have been for debug or dummied for some other reason
.macro apprentice_shouldcheckgone
setvar VAR_0x8004, APPRENTICE_FUNC_CHECK_GONE
special CallApprenticeFunction
.endm
2019-12-02 21:26:56 +01:00
@ Return the APPRENTICE_QUESTION_* value for the current question to ask
.macro apprentice_getquestion
setvar VAR_0x8004, APPRENTICE_FUNC_GET_QUESTION
special CallApprenticeFunction
.endm
2019-12-02 21:26:56 +01:00
@ Get the number of mons that have been chosen for the Apprentice's party so far
.macro apprentice_getnumpartymons
setvar VAR_0x8004, APPRENTICE_FUNC_GET_NUM_PARTY_MONS
special CallApprenticeFunction
.endm
2019-12-02 21:26:56 +01:00
@ Set the Apprentice party mon at the given slot. VAR_0x8005 is used implicitly as which of the 2 mons was selected
.macro apprentice_setpartymon slot:req
copyvar VAR_0x8006, \slot
setvar VAR_0x8004, APPRENTICE_FUNC_SET_PARTY_MON
special CallApprenticeFunction
.endm
2019-12-02 21:26:56 +01:00
@ Allocate and set up data to track about the question
.macro apprentice_initquestion which:req
setvar VAR_0x8004, APPRENTICE_FUNC_INIT_QUESTION_DATA
setvar VAR_0x8005, \which
special CallApprenticeFunction
.endm
2019-12-02 21:26:56 +01:00
@ Free allocated question data
.macro apprentice_freequestion
setvar VAR_0x8004, APPRENTICE_FUNC_FREE_QUESTION_DATA
special CallApprenticeFunction
.endm
2019-12-02 21:26:56 +01:00
@ Buffer some APPRENTICE_BUFF_* string to the given stringvar (0 for STR_VAR_1, 1 for STR_VAR_2, 2 for STR_VAR_3)
.macro apprentice_buff stringvar:req, tobuff:req
setvar VAR_0x8004, APPRENTICE_FUNC_BUFFER_STRING
2019-12-02 21:26:56 +01:00
setvar VAR_0x8005, \stringvar
.if \tobuff >= VARS_START
copyvar VAR_0x8006, \tobuff
.else
setvar VAR_0x8006, \tobuff
.endif
special CallApprenticeFunction
.endm
2019-12-02 21:26:56 +01:00
@ Set which move to use that the player chose (implicitly VAR_0x8005)
.macro apprentice_setmove
setvar VAR_0x8004, APPRENTICE_FUNC_SET_MOVE
special CallApprenticeFunction
.endm
2019-12-02 21:26:56 +01:00
@ Set which mon the Apprentice should lead with
.macro apprentice_setleadmon monId:req
copyvar VAR_0x8005, \monId
setvar VAR_0x8004, APPRENTICE_FUNC_SET_LEAD_MON
special CallApprenticeFunction
.endm
2019-12-02 21:26:56 +01:00
@ Open the Bag Menu for the player to choose an item to recommend as a held item
.macro apprentice_openbag
setvar VAR_0x8004, APPRENTICE_FUNC_OPEN_BAG
special CallApprenticeFunction
waitstate
.endm
2019-12-02 21:26:56 +01:00
@ Try and set the recommended held item. FALSE if the item has been recommended before, as Battle Frontier forbids using the same held item for multiple party mons
.macro apprentice_trysetitem
setvar VAR_0x8004, APPRENTICE_FUNC_TRY_SET_HELD_ITEM
special CallApprenticeFunction
.endm
2019-12-02 21:26:56 +01:00
@ Save the current Player Apprentice to the saveblock to make room for a new Apprentice
.macro apprentice_save
setvar VAR_0x8004, APPRENTICE_FUNC_SAVE
special CallApprenticeFunction
.endm
2019-12-02 21:26:56 +01:00
@ Set the object event gfx for the Apprentice based on their trainer class
.macro apprentice_setgfx
setvar VAR_0x8004, APPRENTICE_FUNC_SET_GFX
special CallApprenticeFunction
.endm
2019-12-02 21:26:56 +01:00
@ Always returns TRUE. No side effect. May have been for debug or dummied for some other reason
.macro apprentice_shouldleave
setvar VAR_0x8004, APPRENTICE_FUNC_SHOULD_LEAVE
special CallApprenticeFunction
.endm
2019-12-02 21:26:56 +01:00
@ Shift the other saved Apprentices over to make room for saving a new Apprentice
.macro apprentice_shiftsaved
setvar VAR_0x8004, APPRENTICE_FUNC_SHIFT_SAVED
special CallApprenticeFunction
.endm