summaryrefslogtreecommitdiff
path: root/asm/macros
diff options
context:
space:
mode:
Diffstat (limited to 'asm/macros')
-rw-r--r--asm/macros/battle_frontier.inc169
-rw-r--r--asm/macros/battle_script.inc14
-rw-r--r--asm/macros/event.inc26
3 files changed, 198 insertions, 11 deletions
diff --git a/asm/macros/battle_frontier.inc b/asm/macros/battle_frontier.inc
new file mode 100644
index 000000000..2a6ee7d74
--- /dev/null
+++ b/asm/macros/battle_frontier.inc
@@ -0,0 +1,169 @@
+@ To be populated with macros for the Battle Frontier CallFacilityFunction specials
+
+
+@ Frontier Util
+
+.macro frontier_setlvlmode lvlmode:req
+setvar VAR_0x8004, FRONTIER_UTIL_FUNC_2
+setvar VAR_0x8005, 1
+setvar VAR_0x8006, \lvlmode
+special CallFrontierUtilFunc
+.endm
+
+@ Battle Tower
+
+.macro battletower_getstreak
+setvar VAR_0x8004, BATTLE_TOWER_FUNC_1
+setvar VAR_0x8005, 1
+special CallBattleTowerFunc
+.endm
+
+@ Battle Dome
+
+@ Battle Palace
+
+@ Battle Arena
+
+@ Battle Factory
+
+@ Battle Pike
+
+@ Battle Pyramid
+
+@ Battle Tent
+
+@ Trainer Hill
+
+@ Apprentice
+
+.macro apprentice_gavelvlmode
+setvar VAR_0x8004, APPRENTICE_FUNC_GAVE_LVLMODE
+special CallApprenticeFunction
+.endm
+
+.macro apprentice_setlvlmode lvlmode:req
+setvar VAR_0x8004, APPRENTICE_FUNC_SET_LVLMODE
+setorcopyvar VAR_0x8005, \lvlmode
+addvar VAR_0x8005, 1
+special CallApprenticeFunction
+.endm
+
+.macro apprentice_answeredquestion
+setvar VAR_0x8004, APPRENTICE_FUNC_ANSWERED_QUESTION
+special CallApprenticeFunction
+.endm
+
+.macro apprentice_menu which:req
+setvar VAR_0x8004, APPRENTICE_FUNC_MENU
+setvar VAR_0x8005, \which
+special CallApprenticeFunction
+waitstate
+.endm
+
+.macro apprentice_shufflespecies
+setvar VAR_0x8004, APPRENTICE_FUNC_SHUFFLE_SPECIES
+special CallApprenticeFunction
+.endm
+
+.macro apprentice_randomizequestions
+setvar VAR_0x8004, APPRENTICE_FUNC_RANDOMIZE_QUESTIONS
+special CallApprenticeFunction
+.endm
+
+.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
+
+.macro apprentice_reset
+setvar VAR_0x8004, APPRENTICE_FUNC_RESET
+special CallApprenticeFunction
+.endm
+
+.macro apprentice_shouldcheckgone
+setvar VAR_0x8004, APPRENTICE_FUNC_CHECK_GONE
+special CallApprenticeFunction
+.endm
+
+.macro apprentice_getquestion
+setvar VAR_0x8004, APPRENTICE_FUNC_GET_QUESTION
+special CallApprenticeFunction
+.endm
+
+.macro apprentice_getnumpartymons
+setvar VAR_0x8004, APPRENTICE_FUNC_GET_NUM_PARTY_MONS
+special CallApprenticeFunction
+.endm
+
+.macro apprentice_setpartymon slot:req
+copyvar VAR_0x8006, \slot
+setvar VAR_0x8004, APPRENTICE_FUNC_SET_PARTY_MON
+special CallApprenticeFunction
+.endm
+
+.macro apprentice_initquestion which:req
+setvar VAR_0x8004, APPRENTICE_FUNC_INIT_QUESTION_DATA
+setvar VAR_0x8005, \which
+special CallApprenticeFunction
+.endm
+
+.macro apprentice_freequestion
+setvar VAR_0x8004, APPRENTICE_FUNC_FREE_QUESTION_DATA
+special CallApprenticeFunction
+.endm
+
+.macro apprentice_buff whichstringvar:req, tobuff:req
+setvar VAR_0x8004, APPRENTICE_FUNC_BUFFER_STRING
+setvar VAR_0x8005, \whichstringvar
+.if \tobuff >= VARS_START
+copyvar VAR_0x8006, \tobuff
+.else
+setvar VAR_0x8006, \tobuff
+.endif
+special CallApprenticeFunction
+.endm
+
+.macro apprentice_setmove
+setvar VAR_0x8004, APPRENTICE_FUNC_SET_MOVE
+special CallApprenticeFunction
+.endm
+
+.macro apprentice_setleadmon monId:req
+copyvar VAR_0x8005, \monId
+setvar VAR_0x8004, APPRENTICE_FUNC_SET_LEAD_MON
+special CallApprenticeFunction
+.endm
+
+.macro apprentice_openbag
+setvar VAR_0x8004, APPRENTICE_FUNC_OPEN_BAG
+special CallApprenticeFunction
+waitstate
+.endm
+
+.macro apprentice_trysetitem
+setvar VAR_0x8004, APPRENTICE_FUNC_TRY_SET_HELD_ITEM
+special CallApprenticeFunction
+.endm
+
+.macro apprentice_save
+setvar VAR_0x8004, APPRENTICE_FUNC_SAVE
+special CallApprenticeFunction
+.endm
+
+.macro apprentice_setgfx
+setvar VAR_0x8004, APPRENTICE_FUNC_SET_GFX
+special CallApprenticeFunction
+.endm
+
+.macro apprentice_shouldleave
+setvar VAR_0x8004, APPRENTICE_FUNC_SHOULD_LEAVE
+special CallApprenticeFunction
+.endm
+
+.macro apprentice_shiftsaved
+setvar VAR_0x8004, APPRENTICE_FUNC_SHIFT_SAVED
+special CallApprenticeFunction
+.endm
diff --git a/asm/macros/battle_script.inc b/asm/macros/battle_script.inc
index 997af51cc..eda410c5b 100644
--- a/asm/macros/battle_script.inc
+++ b/asm/macros/battle_script.inc
@@ -391,11 +391,11 @@
.byte 0x47
.endm
- .macro playstatchangeanimation battler:req, param1:req, param2:req
+ .macro playstatchangeanimation battler:req, stats:req, statchange:req
.byte 0x48
.byte \battler
- .byte \param1
- .byte \param2
+ .byte \stats
+ .byte \statchange
.endm
.macro moveend param0:req, param1:req
@@ -738,10 +738,10 @@
.byte 0x88
.endm
- .macro statbuffchange param0:req, param1:req
+ .macro statbuffchange flags:req, jumpptr:req
.byte 0x89
- .byte \param0
- .4byte \param1
+ .byte \flags
+ .4byte \jumpptr
.endm
.macro normalisebuffs
@@ -1267,7 +1267,7 @@
various \battler, 4
.endm
- .macro resetintrimidatetracebits battler:req
+ .macro resetintimidatetracebits battler:req
various \battler, VARIOUS_RESET_INTIMIDATE_TRACE_BITS
.endm
diff --git a/asm/macros/event.inc b/asm/macros/event.inc
index 39510c207..9db57daf1 100644
--- a/asm/macros/event.inc
+++ b/asm/macros/event.inc
@@ -677,7 +677,7 @@
.elseif \type == TRAINER_BATTLE_SET_TRAINER_B
.4byte \pointer1 @ text
.4byte \pointer2 @ text
- .elseif \type == TRAINER_BATTLE_12
+ .elseif \type == TRAINER_BATTLE_HILL
.4byte \pointer1 @ text
.4byte \pointer2 @ text
.endif
@@ -891,7 +891,7 @@
.endm
@ Draws an image of the winner of the contest. In FireRed, this command is a nop. (The argument is discarded.)
- .macro drawcontestwinner a:req
+ .macro showcontestwinner a:req
.byte 0x77
.byte \a
.endm
@@ -1080,9 +1080,11 @@
.byte \check
.endm
- @ Hides the secondary box spawned by showmoney.
+ @ Hides the secondary box spawned by showmoney. Consumption of the x and y arguments was dummied out.
.macro hidemoneybox
.byte 0x94
+ .byte 0 @ \x
+ .byte 0 @ \y
.endm
@ Updates the secondary box spawned by showmoney. Consumes but does not use arguments.
@@ -1506,7 +1508,7 @@
.byte 0xd9
.endm
- .macro hidebox2
+ .macro closebraillemessage
.byte 0xda
.endm
@@ -1630,6 +1632,14 @@
call_if 5, \dest
.endm
+ .macro vgoto_if_eq dest:req
+ vgoto_if 1, \dest
+ .endm
+
+ .macro vgoto_if_ne dest:req
+ vgoto_if 0, \dest
+ .endm
+
.macro switch var:req
copyvar VAR_0x8000, \var
.endm
@@ -1645,6 +1655,7 @@
MSGBOX_DEFAULT = 4
MSGBOX_YESNO = 5
MSGBOX_AUTOCLOSE = 6
+ MSGBOX_GETPOINTS = 9
YES = 1
NO = 0
@@ -1671,3 +1682,10 @@
setorcopyvar VAR_0x8000, \trainer
callstd STD_REGISTER_MATCH_CALL
.endm
+
+ .macro dofieldeffectsparkle x:req, y:req, priority:req
+ setfieldeffectargument 0, \x
+ setfieldeffectargument 1, \y
+ setfieldeffectargument 2, \priority
+ dofieldeffect FLDEFF_SPARKLE
+ .endm