import from github
This commit is contained in:
12
asm/macros/asm.inc
Normal file
12
asm/macros/asm.inc
Normal file
@ -0,0 +1,12 @@
|
||||
.macro inc x
|
||||
.set \x, \x + 1
|
||||
.endm
|
||||
|
||||
.macro enum_start x=0
|
||||
.set __enum__, \x
|
||||
.endm
|
||||
|
||||
.macro enum constant
|
||||
.equiv \constant, __enum__
|
||||
inc __enum__
|
||||
.endm
|
619
asm/macros/battle_ai_script.inc
Normal file
619
asm/macros/battle_ai_script.inc
Normal file
@ -0,0 +1,619 @@
|
||||
.macro if_random_less_than param0:req, param1:req
|
||||
.byte 0x0
|
||||
.byte \param0
|
||||
.4byte \param1
|
||||
.endm
|
||||
|
||||
.macro if_random_greater_than param0:req, param1:req
|
||||
.byte 0x1
|
||||
.byte \param0
|
||||
.4byte \param1
|
||||
.endm
|
||||
|
||||
.macro if_random_equal param0:req, param1:req
|
||||
.byte 0x2
|
||||
.byte \param0
|
||||
.4byte \param1
|
||||
.endm
|
||||
|
||||
.macro if_random_not_equal param0:req, param1:req
|
||||
.byte 0x3
|
||||
.byte \param0
|
||||
.4byte \param1
|
||||
.endm
|
||||
|
||||
.macro score param0:req
|
||||
.byte 0x4
|
||||
.byte \param0
|
||||
.endm
|
||||
|
||||
.macro if_hp_less_than battler:req, param1:req, param2:req
|
||||
.byte 0x5
|
||||
.byte \battler
|
||||
.byte \param1
|
||||
.4byte \param2
|
||||
.endm
|
||||
|
||||
.macro if_hp_more_than battler:req, param1:req, param2:req
|
||||
.byte 0x6
|
||||
.byte \battler
|
||||
.byte \param1
|
||||
.4byte \param2
|
||||
.endm
|
||||
|
||||
.macro if_hp_equal battler:req, param1:req, param2:req
|
||||
.byte 0x7
|
||||
.byte \battler
|
||||
.byte \param1
|
||||
.4byte \param2
|
||||
.endm
|
||||
|
||||
.macro if_hp_not_equal battler:req, param1:req, param2:req
|
||||
.byte 0x8
|
||||
.byte \battler
|
||||
.byte \param1
|
||||
.4byte \param2
|
||||
.endm
|
||||
|
||||
.macro if_status battler:req, status1:req, param2:req
|
||||
.byte 0x9
|
||||
.byte \battler
|
||||
.4byte \status1
|
||||
.4byte \param2
|
||||
.endm
|
||||
|
||||
.macro if_not_status battler:req, status1:req, param2:req
|
||||
.byte 0xa
|
||||
.byte \battler
|
||||
.4byte \status1
|
||||
.4byte \param2
|
||||
.endm
|
||||
|
||||
.macro if_status2 battler:req, status2:req, param2:req
|
||||
.byte 0xb
|
||||
.byte \battler
|
||||
.4byte \status2
|
||||
.4byte \param2
|
||||
.endm
|
||||
|
||||
.macro if_not_status2 battler:req, status2:req, param2:req
|
||||
.byte 0xc
|
||||
.byte \battler
|
||||
.4byte \status2
|
||||
.4byte \param2
|
||||
.endm
|
||||
|
||||
.macro if_status3 battler:req, status3:req, param2:req
|
||||
.byte 0xd
|
||||
.byte \battler
|
||||
.4byte \status3
|
||||
.4byte \param2
|
||||
.endm
|
||||
|
||||
.macro if_not_status3 battler:req, status3:req, param2:req
|
||||
.byte 0xe
|
||||
.byte \battler
|
||||
.4byte \status3
|
||||
.4byte \param2
|
||||
.endm
|
||||
|
||||
.macro if_side_affecting battler:req, sidestatus:req, param2:req
|
||||
.byte 0xf
|
||||
.byte \battler
|
||||
.4byte \sidestatus
|
||||
.4byte \param2
|
||||
.endm
|
||||
|
||||
.macro if_not_side_affecting battler:req, sidestatus:req, param2:req
|
||||
.byte 0x10
|
||||
.byte \battler
|
||||
.4byte \sidestatus
|
||||
.4byte \param2
|
||||
.endm
|
||||
|
||||
.macro if_less_than param0:req, param1:req
|
||||
.byte 0x11
|
||||
.byte \param0
|
||||
.4byte \param1
|
||||
.endm
|
||||
|
||||
.macro if_more_than param0:req, param1:req
|
||||
.byte 0x12
|
||||
.byte \param0
|
||||
.4byte \param1
|
||||
.endm
|
||||
|
||||
.macro if_equal param0:req, param1:req
|
||||
.byte 0x13
|
||||
.byte \param0
|
||||
.4byte \param1
|
||||
.endm
|
||||
|
||||
.macro if_not_equal param0:req, param1:req
|
||||
.byte 0x14
|
||||
.byte \param0
|
||||
.4byte \param1
|
||||
.endm
|
||||
|
||||
.macro if_less_than_ptr param0:req, param1:req
|
||||
.byte 0x15
|
||||
.4byte \param0
|
||||
.4byte \param1
|
||||
.endm
|
||||
|
||||
.macro if_more_than_ptr param0:req, param1:req
|
||||
.byte 0x16
|
||||
.4byte \param0
|
||||
.4byte \param1
|
||||
.endm
|
||||
|
||||
.macro if_equal_ptr param0:req, param1:req
|
||||
.byte 0x17
|
||||
.4byte \param0
|
||||
.4byte \param1
|
||||
.endm
|
||||
|
||||
.macro if_not_equal_ptr param0:req, param1:req
|
||||
.byte 0x18
|
||||
.4byte \param0
|
||||
.4byte \param1
|
||||
.endm
|
||||
|
||||
.macro if_move param0:req, param1:req
|
||||
.byte 0x19
|
||||
.2byte \param0
|
||||
.4byte \param1
|
||||
.endm
|
||||
|
||||
.macro if_not_move param0:req, param1:req
|
||||
.byte 0x1a
|
||||
.2byte \param0
|
||||
.4byte \param1
|
||||
.endm
|
||||
|
||||
.macro if_in_bytes param0:req, param1:req
|
||||
.byte 0x1b
|
||||
.4byte \param0
|
||||
.4byte \param1
|
||||
.endm
|
||||
|
||||
.macro if_not_in_bytes param0:req, param1:req
|
||||
.byte 0x1c
|
||||
.4byte \param0
|
||||
.4byte \param1
|
||||
.endm
|
||||
|
||||
.macro if_in_hwords param0:req, param1:req
|
||||
.byte 0x1d
|
||||
.4byte \param0
|
||||
.4byte \param1
|
||||
.endm
|
||||
|
||||
.macro if_not_in_hwords param0:req, param1:req
|
||||
.byte 0x1e
|
||||
.4byte \param0
|
||||
.4byte \param1
|
||||
.endm
|
||||
|
||||
.macro if_user_has_attacking_move param0:req
|
||||
.byte 0x1f
|
||||
.4byte \param0
|
||||
.endm
|
||||
|
||||
.macro if_user_has_no_attacking_moves param0:req
|
||||
.byte 0x20
|
||||
.4byte \param0
|
||||
.endm
|
||||
|
||||
.macro get_turn_count
|
||||
.byte 0x21
|
||||
.endm
|
||||
|
||||
.macro get_type param0:req
|
||||
.byte 0x22
|
||||
.byte \param0
|
||||
.endm
|
||||
|
||||
.macro get_considered_move_power
|
||||
.byte 0x23
|
||||
.endm
|
||||
|
||||
.macro get_how_powerful_move_is
|
||||
.byte 0x24
|
||||
.endm
|
||||
|
||||
.macro get_last_used_bank_move battler:req
|
||||
.byte 0x25
|
||||
.byte \battler
|
||||
.endm
|
||||
|
||||
.macro if_equal_ param0:req, param1:req
|
||||
.byte 0x26
|
||||
.byte \param0
|
||||
.4byte \param1
|
||||
.endm
|
||||
|
||||
.macro if_not_equal_ param0:req, param1:req
|
||||
.byte 0x27
|
||||
.byte \param0
|
||||
.4byte \param1
|
||||
.endm
|
||||
|
||||
.macro if_user_goes param0:req, param1:req
|
||||
.byte 0x28
|
||||
.byte \param0
|
||||
.4byte \param1
|
||||
.endm
|
||||
|
||||
.macro if_user_doesnt_go param0:req, param1:req
|
||||
.byte 0x29
|
||||
.byte \param0
|
||||
.4byte \param1
|
||||
.endm
|
||||
|
||||
.macro nop_2A
|
||||
.byte 0x2a
|
||||
.endm
|
||||
|
||||
.macro nop_2B
|
||||
.byte 0x2b
|
||||
.endm
|
||||
|
||||
.macro count_usable_party_mons battler:req
|
||||
.byte 0x2c
|
||||
.byte \battler
|
||||
.endm
|
||||
|
||||
.macro get_considered_move
|
||||
.byte 0x2d
|
||||
.endm
|
||||
|
||||
.macro get_considered_move_effect
|
||||
.byte 0x2e
|
||||
.endm
|
||||
|
||||
.macro get_ability battler:req
|
||||
.byte 0x2f
|
||||
.byte \battler
|
||||
.endm
|
||||
|
||||
.macro get_highest_type_effectiveness
|
||||
.byte 0x30
|
||||
.endm
|
||||
|
||||
.macro if_type_effectiveness param0:req, param1:req
|
||||
.byte 0x31
|
||||
.byte \param0
|
||||
.4byte \param1
|
||||
.endm
|
||||
|
||||
.macro nop_32
|
||||
.byte 0x32
|
||||
.endm
|
||||
|
||||
.macro nop_33
|
||||
.byte 0x33
|
||||
.endm
|
||||
|
||||
.macro if_status_in_party battler:req, status1:req, param2:req
|
||||
.byte 0x34
|
||||
.byte \battler
|
||||
.4byte \status1
|
||||
.4byte \param2
|
||||
.endm
|
||||
|
||||
.macro if_status_not_in_party battler:req, status1:req, param2:req
|
||||
.byte 0x35
|
||||
.byte \battler
|
||||
.4byte \status1
|
||||
.4byte \param2
|
||||
.endm
|
||||
|
||||
.macro get_weather
|
||||
.byte 0x36
|
||||
.endm
|
||||
|
||||
.macro if_effect param0:req, param1:req
|
||||
.byte 0x37
|
||||
.byte \param0
|
||||
.4byte \param1
|
||||
.endm
|
||||
|
||||
.macro if_not_effect param0:req, param1:req
|
||||
.byte 0x38
|
||||
.byte \param0
|
||||
.4byte \param1
|
||||
.endm
|
||||
|
||||
.macro if_stat_level_less_than battler:req, stat:req, param2:req, param3:req
|
||||
.byte 0x39
|
||||
.byte \battler
|
||||
.byte \stat
|
||||
.byte \param2
|
||||
.4byte \param3
|
||||
.endm
|
||||
|
||||
.macro if_stat_level_more_than battler:req, stat:req, param2:req, param3:req
|
||||
.byte 0x3a
|
||||
.byte \battler
|
||||
.byte \stat
|
||||
.byte \param2
|
||||
.4byte \param3
|
||||
.endm
|
||||
|
||||
.macro if_stat_level_equal battler:req, stat:req, param2:req, param3:req
|
||||
.byte 0x3b
|
||||
.byte \battler
|
||||
.byte \stat
|
||||
.byte \param2
|
||||
.4byte \param3
|
||||
.endm
|
||||
|
||||
.macro if_stat_level_not_equal battler:req, stat:req, param2:req, param3:req
|
||||
.byte 0x3c
|
||||
.byte \battler
|
||||
.byte \stat
|
||||
.byte \param2
|
||||
.4byte \param3
|
||||
.endm
|
||||
|
||||
.macro if_can_faint param0:req
|
||||
.byte 0x3d
|
||||
.4byte \param0
|
||||
.endm
|
||||
|
||||
.macro if_cant_faint param0:req
|
||||
.byte 0x3e
|
||||
.4byte \param0
|
||||
.endm
|
||||
|
||||
.macro if_has_move battler:req, param1:req, param2:req
|
||||
.byte 0x3f
|
||||
.byte \battler
|
||||
.2byte \param1
|
||||
.4byte \param2
|
||||
.endm
|
||||
|
||||
.macro if_doesnt_have_move battler:req, param1:req, param2:req
|
||||
.byte 0x40
|
||||
.byte \battler
|
||||
.2byte \param1
|
||||
.4byte \param2
|
||||
.endm
|
||||
|
||||
.macro if_has_move_with_effect battler:req, param1:req, param2:req
|
||||
.byte 0x41
|
||||
.byte \battler
|
||||
.byte \param1
|
||||
.4byte \param2
|
||||
.endm
|
||||
|
||||
.macro if_doesnt_have_move_with_effect battler:req, param1:req, param2:req
|
||||
.byte 0x42
|
||||
.byte \battler
|
||||
.byte \param1
|
||||
.4byte \param2
|
||||
.endm
|
||||
|
||||
.macro if_any_move_disabled_or_encored battler:req, param1:req, param2:req
|
||||
.byte 0x43
|
||||
.byte \battler
|
||||
.byte \param1
|
||||
.4byte \param2
|
||||
.endm
|
||||
|
||||
.macro if_curr_move_disabled_or_encored param0:req, param1:req
|
||||
.byte 0x44
|
||||
.byte \param0
|
||||
.4byte \param1
|
||||
.endm
|
||||
|
||||
.macro flee
|
||||
.byte 0x45
|
||||
.endm
|
||||
|
||||
.macro if_random_safari_flee param0:req
|
||||
.byte 0x46
|
||||
.4byte \param0
|
||||
.endm
|
||||
|
||||
.macro watch
|
||||
.byte 0x47
|
||||
.endm
|
||||
|
||||
.macro get_hold_effect battler:req
|
||||
.byte 0x48
|
||||
.byte \battler
|
||||
.endm
|
||||
|
||||
.macro get_gender battler:req
|
||||
.byte 0x49
|
||||
.byte \battler
|
||||
.endm
|
||||
|
||||
.macro is_first_turn_for battler:req
|
||||
.byte 0x4a
|
||||
.byte \battler
|
||||
.endm
|
||||
|
||||
.macro get_stockpile_count battler:req
|
||||
.byte 0x4b
|
||||
.byte \battler
|
||||
.endm
|
||||
|
||||
.macro is_double_battle
|
||||
.byte 0x4c
|
||||
.endm
|
||||
|
||||
.macro get_used_held_item battler:req
|
||||
.byte 0x4d
|
||||
.byte \battler
|
||||
.endm
|
||||
|
||||
.macro get_move_type_from_result
|
||||
.byte 0x4e
|
||||
.endm
|
||||
|
||||
.macro get_move_power_from_result
|
||||
.byte 0x4f
|
||||
.endm
|
||||
|
||||
.macro get_move_effect_from_result
|
||||
.byte 0x50
|
||||
.endm
|
||||
|
||||
.macro get_protect_count battler:req
|
||||
.byte 0x51
|
||||
.byte \battler
|
||||
.endm
|
||||
|
||||
.macro nop_52
|
||||
.byte 0x52
|
||||
.endm
|
||||
|
||||
.macro nop_53
|
||||
.byte 0x53
|
||||
.endm
|
||||
|
||||
.macro nop_54
|
||||
.byte 0x54
|
||||
.endm
|
||||
|
||||
.macro nop_55
|
||||
.byte 0x55
|
||||
.endm
|
||||
|
||||
.macro nop_56
|
||||
.byte 0x56
|
||||
.endm
|
||||
|
||||
.macro nop_57
|
||||
.byte 0x57
|
||||
.endm
|
||||
|
||||
.macro call param0:req
|
||||
.byte 0x58
|
||||
.4byte \param0
|
||||
.endm
|
||||
|
||||
.macro goto param0:req
|
||||
.byte 0x59
|
||||
.4byte \param0
|
||||
.endm
|
||||
|
||||
.macro end
|
||||
.byte 0x5a
|
||||
.endm
|
||||
|
||||
.macro if_level_cond param0:req, param1:req
|
||||
.byte 0x5b
|
||||
.byte \param0
|
||||
.4byte \param1
|
||||
.endm
|
||||
|
||||
.macro if_target_taunted param0:req
|
||||
.byte 0x5c
|
||||
.4byte \param0
|
||||
.endm
|
||||
|
||||
.macro if_target_not_taunted param0:req
|
||||
.byte 0x5d
|
||||
.4byte \param0
|
||||
.endm
|
||||
|
||||
.macro if_target_is_ally param0:req
|
||||
.byte 0x5e
|
||||
.4byte \param0
|
||||
.endm
|
||||
|
||||
.macro is_of_type battler:req, type:req
|
||||
.byte 0x5f
|
||||
.byte \battler
|
||||
.byte \type
|
||||
.endm
|
||||
|
||||
.macro check_ability battler:req, ability:req
|
||||
.byte 0x60
|
||||
.byte \battler
|
||||
.byte \ability
|
||||
.endm
|
||||
|
||||
.macro if_flash_fired battler:req, param1:req
|
||||
.byte 0x61
|
||||
.byte \battler
|
||||
.4byte \param1
|
||||
.endm
|
||||
|
||||
.macro if_holds_item battler:req, param1:req, param2:req
|
||||
.byte 0x62
|
||||
.byte \battler
|
||||
.2byte \param1
|
||||
.4byte \param2
|
||||
.endm
|
||||
|
||||
@ useful script macros
|
||||
.macro get_curr_move_type
|
||||
get_type AI_TYPE_MOVE
|
||||
.endm
|
||||
|
||||
.macro get_user_type1
|
||||
get_type AI_TYPE1_USER
|
||||
.endm
|
||||
|
||||
.macro get_user_type2
|
||||
get_type AI_TYPE2_USER
|
||||
.endm
|
||||
|
||||
.macro get_target_type1
|
||||
get_type AI_TYPE1_TARGET
|
||||
.endm
|
||||
|
||||
.macro get_target_type2
|
||||
get_type AI_TYPE2_TARGET
|
||||
.endm
|
||||
|
||||
.macro if_ability battler:req, ability:req, ptr:req
|
||||
check_ability \battler, \ability
|
||||
if_equal 1, \ptr
|
||||
.endm
|
||||
|
||||
.macro if_no_ability battler:req, ability:req, ptr:req
|
||||
check_ability \battler, \ability
|
||||
if_equal 0, \ptr
|
||||
.endm
|
||||
|
||||
.macro if_type battler:req, type:req, ptr:req
|
||||
is_of_type \battler, \type
|
||||
if_equal 1, \ptr
|
||||
.endm
|
||||
|
||||
.macro if_no_type battler:req, type:req, ptr:req
|
||||
is_of_type \battler, \type
|
||||
if_equal 0, \ptr
|
||||
.endm
|
||||
|
||||
.macro if_target_faster ptr:req
|
||||
if_user_goes 1, \ptr
|
||||
.endm
|
||||
|
||||
.macro if_user_faster ptr:req
|
||||
if_user_goes 0, \ptr
|
||||
.endm
|
||||
|
||||
.macro if_double_battle ptr:req
|
||||
is_double_battle
|
||||
if_equal 1, \ptr
|
||||
.endm
|
||||
|
||||
.macro if_not_double_battle ptr:req
|
||||
is_double_battle
|
||||
if_equal 0, \ptr
|
||||
.endm
|
||||
|
||||
.macro if_any_move_disabled battler:req, ptr:req
|
||||
if_any_move_disabled_or_encored \battler, 0, \ptr
|
||||
.endm
|
||||
|
||||
.macro if_any_move_encored battler:req, ptr:req
|
||||
if_any_move_disabled_or_encored \battler, 1, \ptr
|
||||
.endm
|
285
asm/macros/battle_anim_script.inc
Normal file
285
asm/macros/battle_anim_script.inc
Normal file
@ -0,0 +1,285 @@
|
||||
@ commands
|
||||
|
||||
.macro loadspritegfx tag:req
|
||||
.byte 0x0
|
||||
.2byte \tag
|
||||
.endm
|
||||
|
||||
.macro unloadspritegfx tag:req
|
||||
.byte 0x1
|
||||
.2byte \tag
|
||||
.endm
|
||||
|
||||
.macro createsprite template:req, anim_battler:req, subpriority_offset:req, argv:vararg
|
||||
.byte 0x02
|
||||
.4byte \template
|
||||
.if \anim_battler == ANIM_TARGET
|
||||
.byte ANIMSPRITE_IS_TARGET | (\subpriority_offset & 0x7F)
|
||||
.else
|
||||
.byte (\subpriority_offset & 0x7F)
|
||||
.endif
|
||||
.byte (.Lsprite_\@_2 - .Lsprite_\@_1) / 2
|
||||
.Lsprite_\@_1:
|
||||
.2byte \argv
|
||||
.Lsprite_\@_2:
|
||||
.endm
|
||||
|
||||
.macro createvisualtask addr:req, priority:req, argv:vararg
|
||||
.byte 0x03
|
||||
.4byte \addr
|
||||
.byte \priority
|
||||
.byte (.Lcreatetask_\@_2 - .Lcreatetask_\@_1) / 2
|
||||
.Lcreatetask_\@_1:
|
||||
.2byte \argv
|
||||
.Lcreatetask_\@_2:
|
||||
.endm
|
||||
|
||||
.macro delay frames:req
|
||||
.byte 0x4
|
||||
.byte \frames
|
||||
.endm
|
||||
|
||||
.macro waitforvisualfinish
|
||||
.byte 0x5
|
||||
.endm
|
||||
|
||||
.macro nop
|
||||
.byte 0x6
|
||||
.endm
|
||||
|
||||
.macro nop2
|
||||
.byte 0x7
|
||||
.endm
|
||||
|
||||
.macro end
|
||||
.byte 0x8
|
||||
.endm
|
||||
|
||||
.macro playse se:req
|
||||
.byte 0x9
|
||||
.2byte \se
|
||||
.endm
|
||||
|
||||
.macro monbg battler:req
|
||||
.byte 0xa
|
||||
.byte \battler
|
||||
.endm
|
||||
|
||||
.macro clearmonbg battler:req
|
||||
.byte 0xb
|
||||
.byte \battler
|
||||
.endm
|
||||
|
||||
.macro setalpha eva:req, evb:req
|
||||
.byte 0x0C
|
||||
.2byte ((\evb) << 8) | (\eva)
|
||||
.endm
|
||||
|
||||
.macro blendoff
|
||||
.byte 0xd
|
||||
.endm
|
||||
|
||||
.macro call ptr:req
|
||||
.byte 0xe
|
||||
.4byte \ptr
|
||||
.endm
|
||||
|
||||
.macro return
|
||||
.byte 0xf
|
||||
.endm
|
||||
|
||||
.macro setarg argId:req, value:req
|
||||
.byte 0x10
|
||||
.byte \argId
|
||||
.2byte \value
|
||||
.endm
|
||||
|
||||
.macro choosetwoturnanim ptr1:req, ptr2:req
|
||||
.byte 0x11
|
||||
.4byte \ptr1
|
||||
.4byte \ptr2
|
||||
.endm
|
||||
|
||||
.macro jumpifmoveturn value:req, ptr:req
|
||||
.byte 0x12
|
||||
.byte \value
|
||||
.4byte \ptr
|
||||
.endm
|
||||
|
||||
.macro goto ptr:req
|
||||
.byte 0x13
|
||||
.4byte \ptr
|
||||
.endm
|
||||
|
||||
.macro fadetobg bg:req
|
||||
.byte 0x14
|
||||
.byte \bg
|
||||
.endm
|
||||
|
||||
.macro restorebg
|
||||
.byte 0x15
|
||||
.endm
|
||||
|
||||
.macro waitbgfadeout
|
||||
.byte 0x16
|
||||
.endm
|
||||
|
||||
.macro waitbgfadein
|
||||
.byte 0x17
|
||||
.endm
|
||||
|
||||
.macro changebg bg:req
|
||||
.byte 0x18
|
||||
.byte \bg
|
||||
.endm
|
||||
|
||||
.macro playsewithpan se:req, pan:req
|
||||
.byte 0x19
|
||||
.2byte \se
|
||||
.byte \pan
|
||||
.endm
|
||||
|
||||
.macro setpan pan:req
|
||||
.byte 0x1a
|
||||
.byte \pan
|
||||
.endm
|
||||
|
||||
.macro panse se:req, currentPan:req, targetPan:req, incrementPan:req, delay:req
|
||||
.byte 0x1b
|
||||
.2byte \se
|
||||
.byte \currentPan
|
||||
.byte \targetPan
|
||||
.byte \incrementPan
|
||||
.byte \delay
|
||||
.endm
|
||||
|
||||
.macro loopsewithpan se:req, pan:req, wait:req, times:req
|
||||
.byte 0x1c
|
||||
.2byte \se
|
||||
.byte \pan
|
||||
.byte \wait
|
||||
.byte \times
|
||||
.endm
|
||||
|
||||
.macro waitplaysewithpan se:req, pan:req, wait:req
|
||||
.byte 0x1d
|
||||
.2byte \se
|
||||
.byte \pan
|
||||
.byte \wait
|
||||
.endm
|
||||
|
||||
.macro setbldcnt bldcnt:req
|
||||
.byte 0x1e
|
||||
.2byte \bldcnt
|
||||
.endm
|
||||
|
||||
.macro createsoundtask addr:req, argv:vararg
|
||||
.byte 0x1F
|
||||
.4byte \addr
|
||||
.byte (.Lcreatetask_1F_\@_2 - .Lcreatetask_1F_\@_1) / 2
|
||||
.Lcreatetask_1F_\@_1:
|
||||
.2byte \argv
|
||||
.Lcreatetask_1F_\@_2:
|
||||
.endm
|
||||
|
||||
.macro waitsound
|
||||
.byte 0x20
|
||||
.endm
|
||||
|
||||
.macro jumpargeq argId:req, value:req, ptr:req
|
||||
.byte 0x21
|
||||
.byte \argId
|
||||
.2byte \value
|
||||
.4byte \ptr
|
||||
.endm
|
||||
|
||||
.macro monbg_static battler:req
|
||||
.byte 0x22
|
||||
.byte \battler
|
||||
.endm
|
||||
|
||||
.macro clearmonbg_static battler:req
|
||||
.byte 0x23
|
||||
.byte \battler
|
||||
.endm
|
||||
|
||||
.macro jumpifcontest ptr:req
|
||||
.byte 0x24
|
||||
.4byte \ptr
|
||||
.endm
|
||||
|
||||
.macro fadetobgfromset bgOpponent:req, bgPlayer:req, bgContest:req
|
||||
.byte 0x25
|
||||
.byte \bgOpponent
|
||||
.byte \bgPlayer
|
||||
.byte \bgContest
|
||||
.endm
|
||||
|
||||
.macro panse_adjustnone se:req, currentPan:req, targetPan:req, incrementPan:req, delay:req
|
||||
.byte 0x26
|
||||
.2byte \se
|
||||
.byte \currentPan
|
||||
.byte \targetPan
|
||||
.byte \incrementPan
|
||||
.byte \delay
|
||||
.endm
|
||||
|
||||
.macro panse_adjustall se:req, currentPan:req, targetPan:req, incrementPan:req, delay:req
|
||||
.byte 0x27
|
||||
.2byte \se
|
||||
.byte \currentPan
|
||||
.byte \targetPan
|
||||
.byte \incrementPan
|
||||
.byte \delay
|
||||
.endm
|
||||
|
||||
.macro splitbgprio battler:req
|
||||
.byte 0x28
|
||||
.byte \battler
|
||||
.endm
|
||||
|
||||
.macro splitbgprio_all
|
||||
.byte 0x29
|
||||
.endm
|
||||
|
||||
.macro splitbgprio_foes battler:req
|
||||
.byte 0x2a
|
||||
.byte \battler
|
||||
.endm
|
||||
|
||||
.macro invisible battler:req
|
||||
.byte 0x2b
|
||||
.byte \battler
|
||||
.endm
|
||||
|
||||
.macro visible battler:req
|
||||
.byte 0x2c
|
||||
.byte \battler
|
||||
.endm
|
||||
|
||||
.macro teamattack_moveback battler:req
|
||||
.byte 0x2d
|
||||
.byte \battler
|
||||
.endm
|
||||
|
||||
.macro teamattack_movefwd battler:req
|
||||
.byte 0x2e
|
||||
.byte \battler
|
||||
.endm
|
||||
|
||||
.macro stopsound
|
||||
.byte 0x2f
|
||||
.endm
|
||||
|
||||
@ useful macros
|
||||
.macro jumpreteq value:req, ptr:req
|
||||
jumpargeq ARG_RET_ID, \value, \ptr
|
||||
.endm
|
||||
|
||||
.macro jumprettrue ptr:req
|
||||
jumpreteq TRUE, \ptr
|
||||
.endm
|
||||
|
||||
.macro jumpretfalse ptr:req
|
||||
jumpreteq FALSE, \ptr
|
||||
.endm
|
162
asm/macros/battle_frontier/apprentice.inc
Normal file
162
asm/macros/battle_frontier/apprentice.inc
Normal file
@ -0,0 +1,162 @@
|
||||
@ 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
|
||||
|
||||
@ 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
|
||||
addvar VAR_0x8005, 1 @ Apprentice lvl mode is +1 from regular lvl mode value
|
||||
special CallApprenticeFunction
|
||||
.endm
|
||||
|
||||
@ Question was answered, increment the number of questions answered
|
||||
.macro apprentice_answeredquestion
|
||||
setvar VAR_0x8004, APPRENTICE_FUNC_ANSWERED_QUESTION
|
||||
special CallApprenticeFunction
|
||||
.endm
|
||||
|
||||
@ 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
|
||||
|
||||
@ 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
|
||||
|
||||
@ 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
|
||||
|
||||
@ 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
|
||||
|
||||
@ Clear the data for the current Player Apprentice
|
||||
.macro apprentice_reset
|
||||
setvar VAR_0x8004, APPRENTICE_FUNC_RESET
|
||||
special CallApprenticeFunction
|
||||
.endm
|
||||
|
||||
@ 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
|
||||
|
||||
@ Return the APPRENTICE_QUESTION_* value for the current question to ask
|
||||
.macro apprentice_getquestion
|
||||
setvar VAR_0x8004, APPRENTICE_FUNC_GET_QUESTION
|
||||
special CallApprenticeFunction
|
||||
.endm
|
||||
|
||||
@ 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
|
||||
|
||||
@ 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
|
||||
|
||||
@ 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
|
||||
|
||||
@ Free allocated question data
|
||||
.macro apprentice_freequestion
|
||||
setvar VAR_0x8004, APPRENTICE_FUNC_FREE_QUESTION_DATA
|
||||
special CallApprenticeFunction
|
||||
.endm
|
||||
|
||||
@ 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
|
||||
.if \stringvar == STR_VAR_1
|
||||
setvar VAR_0x8005, 0
|
||||
.elseif \stringvar == STR_VAR_2
|
||||
setvar VAR_0x8005, 1
|
||||
.elseif \stringvar == STR_VAR_3
|
||||
setvar VAR_0x8005, 2
|
||||
.else
|
||||
setvar VAR_0x8005, \stringvar
|
||||
.endif
|
||||
.if \tobuff >= VARS_START
|
||||
copyvar VAR_0x8006, \tobuff
|
||||
.else
|
||||
setvar VAR_0x8006, \tobuff
|
||||
.endif
|
||||
special CallApprenticeFunction
|
||||
.endm
|
||||
|
||||
@ 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
|
||||
|
||||
@ 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
|
||||
|
||||
@ 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
|
||||
|
||||
@ 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
|
||||
|
||||
@ 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
|
||||
|
||||
@ 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
|
||||
|
||||
@ 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
|
||||
|
||||
@ 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
|
49
asm/macros/battle_frontier/battle_arena.inc
Normal file
49
asm/macros/battle_frontier/battle_arena.inc
Normal file
@ -0,0 +1,49 @@
|
||||
@ Initialize the Battle Arena challenge
|
||||
.macro arena_init
|
||||
setvar VAR_0x8004, BATTLE_ARENA_FUNC_INIT
|
||||
special CallBattleArenaFunction
|
||||
.endm
|
||||
|
||||
@ Unused. Get the value of some ARENA_DATA_*. See GetArenaData for the data types that can be retrieved
|
||||
.macro arena_get data:req
|
||||
setvar VAR_0x8004, BATTLE_ARENA_FUNC_GET_DATA
|
||||
setvar VAR_0x8005, \data
|
||||
special CallBattleArenaFunction
|
||||
.endm
|
||||
|
||||
@ Set some ARENA_DATA_* to val. See SetArenaData for the data types that can be set
|
||||
.macro arena_set data:req, val:req
|
||||
setvar VAR_0x8004, BATTLE_ARENA_FUNC_SET_DATA
|
||||
setvar VAR_0x8005, \data
|
||||
.if \val >= VARS_START
|
||||
copyvar VAR_0x8006, \val
|
||||
.else
|
||||
setvar VAR_0x8006, \val
|
||||
.endif
|
||||
special CallBattleArenaFunction
|
||||
.endm
|
||||
|
||||
@ Save the game and set the challenge status
|
||||
.macro arena_save challengeStatus:req
|
||||
setvar VAR_0x8004, BATTLE_ARENA_FUNC_SAVE
|
||||
setvar VAR_0x8005, \challengeStatus
|
||||
special CallBattleArenaFunction
|
||||
.endm
|
||||
|
||||
@ Unused. Set the prize item to give from one of two lists of possible prizes, depending on streak.
|
||||
.macro arena_setprize
|
||||
setvar VAR_0x8004, BATTLE_ARENA_FUNC_SET_PRIZE
|
||||
special CallBattleArenaFunction
|
||||
.endm
|
||||
|
||||
@ Unused. Give the set prize item to the player. TRUE if room in Bag for prize, FALSE otherwise
|
||||
.macro arena_giveprize
|
||||
setvar VAR_0x8004, BATTLE_ARENA_FUNC_GIVE_PRIZE
|
||||
special CallBattleArenaFunction
|
||||
.endm
|
||||
|
||||
@ Buffer the opponents name to STR_VAR_1
|
||||
.macro arena_gettrainername
|
||||
setvar VAR_0x8004, BATTLE_ARENA_FUNC_GET_TRAINER_NAME
|
||||
special CallBattleArenaFunction
|
||||
.endm
|
144
asm/macros/battle_frontier/battle_dome.inc
Normal file
144
asm/macros/battle_frontier/battle_dome.inc
Normal file
@ -0,0 +1,144 @@
|
||||
@ Initialize the Battle Dome challenge
|
||||
.macro dome_init
|
||||
setvar VAR_0x8004, BATTLE_DOME_FUNC_INIT
|
||||
special CallBattleDomeFunction
|
||||
.endm
|
||||
|
||||
@ Get the value of some DOME_DATA_*. See GetDomeData for the data types that can be retrieved
|
||||
.macro dome_get data:req
|
||||
setvar VAR_0x8004, BATTLE_DOME_FUNC_GET_DATA
|
||||
setvar VAR_0x8005, \data
|
||||
special CallBattleDomeFunction
|
||||
.endm
|
||||
|
||||
@ Set some DOME_DATA_* to val. See SetDomeData for the data types that can be set
|
||||
.macro dome_set data:req, val=0xFFFF
|
||||
setvar VAR_0x8004, BATTLE_DOME_FUNC_SET_DATA
|
||||
setvar VAR_0x8005, \data
|
||||
.if \val != 0xFFFF
|
||||
setvar VAR_0x8006, \val
|
||||
.endif
|
||||
special CallBattleDomeFunction
|
||||
.endm
|
||||
|
||||
@ Buffer the name of the current round to gStringVar1
|
||||
.macro dome_getroundtext
|
||||
setvar VAR_0x8004, BATTLE_DOME_FUNC_GET_ROUND_TEXT
|
||||
special CallBattleDomeFunction
|
||||
.endm
|
||||
|
||||
@ Buffer the name of the opponent to gStringVar2 and the name of the round to gStringVar1
|
||||
.macro dome_getopponentname
|
||||
setvar VAR_0x8004, BATTLE_DOME_FUNC_GET_OPPONENT_NAME
|
||||
special CallBattleDomeFunction
|
||||
.endm
|
||||
|
||||
@ Choose which of the opponents mons to use in battle and load them into the enemy party
|
||||
.macro dome_initopponentparty
|
||||
setvar VAR_0x8004, BATTLE_DOME_FUNC_INIT_OPPONENT_PARTY
|
||||
special CallBattleDomeFunction
|
||||
.endm
|
||||
|
||||
@ Show the page that gives information on the next opponent
|
||||
.macro dome_showopponentinfo
|
||||
setvar VAR_0x8004, BATTLE_DOME_FUNC_SHOW_OPPONENT_INFO
|
||||
special CallBattleDomeFunction
|
||||
.endm
|
||||
|
||||
@ Displays the tourney tree for the current tourney
|
||||
.macro dome_showtourneytree
|
||||
setvar VAR_0x8004, BATTLE_DOME_FUNC_SHOW_TOURNEY_TREE
|
||||
special CallBattleDomeFunction
|
||||
.endm
|
||||
|
||||
@ Displays the tourney tree for the results of the previous tourney. Before the player enters their first tourney this is a random tourney generated by dome_initresultstree
|
||||
.macro dome_showprevtourneytree
|
||||
setvar VAR_0x8004, BATTLE_DOME_FUNC_SHOW_PREV_TOURNEY_TREE
|
||||
special CallBattleDomeFunction
|
||||
.endm
|
||||
|
||||
@ Sets gTrainerBattleOpponent_A to the trainer ID of the next opponent
|
||||
.macro dome_setopponent
|
||||
setvar VAR_0x8004, BATTLE_DOME_FUNC_SET_OPPONENT_ID
|
||||
special CallBattleDomeFunction
|
||||
.endm
|
||||
|
||||
@ Set the object event gfx id for the opponent
|
||||
.macro dome_setopponentgfx
|
||||
setvar VAR_0x8004, BATTLE_DOME_FUNC_SET_OPPONENT_GFX
|
||||
special CallBattleDomeFunction
|
||||
.endm
|
||||
|
||||
@ A non-interactive version of the tourney tree shown when a round is completed
|
||||
.macro dome_showstatictourneytree
|
||||
setvar VAR_0x8004, BATTLE_DOME_FUNC_SHOW_STATIC_TOURNEY_TREE
|
||||
special CallBattleDomeFunction
|
||||
.endm
|
||||
|
||||
@ Decides the winners of NPC vs NPC matches, and eliminates either the player or their opponent depending on the playerStatus (DOME_PLAYER_*)
|
||||
.macro dome_resolvewinners playerStatus:req
|
||||
setvar VAR_0x8004, BATTLE_DOME_FUNC_RESOLVE_WINNERS
|
||||
setvar VAR_0x8005, \playerStatus
|
||||
special CallBattleDomeFunction
|
||||
.endm
|
||||
|
||||
@ Save the game and set the challenge status
|
||||
.macro dome_save challengeStatus:req
|
||||
setvar VAR_0x8004, BATTLE_DOME_FUNC_SAVE
|
||||
setvar VAR_0x8005, \challengeStatus
|
||||
special CallBattleDomeFunction
|
||||
.endm
|
||||
|
||||
@ Unused. Increment the win streaks for the current challenge by one
|
||||
.macro dome_incrementstreaks
|
||||
setvar VAR_0x8004, BATTLE_DOME_FUNC_INCREMENT_STREAK
|
||||
special CallBattleDomeFunction
|
||||
.endm
|
||||
|
||||
@ Sets the facility trainer/mon set pointers
|
||||
.macro dome_settrainers
|
||||
setvar VAR_0x8004, BATTLE_DOME_FUNC_SET_TRAINERS
|
||||
special CallBattleDomeFunction
|
||||
.endm
|
||||
|
||||
@ If any moves were copied using Sketch during the challenge then restore them to Sketch
|
||||
.macro dome_resetsketch
|
||||
setvar VAR_0x8004, BATTLE_DOME_FUNC_RESET_SKETCH
|
||||
special CallBattleDomeFunction
|
||||
.endm
|
||||
|
||||
@ Reset the held items of the mons that just battled to what they were prior to battling
|
||||
.macro dome_restorehelditems
|
||||
setvar VAR_0x8004, BATTLE_DOME_FUNC_RESTORE_HELD_ITEMS
|
||||
special CallBattleDomeFunction
|
||||
.endm
|
||||
|
||||
@ Reduce the players party to the selected mons, used to reduce down to the 2 selected for battle
|
||||
.macro dome_reduceparty
|
||||
setvar VAR_0x8004, BATTLE_DOME_FUNC_REDUCE_PARTY
|
||||
special CallBattleDomeFunction
|
||||
.endm
|
||||
|
||||
@ Compares the initial tournament ranking (seed) of the player to opponent A. Returns 1 if the player's seed is better, 2 if the opponent's seed is better.
|
||||
.macro dome_compareseeds
|
||||
setvar VAR_0x8004, BATTLE_DOME_FUNC_COMPARE_SEEDS
|
||||
special CallBattleDomeFunction
|
||||
.endm
|
||||
|
||||
@ Buffer the name of the winner for the last Dome challenge to STR_VAR_1
|
||||
.macro dome_getwinnersname
|
||||
setvar VAR_0x8004, BATTLE_DOME_FUNC_GET_WINNER_NAME
|
||||
special CallBattleDomeFunction
|
||||
.endm
|
||||
|
||||
@ Performs a random tourney to initialize the results board before the player has entered a challenge
|
||||
.macro dome_initresultstree
|
||||
setvar VAR_0x8004, BATTLE_DOME_FUNC_INIT_RESULTS_TREE
|
||||
special CallBattleDomeFunction
|
||||
.endm
|
||||
|
||||
@ Generates the tourney trainers and their parties, and seeds them in the tourney tree
|
||||
.macro dome_inittrainers
|
||||
setvar VAR_0x8004, BATTLE_DOME_FUNC_INIT_TRAINERS
|
||||
special CallBattleDomeFunction
|
||||
.endm
|
101
asm/macros/battle_frontier/battle_factory.inc
Normal file
101
asm/macros/battle_frontier/battle_factory.inc
Normal file
@ -0,0 +1,101 @@
|
||||
@ Initialize the Battle Factory challenge
|
||||
.macro factory_init
|
||||
setvar VAR_0x8004, BATTLE_FACTORY_FUNC_INIT
|
||||
special CallBattleFactoryFunction
|
||||
.endm
|
||||
|
||||
@ Get the value of some FACTORY_DATA_*. See GetBattleFactoryData for the data types that can be retrieved
|
||||
.macro factory_get data:req
|
||||
setvar VAR_0x8004, BATTLE_FACTORY_FUNC_GET_DATA
|
||||
setvar VAR_0x8005, \data
|
||||
special CallBattleFactoryFunction
|
||||
.endm
|
||||
|
||||
@ Set some FACTORY_DATA_* to val. See SetBattleFactoryData for the data types that can be set
|
||||
.macro factory_set data:req, val=0xFFFF
|
||||
setvar VAR_0x8004, BATTLE_FACTORY_FUNC_SET_DATA
|
||||
setvar VAR_0x8005, \data
|
||||
.if \val == 0xFFFF
|
||||
@ argument not provided
|
||||
.elseif \val >= VARS_START
|
||||
copyvar VAR_0x8006, \val
|
||||
.else
|
||||
setvar VAR_0x8006, \val
|
||||
.endif
|
||||
special CallBattleFactoryFunction
|
||||
.endm
|
||||
|
||||
@ Save the game and set the challenge status
|
||||
.macro factory_save challengeStatus:req
|
||||
setvar VAR_0x8004, BATTLE_FACTORY_FUNC_SAVE
|
||||
setvar VAR_0x8005, \challengeStatus
|
||||
special CallBattleFactoryFunction
|
||||
.endm
|
||||
|
||||
@ Select the initial rental mons for the challenge
|
||||
.macro factory_rentmons
|
||||
setvar VAR_0x8004, BATTLE_FACTORY_FUNC_SELECT_RENT_MONS
|
||||
special CallBattleFactoryFunction
|
||||
.endm
|
||||
|
||||
@ Select a mon to swap for from the previously defeated team
|
||||
.macro factory_swapmons
|
||||
setvar VAR_0x8004, BATTLE_FACTORY_FUNC_SWAP_RENT_MONS
|
||||
special CallBattleFactoryFunction
|
||||
.endm
|
||||
|
||||
@ Allows FACTORY_DATA_WIN_STREAK_SWAPS to be incremented once
|
||||
.macro factory_setswapped
|
||||
setvar VAR_0x8004, BATTLE_FACTORY_FUNC_SET_SWAPPED
|
||||
special CallBattleFactoryFunction
|
||||
.endm
|
||||
|
||||
@ Update gEnemyParty with the next set of rental mons
|
||||
.macro factory_setopponentmons
|
||||
setvar VAR_0x8004, BATTLE_FACTORY_FUNC_SET_OPPONENT_MONS
|
||||
special CallBattleFactoryFunction
|
||||
.endm
|
||||
|
||||
@ Populate gPlayerParty and gEnemyParty with the rental mons. Only needed when resuming a challenge, otherwise only factory_setopponentmons and factory_rentmons/factory_swapmons are needed
|
||||
.macro factory_setparties arg:req
|
||||
setvar VAR_0x8004, BATTLE_FACTORY_FUNC_SET_PARTIES
|
||||
setvar VAR_0x8005, \arg
|
||||
special CallBattleFactoryFunction
|
||||
.endm
|
||||
|
||||
@ Set the object event gfx for the opponent trainer
|
||||
.macro factory_setopponentgfx
|
||||
setvar VAR_0x8004, BATTLE_FACTORY_FUNC_SET_OPPONENT_GFX
|
||||
special CallBattleFactoryFunction
|
||||
.endm
|
||||
|
||||
@ Generate the mons for the opponents team
|
||||
.macro factory_generateopponentmons
|
||||
setvar VAR_0x8004, BATTLE_FACTORY_FUNC_GENERATE_OPPONENT_MONS
|
||||
special CallBattleFactoryFunction
|
||||
.endm
|
||||
|
||||
@ Generate the random 6 mons to choose from for the initial rental
|
||||
.macro factory_generaterentalmons
|
||||
setvar VAR_0x8004, BATTLE_FACTORY_FUNC_GENERATE_RENTAL_MONS
|
||||
special CallBattleFactoryFunction
|
||||
.endm
|
||||
|
||||
@ Return the pokemon type most common in the opponents team, or NUMBER_OF_MON_TYPES if there is no standout type
|
||||
.macro factory_getopponentmontype
|
||||
setvar VAR_0x8004, BATTLE_FACTORY_FUNC_GET_OPPONENT_MON_TYPE
|
||||
special CallBattleFactoryFunction
|
||||
.endm
|
||||
|
||||
@ Return the FACTORY_STYLE_* dependent on what types of moves the opponents team has, or FACTORY_NUM_STYLES if multiple styles tie for the same amount of moves
|
||||
.macro factory_getopponentstyle
|
||||
setvar VAR_0x8004, BATTLE_FACTORY_FUNC_GET_OPPONENT_STYLE
|
||||
special CallBattleFactoryFunction
|
||||
.endm
|
||||
|
||||
@ Restore the held items for the players party to what they were pre-battle
|
||||
.macro factory_resethelditems
|
||||
setvar VAR_0x8004, BATTLE_FACTORY_FUNC_RESET_HELD_ITEMS
|
||||
special CallBattleFactoryFunction
|
||||
.endm
|
||||
|
63
asm/macros/battle_frontier/battle_palace.inc
Normal file
63
asm/macros/battle_frontier/battle_palace.inc
Normal file
@ -0,0 +1,63 @@
|
||||
@ Initialize the Battle Palace challenge
|
||||
.macro palace_init
|
||||
setvar VAR_0x8004, BATTLE_PALACE_FUNC_INIT
|
||||
special CallBattlePalaceFunction
|
||||
.endm
|
||||
|
||||
@ Get the value of some PALACE_DATA_*. See GetPalaceData for the data types that can be retrieved
|
||||
.macro palace_get data:req
|
||||
setvar VAR_0x8004, BATTLE_PALACE_FUNC_GET_DATA
|
||||
setvar VAR_0x8005, \data
|
||||
special CallBattlePalaceFunction
|
||||
.endm
|
||||
|
||||
@ Set some PALACE_DATA_* to val. See SetPalaceData for the data types that can be set
|
||||
.macro palace_set data:req, val:req
|
||||
setvar VAR_0x8004, BATTLE_PALACE_FUNC_SET_DATA
|
||||
setvar VAR_0x8005, \data
|
||||
setvar VAR_0x8006, \val
|
||||
special CallBattlePalaceFunction
|
||||
.endm
|
||||
|
||||
@ Get the id of the comment to be made while being led through the corridor
|
||||
.macro palace_getcomment
|
||||
setvar VAR_0x8004, BATTLE_PALACE_FUNC_GET_COMMENT_ID
|
||||
special CallBattlePalaceFunction
|
||||
.endm
|
||||
|
||||
@ Unused. Choose and set the opponent gfx id. The equivalent macro from Battle Tower is used instead
|
||||
.macro palace_setopponent
|
||||
setvar VAR_0x8004, BATTLE_PALACE_FUNC_SET_OPPONENT
|
||||
special CallBattlePalaceFunction
|
||||
.endm
|
||||
|
||||
@ Buffer the opponents intro speech to gStringVar4. Also used by Battle Arena and Factory
|
||||
.macro palace_getopponentintro
|
||||
setvar VAR_0x8004, BATTLE_PALACE_FUNC_GET_OPPONENT_INTRO
|
||||
special CallBattlePalaceFunction
|
||||
.endm
|
||||
|
||||
@ Increments the current win streak by 1
|
||||
.macro palace_incrementstreak
|
||||
setvar VAR_0x8004, BATTLE_PALACE_FUNC_INCREMENT_STREAK
|
||||
special CallBattlePalaceFunction
|
||||
.endm
|
||||
|
||||
@ Save the game and set the challenge status
|
||||
.macro palace_save challengeStatus:req
|
||||
setvar VAR_0x8004, BATTLE_PALACE_FUNC_SAVE
|
||||
setvar VAR_0x8005, \challengeStatus
|
||||
special CallBattlePalaceFunction
|
||||
.endm
|
||||
|
||||
@ Unused. Set the prize item to give from one of two lists of possible prizes, depending on streak.
|
||||
.macro palace_setprize
|
||||
setvar VAR_0x8004, BATTLE_PALACE_FUNC_SET_PRIZE
|
||||
special CallBattleArenaFunction
|
||||
.endm
|
||||
|
||||
@ Unused. Give the set prize item to the player. TRUE if room in Bag for prize, FALSE otherwise
|
||||
.macro palace_giveprize
|
||||
setvar VAR_0x8004, BATTLE_PALACE_FUNC_GIVE_PRIZE
|
||||
special CallBattleArenaFunction
|
||||
.endm
|
171
asm/macros/battle_frontier/battle_pike.inc
Normal file
171
asm/macros/battle_frontier/battle_pike.inc
Normal file
@ -0,0 +1,171 @@
|
||||
@ Set sRoomType to the next PIKE_ROOM_* id
|
||||
.macro pike_setnextroom
|
||||
setvar VAR_0x8004, BATTLE_PIKE_FUNC_SET_ROOM_TYPE
|
||||
special CallBattlePikeFunction
|
||||
.endm
|
||||
|
||||
@ Get the value of some PIKE_DATA_*. See GetBattlePikeData for the data types that can be retrieved
|
||||
.macro pike_get data:req
|
||||
setvar VAR_0x8004, BATTLE_PIKE_FUNC_GET_DATA
|
||||
setvar VAR_0x8005, \data
|
||||
special CallBattlePikeFunction
|
||||
.endm
|
||||
|
||||
@ Set some PIKE_DATA_* to val. See SetBattlePikeData for the data types that can be set
|
||||
.macro pike_set data:req, val:req
|
||||
setvar VAR_0x8004, BATTLE_PIKE_FUNC_SET_DATA
|
||||
setvar VAR_0x8005, \data
|
||||
.if \val >= VARS_START
|
||||
copyvar VAR_0x8006, \val
|
||||
.else
|
||||
setvar VAR_0x8006, \val
|
||||
.endif
|
||||
special CallBattlePikeFunction
|
||||
.endm
|
||||
|
||||
@ TRUE if the next room is the last (15th) room, FALSE otherwise
|
||||
.macro pike_isfinalroom
|
||||
setvar VAR_0x8004, BATTLE_PIKE_FUNC_IS_FINAL_ROOM
|
||||
special CallBattlePikeFunction
|
||||
.endm
|
||||
|
||||
@ Set the object event gfx for the room being entered
|
||||
.macro pike_setroomobjects
|
||||
setvar VAR_0x8004, BATTLE_PIKE_FUNC_SET_ROOM_OBJECTS
|
||||
special CallBattlePikeFunction
|
||||
.endm
|
||||
|
||||
@ Get the current room type (sRoomType)
|
||||
.macro pike_getroomtype
|
||||
setvar VAR_0x8004, BATTLE_PIKE_FUNC_GET_ROOM_TYPE
|
||||
special CallBattlePikeFunction
|
||||
.endm
|
||||
|
||||
@ Sets a bool that's never read
|
||||
.macro pike_inwildmonroom
|
||||
setvar VAR_0x8004, BATTLE_PIKE_FUNC_SET_IN_WILD_MON_ROOM
|
||||
special CallBattlePikeFunction
|
||||
.endm
|
||||
|
||||
@ Clears a bool that's never read
|
||||
.macro pike_exitwildmonroom
|
||||
setvar VAR_0x8004, BATTLE_PIKE_FUNC_CLEAR_IN_WILD_MON_ROOM
|
||||
special CallBattlePikeFunction
|
||||
.endm
|
||||
|
||||
@ Save the game and set the challenge status
|
||||
.macro pike_save challengeStatus:req
|
||||
setvar VAR_0x8004, BATTLE_PIKE_FUNC_SAVE
|
||||
setvar VAR_0x8005, \challengeStatus
|
||||
special CallBattlePikeFunction
|
||||
.endm
|
||||
|
||||
@ Returns the PIKE_STATUS_* to be afflicted for the status room
|
||||
.macro pike_getstatus
|
||||
setvar VAR_0x8004, BATTLE_PIKE_FUNC_GET_ROOM_STATUS
|
||||
special CallBattlePikeFunction
|
||||
.endm
|
||||
|
||||
@ Returns the PIKE_STATUSMON_* that attacks the player for the status room
|
||||
.macro pike_getstatusmon
|
||||
setvar VAR_0x8004, BATTLE_PIKE_FUNC_GET_ROOM_STATUS_MON
|
||||
special CallBattlePikeFunction
|
||||
.endm
|
||||
|
||||
@ Randomly heals either one or two party mons and returns the number of mons healed
|
||||
.macro pike_healonetwomons
|
||||
setvar VAR_0x8004, BATTLE_PIKE_FUNC_HEAL_ONE_TWO_MONS
|
||||
special CallBattlePikeFunction
|
||||
.endm
|
||||
|
||||
@ Buffers a message for the lone NPC in the NPC room to gStringVar4
|
||||
.macro pike_getnpcmsg
|
||||
setvar VAR_0x8004, BATTLE_PIKE_FUNC_BUFFER_NPC_MSG
|
||||
special CallBattlePikeFunction
|
||||
.endm
|
||||
|
||||
@ Flashes the screen 3 times for when the Dusclops/Kirlia attacks the player
|
||||
.macro pike_flashscreen
|
||||
setvar VAR_0x8004, BATTLE_PIKE_FUNC_STATUS_SCREEN_FLASH
|
||||
special CallBattlePikeFunction
|
||||
.endm
|
||||
|
||||
@ TRUE if the player is currently in a Battle Pike challenge map
|
||||
.macro pike_inchallenge
|
||||
setvar VAR_0x8004, BATTLE_PIKE_FUNC_IS_IN
|
||||
special CallBattlePikeFunction
|
||||
.endm
|
||||
|
||||
@ Set which room to give a hint about. TRUE if its the Pike Queens room next
|
||||
.macro pike_sethintroom
|
||||
setvar VAR_0x8004, BATTLE_PIKE_FUNC_SET_HINT_ROOM
|
||||
special CallBattlePikeFunction
|
||||
.endm
|
||||
|
||||
@ Get PIKE_ROOM_(LEFT/CENTER/RIGHT) for which room to give a hint about
|
||||
.macro pike_gethintroomid
|
||||
setvar VAR_0x8004, BATTLE_PIKE_FUNC_GET_HINT_ROOM_ID
|
||||
special CallBattlePikeFunction
|
||||
.endm
|
||||
|
||||
@ Get the PIKE_HINT_* to give about the next room
|
||||
.macro pike_gethint
|
||||
setvar VAR_0x8004, BATTLE_PIKE_FUNC_GET_ROOM_TYPE_HINT
|
||||
special CallBattlePikeFunction
|
||||
.endm
|
||||
|
||||
@ Reset the frontier trainer ids for the start of the challenge
|
||||
.macro pike_cleartrainerids
|
||||
setvar VAR_0x8004, BATTLE_PIKE_FUNC_CLEAR_TRAINER_IDS
|
||||
special CallBattlePikeFunction
|
||||
.endm
|
||||
|
||||
@ Buffer the opponents battle intro speech to gStringVar4. \trainer 0 for Trainer A, 1 for Trainer B
|
||||
.macro pike_gettrainerintro trainer:req
|
||||
setvar VAR_0x8004, BATTLE_PIKE_FUNC_GET_TRAINER_INTRO
|
||||
setvar VAR_0x8005, \trainer
|
||||
special CallBattlePikeFunction
|
||||
.endm
|
||||
|
||||
@ Get the status of the Pike Queen (Not ready, Silver/Gold streak before symbols, Silver/Gold streak after symbols)
|
||||
.macro pike_getbrainstatus
|
||||
setvar VAR_0x8004, BATTLE_PIKE_FUNC_GET_QUEEN_FIGHT_TYPE
|
||||
special CallBattlePikeFunction
|
||||
.endm
|
||||
|
||||
@ Heal 0-2 party mons depending on which room was chosen for the Pike Queen battle. Return the number healed
|
||||
.macro pike_prequeenheal
|
||||
setvar VAR_0x8004, BATTLE_PIKE_FUNC_HEAL_MONS_BEFORE_QUEEN
|
||||
special CallBattlePikeFunction
|
||||
.endm
|
||||
|
||||
@ When \set is TRUE, prevent healing rooms from appearing (for 1st room or when party is full health). \set FALSE to re-enable healing rooms
|
||||
.macro pike_nohealing set:req
|
||||
setvar VAR_0x8004, BATTLE_PIKE_FUNC_SET_HEAL_ROOMS_DISABLED
|
||||
setvar VAR_0x8005, \set
|
||||
special CallBattlePikeFunction
|
||||
.endm
|
||||
|
||||
@ TRUE if the party is full health (full HP, PP, and no status), FALSE otherwise
|
||||
.macro pike_ispartyfullhealth
|
||||
setvar VAR_0x8004, BATTLE_PIKE_FUNC_IS_PARTY_FULL_HEALTH
|
||||
special CallBattlePikeFunction
|
||||
.endm
|
||||
|
||||
@ Save the party held items in pikeHeldItemsBackup
|
||||
.macro pike_savehelditems
|
||||
setvar VAR_0x8004, BATTLE_PIKE_FUNC_SAVE_HELD_ITEMS
|
||||
special CallBattlePikeFunction
|
||||
.endm
|
||||
|
||||
@ Restore the party held items from pikeHeldItemsBackup
|
||||
.macro pike_resethelditems
|
||||
setvar VAR_0x8004, BATTLE_PIKE_FUNC_RESET_HELD_ITEMS
|
||||
special CallBattlePikeFunction
|
||||
.endm
|
||||
|
||||
@ Initialize the Battle Pike challenge
|
||||
.macro pike_init
|
||||
setvar VAR_0x8004, BATTLE_PIKE_FUNC_INIT
|
||||
special CallBattlePikeFunction
|
||||
.endm
|
104
asm/macros/battle_frontier/battle_pyramid.inc
Normal file
104
asm/macros/battle_frontier/battle_pyramid.inc
Normal file
@ -0,0 +1,104 @@
|
||||
@ Initialize the Battle Pyramid challenge
|
||||
.macro pyramid_init
|
||||
setvar VAR_0x8004, BATTLE_PYRAMID_FUNC_INIT
|
||||
special CallBattlePyramidFunction
|
||||
.endm
|
||||
|
||||
@ Get the value of some PYRAMID_DATA_*. See GetBattlePyramidData for the data types that can be retrieved
|
||||
.macro pyramid_get data:req
|
||||
setvar VAR_0x8004, BATTLE_PYRAMID_FUNC_GET_DATA
|
||||
setvar VAR_0x8005, \data
|
||||
special CallBattlePyramidFunction
|
||||
.endm
|
||||
|
||||
@ Set some PYRAMID_DATA_* to val. See SetBattlePyramidData for the data types that can be set
|
||||
.macro pyramid_set data:req, val:req
|
||||
setvar VAR_0x8004, BATTLE_PYRAMID_FUNC_SET_DATA
|
||||
setvar VAR_0x8005, \data
|
||||
setvar VAR_0x8006, \val
|
||||
special CallBattlePyramidFunction
|
||||
.endm
|
||||
|
||||
@ Save the game and set the challenge status
|
||||
.macro pyramid_save challengeStatus:req
|
||||
setvar VAR_0x8004, BATTLE_PYRAMID_FUNC_SAVE
|
||||
setvar VAR_0x8005, \challengeStatus
|
||||
special CallBattlePyramidFunction
|
||||
.endm
|
||||
|
||||
@ Set the prize item to give from one of two lists of possible prizes, depending on streak.
|
||||
.macro pyramid_setprize
|
||||
setvar VAR_0x8004, BATTLE_PYRAMID_FUNC_SET_PRIZE
|
||||
special CallBattlePyramidFunction
|
||||
.endm
|
||||
|
||||
@ Unused. Give the set prize item to the player. TRUE if room in Bag for prize, FALSE otherwise
|
||||
.macro pyramid_giveprize
|
||||
setvar VAR_0x8004, BATTLE_PYRAMID_FUNC_GIVE_PRIZE
|
||||
special CallBattlePyramidFunction
|
||||
.endm
|
||||
|
||||
@ Set the random values for the floor (used to determine object positions, e.g.), and clear trainer flags
|
||||
.macro pyramid_seedfloor
|
||||
setvar VAR_0x8004, BATTLE_PYRAMID_FUNC_SEED_FLOOR
|
||||
special CallBattlePyramidFunction
|
||||
.endm
|
||||
|
||||
@ Set the item to pick up depending on the random seed and quantity (always 1) to the arguments for STD_FIND_ITEM
|
||||
.macro pyramid_setitem
|
||||
setvar VAR_0x8004, BATTLE_PYRAMID_FUNC_SET_ITEM
|
||||
special CallBattlePyramidFunction
|
||||
.endm
|
||||
|
||||
@ Hide the picked-up item (technically it moves the item far offscreen)
|
||||
.macro pyramid_hideitem
|
||||
setvar VAR_0x8004, BATTLE_PYRAMID_FUNC_HIDE_ITEM
|
||||
special CallBattlePyramidFunction
|
||||
.endm
|
||||
|
||||
@ Set the facility trainers to gBattleFrontierTrainers
|
||||
.macro pyramid_settrainers
|
||||
setvar VAR_0x8004, BATTLE_PYRAMID_FUNC_SET_TRAINERS
|
||||
special CallBattlePyramidFunction
|
||||
.endm
|
||||
|
||||
@ Show the post-battle hint text
|
||||
.macro pyramid_showhint
|
||||
setvar VAR_0x8004, BATTLE_PYRAMID_FUNC_SHOW_HINT_TEXT
|
||||
special CallBattlePyramidFunction
|
||||
.endm
|
||||
|
||||
@ VAR_RESULT is 1 if player is on a Pyramid floor, 2 if on the Pyramid peak, 0 otherwise
|
||||
.macro pyramid_inchallenge
|
||||
setvar VAR_0x8004, BATTLE_PYRAMID_FUNC_IS_IN
|
||||
special CallBattlePyramidFunction
|
||||
.endm
|
||||
|
||||
@ Update the light around the player. 2 different modes, for setting or incrementing light. See PYRAMID_LIGHT_*
|
||||
.macro pyramid_updatelight radius:req, mode:req, sound=0xFFFF
|
||||
setvar VAR_0x8004, BATTLE_PYRAMID_FUNC_UPDATE_LIGHT
|
||||
setvar VAR_0x8005, \radius
|
||||
setvar VAR_0x8006, \mode
|
||||
.if \sound != 0xFFFF
|
||||
setvar VAR_0x8007, \sound
|
||||
.endif
|
||||
special CallBattlePyramidFunction
|
||||
.endm
|
||||
|
||||
@ Reset the held items to what they were at the start of the challenge
|
||||
.macro pyramid_clearhelditems
|
||||
setvar VAR_0x8004, BATTLE_PYRAMID_FUNC_CLEAR_HELD_ITEMS
|
||||
special CallBattlePyramidFunction
|
||||
.endm
|
||||
|
||||
@ Set the palette depending on current floor number
|
||||
.macro pyramid_setfloorpal
|
||||
setvar VAR_0x8004, BATTLE_PYRAMID_FUNC_SET_FLOOR_PALETTE
|
||||
special CallBattlePyramidFunction
|
||||
.endm
|
||||
|
||||
@ Reset sketched moves and update the party order in the saveblock
|
||||
.macro pyramid_resetparty
|
||||
setvar VAR_0x8004, BATTLE_PYRAMID_FUNC_RESTORE_PARTY
|
||||
special CallBattlePyramidFunction
|
||||
.endm
|
91
asm/macros/battle_frontier/battle_tower.inc
Normal file
91
asm/macros/battle_frontier/battle_tower.inc
Normal file
@ -0,0 +1,91 @@
|
||||
@ Initialize the Battle Tower challenge
|
||||
.macro tower_init
|
||||
setvar VAR_0x8004, BATTLE_TOWER_FUNC_INIT
|
||||
special CallBattleTowerFunc
|
||||
.endm
|
||||
|
||||
@ Get the value of some TOWER_DATA_*. See GetTowerData for the data types that can be retrieved
|
||||
.macro tower_get data:req
|
||||
setvar VAR_0x8004, BATTLE_TOWER_FUNC_GET_DATA
|
||||
setvar VAR_0x8005, \data
|
||||
special CallBattleTowerFunc
|
||||
.endm
|
||||
|
||||
@ Set some TOWER_DATA_* to val. See SetTowerData for the data types that can be set
|
||||
.macro tower_set data:req, val=0xFFFF
|
||||
setvar VAR_0x8004, BATTLE_TOWER_FUNC_SET_DATA
|
||||
setvar VAR_0x8005, \data
|
||||
.if \val != 0xFFFF
|
||||
setvar VAR_0x8006, \val
|
||||
.endif
|
||||
special CallBattleTowerFunc
|
||||
.endm
|
||||
|
||||
@ Choose and set the gfx for the next opponent. Also used by Battle Tents
|
||||
.macro tower_setopponent
|
||||
setvar VAR_0x8004, BATTLE_TOWER_FUNC_SET_OPPONENT
|
||||
special CallBattleTowerFunc
|
||||
.endm
|
||||
|
||||
@ Increments the battle number and returns the new one. Also clears E-Reader trainer if defeated, and saves the current win streak
|
||||
.macro tower_setbattlewon
|
||||
setvar VAR_0x8004, BATTLE_TOWER_FUNC_SET_BATTLE_WON
|
||||
special CallBattleTowerFunc
|
||||
.endm
|
||||
|
||||
@ Try to award ribbons for completing 56th straight Battle Tower win. VAR_RESULT is TRUE if ribbons were awarded.
|
||||
.macro tower_giveribbons
|
||||
setvar VAR_0x8004, BATTLE_TOWER_FUNC_GIVE_RIBBONS
|
||||
special CallBattleTowerFunc
|
||||
.endm
|
||||
|
||||
@ Save the game and set the challenge status
|
||||
.macro tower_save challengeStatus:req
|
||||
setvar VAR_0x8004, BATTLE_TOWER_FUNC_SAVE
|
||||
setvar VAR_0x8005, \challengeStatus
|
||||
special CallBattleTowerFunc
|
||||
.endm
|
||||
|
||||
@ Buffer the opponent's easy chat intro speech to STR_VAR_4
|
||||
.macro tower_getopponentintro opponent:req
|
||||
setvar VAR_0x8004, BATTLE_TOWER_FUNC_GET_OPPONENT_INTRO
|
||||
setvar VAR_0x8005, \opponent
|
||||
special CallBattleTowerFunc
|
||||
.endm
|
||||
|
||||
@ Load the parties, gfx, and other data (like Apprentice id) for the multi partner candidates
|
||||
.macro tower_loadpartners
|
||||
setvar VAR_0x8004, BATTLE_TOWER_FUNC_LOAD_PARTNERS
|
||||
special CallBattleTowerFunc
|
||||
.endm
|
||||
|
||||
@ Print message from potential multi partner. msgId is any PARTNER_MSGID_*
|
||||
.macro tower_dopartnermsg msgId:req
|
||||
setvar VAR_0x8004, BATTLE_TOWER_FUNC_PARTNER_MSG
|
||||
setvar VAR_0x8005, \msgId
|
||||
special CallBattleTowerFunc
|
||||
.endm
|
||||
|
||||
@ Receives/loads the opponent data for a link multi challenge. Returns 6 when finished, and finishes immediately if not doing a link multi battle.
|
||||
.macro tower_loadlinkopponents
|
||||
setvar VAR_0x8004, BATTLE_TOWER_FUNC_LOAD_LINK_OPPONENTS
|
||||
special CallBattleTowerFunc
|
||||
.endm
|
||||
|
||||
@ Attempts to close link connection. Used when finishing a link multi challenge.
|
||||
.macro tower_closelink
|
||||
setvar VAR_0x8004, BATTLE_TOWER_FUNC_TRY_CLOSE_LINK
|
||||
special CallBattleTowerFunc
|
||||
.endm
|
||||
|
||||
@ Set VAR_OBJ_GFX_ID_E to the gfx id of the selected multi partner
|
||||
.macro tower_setpartnergfx
|
||||
setvar VAR_0x8004, BATTLE_TOWER_FUNC_SET_PARTNER_GFX
|
||||
special CallBattleTowerFunc
|
||||
.endm
|
||||
|
||||
@ Set the data used for the post-challenge Battle Tower interview
|
||||
.macro tower_setinterviewdata
|
||||
setvar VAR_0x8004, BATTLE_TOWER_FUNC_SET_INTERVIEW_DATA
|
||||
special CallBattleTowerFunc
|
||||
.endm
|
159
asm/macros/battle_frontier/frontier_util.inc
Normal file
159
asm/macros/battle_frontier/frontier_util.inc
Normal file
@ -0,0 +1,159 @@
|
||||
@ Get the status (CHALLENGE_STATUS_*) of the current challenge and store the result in VAR_TEMP_0
|
||||
.macro frontier_getstatus
|
||||
setvar VAR_0x8004, FRONTIER_UTIL_FUNC_GET_STATUS
|
||||
special CallFrontierUtilFunc
|
||||
.endm
|
||||
|
||||
@ Get the value of some FRONTIER_DATA_*. See GetFrontierData for the data types that can be retrieved
|
||||
.macro frontier_get data:req
|
||||
setvar VAR_0x8004, FRONTIER_UTIL_FUNC_GET_DATA
|
||||
setvar VAR_0x8005, \data
|
||||
special CallFrontierUtilFunc
|
||||
.endm
|
||||
|
||||
@ Set the value of some FRONTIER_DATA_*. Some data types do not need a val argument because the value is set directly from somewhere else. See SetFrontierData for the data types that can be set
|
||||
.macro frontier_set data:req, val=0xFFFF
|
||||
setvar VAR_0x8004, FRONTIER_UTIL_FUNC_SET_DATA
|
||||
setvar VAR_0x8005, \data
|
||||
.if \val == 0xFFFF
|
||||
@ no value provided
|
||||
.elseif \val >= VARS_START
|
||||
copyvar VAR_0x8006, \val
|
||||
.else
|
||||
setvar VAR_0x8006, \val
|
||||
.endif
|
||||
special CallFrontierUtilFunc
|
||||
.endm
|
||||
|
||||
@ Load the selected mons into gSelectedOrderFromParty and reduce the players party to these mons
|
||||
.macro frontier_setpartyorder partySize:req
|
||||
setvar VAR_0x8004, FRONTIER_UTIL_FUNC_SET_PARTY_ORDER
|
||||
setvar VAR_0x8005, \partySize
|
||||
special CallFrontierUtilFunc
|
||||
.endm
|
||||
|
||||
@ Performs a soft reset
|
||||
.macro frontier_reset
|
||||
setvar VAR_0x8004, FRONTIER_UTIL_FUNC_SOFT_RESET
|
||||
special CallFrontierUtilFunc
|
||||
.endm
|
||||
|
||||
@ Loads gBattleFrontierTrainers into gFacilityTrainers
|
||||
.macro frontier_settrainers
|
||||
setvar VAR_0x8004, FRONTIER_UTIL_FUNC_SET_TRAINERS
|
||||
special CallFrontierUtilFunc
|
||||
.endm
|
||||
|
||||
@ Sets the selected party mons in the saveblock
|
||||
.macro frontier_saveparty
|
||||
setvar VAR_0x8004, FRONTIER_UTIL_FUNC_SAVE_PARTY
|
||||
special CallFrontierUtilFunc
|
||||
.endm
|
||||
|
||||
@ Shows the results window for the given facility and mode. Facilities with only 1 mode dont provide the mode argument
|
||||
.macro frontier_results facility:req, mode=0xFF
|
||||
setvar VAR_0x8004, FRONTIER_UTIL_FUNC_RESULTS_WINDOW
|
||||
setvar VAR_0x8005, \facility
|
||||
.if \mode != 0xFF
|
||||
setvar VAR_0x8006, \mode
|
||||
.endif
|
||||
special CallFrontierUtilFunc
|
||||
.endm
|
||||
|
||||
@ Checks if the Battle Frontier TV special should air, and if so attempts to set it up
|
||||
.macro frontier_checkairshow
|
||||
setvar VAR_0x8004, FRONTIER_UTIL_FUNC_CHECK_AIR_TV_SHOW
|
||||
special CallFrontierUtilFunc
|
||||
.endm
|
||||
|
||||
@ Get the status of the Frontier Brain (Not ready, Silver/Gold streak before symbols, Silver/Gold streak after symbols)
|
||||
.macro frontier_getbrainstatus
|
||||
setvar VAR_0x8004, FRONTIER_UTIL_FUNC_GET_BRAIN_STATUS
|
||||
special CallFrontierUtilFunc
|
||||
.endm
|
||||
|
||||
@ TRUE if the opponent is a Frontier Brain, FALSE otherwise
|
||||
.macro frontier_isbrain
|
||||
setvar VAR_0x8004, FRONTIER_UTIL_FUNC_IS_BRAIN
|
||||
special CallFrontierUtilFunc
|
||||
.endm
|
||||
|
||||
@ Awards battle points depending on the current challenge
|
||||
.macro frontier_givepoints
|
||||
setvar VAR_0x8004, FRONTIER_UTIL_FUNC_GIVE_BATTLE_POINTS
|
||||
special CallFrontierUtilFunc
|
||||
.endm
|
||||
|
||||
@ Returns 0-2 for the number of facility symbols the player has
|
||||
.macro frontier_getsymbols
|
||||
setvar VAR_0x8004, FRONTIER_UTIL_FUNC_GET_FACILITY_SYMBOLS
|
||||
special CallFrontierUtilFunc
|
||||
.endm
|
||||
|
||||
@ Awards a frontier symbol depending on the current challenge
|
||||
.macro frontier_givesymbol
|
||||
setvar VAR_0x8004, FRONTIER_UTIL_FUNC_GIVE_FACILITY_SYMBOL
|
||||
special CallFrontierUtilFunc
|
||||
.endm
|
||||
|
||||
@ TRUE if the given battleType is set in gBattleTypeFlags, FALSE otherwise
|
||||
.macro frontier_isbattletype battleType:req
|
||||
setvar VAR_0x8004, FRONTIER_UTIL_FUNC_CHECK_BATTLE_TYPE
|
||||
setvar VAR_0x8005, \battleType
|
||||
special CallFrontierUtilFunc
|
||||
.endm
|
||||
|
||||
@ TRUE if there are insufficient eligible party mons to participate in the challenge, and buffers caught ineligible species to STR_VAR_1. FALSE otherwise. The return value is stored in VAR_0x8004 instead, and the current level mode is expected to be in VAR_RESULT
|
||||
.macro frontier_checkineligible
|
||||
setvar VAR_0x8004, FRONTIER_UTIL_FUNC_CHECK_INELIGIBLE
|
||||
special CallFrontierUtilFunc
|
||||
.endm
|
||||
|
||||
@ Validates the visiting E-Reader trainer. 0 if valid, 1 if not
|
||||
.macro frontier_checkvisittrainer
|
||||
setvar VAR_0x8004, FRONTIER_UTIL_FUNC_CHECK_VISIT_TRAINER
|
||||
special CallFrontierUtilFunc
|
||||
.endm
|
||||
|
||||
@ Increments the current win streak by 1
|
||||
.macro frontier_incrementstreak
|
||||
setvar VAR_0x8004, FRONTIER_UTIL_FUNC_INCREMENT_STREAK
|
||||
special CallFrontierUtilFunc
|
||||
.endm
|
||||
|
||||
@ Resets the party held items to what they were upon entering the challenge
|
||||
.macro frontier_restorehelditems
|
||||
setvar VAR_0x8004, FRONTIER_UTIL_FUNC_RESTORE_HELD_ITEMS
|
||||
special CallFrontierUtilFunc
|
||||
.endm
|
||||
|
||||
@ Move the recorded battle to save data
|
||||
.macro frontier_savebattle
|
||||
setvar VAR_0x8004, FRONTIER_UTIL_FUNC_SAVE_BATTLE
|
||||
special CallFrontierUtilFunc
|
||||
.endm
|
||||
|
||||
@ Buffer the name of gTrainerBattleOpponent_A in STR_VAR_1 (0) or STR_VAR_2 (1)
|
||||
.macro frontier_gettrainername stringVar:req
|
||||
setvar VAR_0x8004, FRONTIER_UTIL_FUNC_BUFFER_TRAINER_NAME
|
||||
.if \stringVar == STR_VAR_1
|
||||
setvar VAR_0x8005, 0
|
||||
.elseif \stringVar == STR_VAR_2
|
||||
setvar VAR_0x8005, 1
|
||||
.else
|
||||
setvar VAR_0x8005, \stringVar
|
||||
.endif
|
||||
special CallFrontierUtilFunc
|
||||
.endm
|
||||
|
||||
@ If any moves were copied using Sketch during the challenge then restore them to Sketch
|
||||
.macro frontier_resetsketch
|
||||
setvar VAR_0x8004, FRONTIER_UTIL_FUNC_RESET_SKETCH_MOVES
|
||||
special CallFrontierUtilFunc
|
||||
.endm
|
||||
|
||||
@ Set the object event gfx of the Frontier Brain for the current facility
|
||||
.macro frontier_setbrainobj
|
||||
setvar VAR_0x8004, FRONTIER_UTIL_FUNC_SET_BRAIN_OBJECT
|
||||
special CallFrontierUtilFunc
|
||||
.endm
|
1440
asm/macros/battle_script.inc
Normal file
1440
asm/macros/battle_script.inc
Normal file
@ -0,0 +1,1440 @@
|
||||
@ commands
|
||||
.macro attackcanceler
|
||||
.byte 0x0
|
||||
.endm
|
||||
|
||||
.macro accuracycheck failPtr:req, move:req
|
||||
.byte 0x1
|
||||
.4byte \failPtr
|
||||
.2byte \move
|
||||
.endm
|
||||
|
||||
.macro attackstring
|
||||
.byte 0x2
|
||||
.endm
|
||||
|
||||
.macro ppreduce
|
||||
.byte 0x3
|
||||
.endm
|
||||
|
||||
.macro critcalc
|
||||
.byte 0x4
|
||||
.endm
|
||||
|
||||
.macro damagecalc
|
||||
.byte 0x5
|
||||
.endm
|
||||
|
||||
.macro typecalc
|
||||
.byte 0x6
|
||||
.endm
|
||||
|
||||
.macro adjustnormaldamage
|
||||
.byte 0x7
|
||||
.endm
|
||||
|
||||
.macro adjustnormaldamage2
|
||||
.byte 0x8
|
||||
.endm
|
||||
|
||||
.macro attackanimation
|
||||
.byte 0x9
|
||||
.endm
|
||||
|
||||
.macro waitanimation
|
||||
.byte 0xa
|
||||
.endm
|
||||
|
||||
.macro healthbarupdate battler:req
|
||||
.byte 0xb
|
||||
.byte \battler
|
||||
.endm
|
||||
|
||||
.macro datahpupdate battler:req
|
||||
.byte 0xc
|
||||
.byte \battler
|
||||
.endm
|
||||
|
||||
.macro critmessage
|
||||
.byte 0xd
|
||||
.endm
|
||||
|
||||
.macro effectivenesssound
|
||||
.byte 0xe
|
||||
.endm
|
||||
|
||||
.macro resultmessage
|
||||
.byte 0xf
|
||||
.endm
|
||||
|
||||
.macro printstring id:req
|
||||
.byte 0x10
|
||||
.2byte \id
|
||||
.endm
|
||||
|
||||
.macro printselectionstring id:req
|
||||
.byte 0x11
|
||||
.2byte \id
|
||||
.endm
|
||||
|
||||
.macro waitmessage time:req
|
||||
.byte 0x12
|
||||
.2byte \time
|
||||
.endm
|
||||
|
||||
.macro printfromtable ptr:req
|
||||
.byte 0x13
|
||||
.4byte \ptr
|
||||
.endm
|
||||
|
||||
.macro printselectionstringfromtable ptr:req
|
||||
.byte 0x14
|
||||
.4byte \ptr
|
||||
.endm
|
||||
|
||||
.macro seteffectwithchance
|
||||
.byte 0x15
|
||||
.endm
|
||||
|
||||
.macro seteffectprimary
|
||||
.byte 0x16
|
||||
.endm
|
||||
|
||||
.macro seteffectsecondary
|
||||
.byte 0x17
|
||||
.endm
|
||||
|
||||
.macro clearstatusfromeffect battler:req
|
||||
.byte 0x18
|
||||
.byte \battler
|
||||
.endm
|
||||
|
||||
.macro tryfaintmon battler:req
|
||||
.byte 0x19
|
||||
.byte \battler
|
||||
.byte FALSE
|
||||
.4byte NULL
|
||||
.endm
|
||||
|
||||
.macro tryfaintmon_spikes battler:req, ptr:req
|
||||
.byte 0x19
|
||||
.byte \battler
|
||||
.byte TRUE
|
||||
.4byte \ptr
|
||||
.endm
|
||||
|
||||
.macro dofaintanimation battler:req
|
||||
.byte 0x1a
|
||||
.byte \battler
|
||||
.endm
|
||||
|
||||
.macro cleareffectsonfaint battler:req
|
||||
.byte 0x1b
|
||||
.byte \battler
|
||||
.endm
|
||||
|
||||
.macro jumpifstatus battler:req, status1:req, ptr:req
|
||||
.byte 0x1c
|
||||
.byte \battler
|
||||
.4byte \status1
|
||||
.4byte \ptr
|
||||
.endm
|
||||
|
||||
.macro jumpifstatus2 battler:req, status2:req, ptr:req
|
||||
.byte 0x1d
|
||||
.byte \battler
|
||||
.4byte \status2
|
||||
.4byte \ptr
|
||||
.endm
|
||||
|
||||
.macro jumpifability battler:req, ability:req, ptr:req
|
||||
.byte 0x1e
|
||||
.byte \battler
|
||||
.byte \ability
|
||||
.4byte \ptr
|
||||
.endm
|
||||
|
||||
.macro jumpifsideaffecting battler:req, sidestatus:req, ptr:req
|
||||
.byte 0x1f
|
||||
.byte \battler
|
||||
.2byte \sidestatus
|
||||
.4byte \ptr
|
||||
.endm
|
||||
|
||||
.macro jumpifstat battler:req, ifflag:req, stat:req, value:req, ptr
|
||||
.byte 0x20
|
||||
.byte \battler
|
||||
.byte \ifflag
|
||||
.byte \stat
|
||||
.byte \value
|
||||
.4byte \ptr
|
||||
.endm
|
||||
|
||||
.macro jumpifstatus3condition battler:req, status3:req, condition:req, ptr:req
|
||||
.byte 0x21
|
||||
.byte \battler
|
||||
.4byte \status3
|
||||
.byte \condition
|
||||
.4byte \ptr
|
||||
.endm
|
||||
|
||||
.macro jumpiftype battler:req, type:req, ptr:req
|
||||
.byte 0x22
|
||||
.byte \battler
|
||||
.byte \type
|
||||
.4byte \ptr
|
||||
.endm
|
||||
|
||||
.macro getexp battler:req
|
||||
.byte 0x23
|
||||
.byte \battler
|
||||
.endm
|
||||
|
||||
.macro checkteamslost ptr:req
|
||||
.byte 0x24
|
||||
.4byte \ptr
|
||||
.endm
|
||||
|
||||
.macro movevaluescleanup
|
||||
.byte 0x25
|
||||
.endm
|
||||
|
||||
.macro setmultihit value:req
|
||||
.byte 0x26
|
||||
.byte \value
|
||||
.endm
|
||||
|
||||
.macro decrementmultihit value:req
|
||||
.byte 0x27
|
||||
.4byte \value
|
||||
.endm
|
||||
|
||||
.macro goto ptr:req
|
||||
.byte 0x28
|
||||
.4byte \ptr
|
||||
.endm
|
||||
|
||||
.macro jumpifbyte ifflag:req, val:req, byte:req, ptr:req
|
||||
.byte 0x29
|
||||
.byte \ifflag
|
||||
.4byte \val
|
||||
.byte \byte
|
||||
.4byte \ptr
|
||||
.endm
|
||||
|
||||
.macro jumpifhalfword ifflag:req, val:req, hword:req, ptr:req
|
||||
.byte 0x2a
|
||||
.byte \ifflag
|
||||
.4byte \val
|
||||
.2byte \hword
|
||||
.4byte \ptr
|
||||
.endm
|
||||
|
||||
.macro jumpifword ifflag:req, val:req, word:req, ptr:req
|
||||
.byte 0x2b
|
||||
.byte \ifflag
|
||||
.4byte \val
|
||||
.4byte \word
|
||||
.4byte \ptr
|
||||
.endm
|
||||
|
||||
.macro jumpifarrayequal val1:req, val2:req, size:req, ptr:req
|
||||
.byte 0x2c
|
||||
.4byte \val1
|
||||
.4byte \val2
|
||||
.byte \size
|
||||
.4byte \ptr
|
||||
.endm
|
||||
|
||||
.macro jumpifarraynotequal val1:req, val2:req, size:req, ptr:req
|
||||
.byte 0x2d
|
||||
.4byte \val1
|
||||
.4byte \val2
|
||||
.byte \size
|
||||
.4byte \ptr
|
||||
.endm
|
||||
|
||||
.macro setbyte ptr:req, byte:req
|
||||
.byte 0x2e
|
||||
.4byte \ptr
|
||||
.byte \byte
|
||||
.endm
|
||||
|
||||
.macro addbyte ptr:req, byte:req
|
||||
.byte 0x2f
|
||||
.4byte \ptr
|
||||
.byte \byte
|
||||
.endm
|
||||
|
||||
.macro subbyte ptr:req, byte:req
|
||||
.byte 0x30
|
||||
.4byte \ptr
|
||||
.byte \byte
|
||||
.endm
|
||||
|
||||
.macro copyarray dest:req, src:req, size:req
|
||||
.byte 0x31
|
||||
.4byte \dest
|
||||
.4byte \src
|
||||
.byte \size
|
||||
.endm
|
||||
|
||||
.macro copyarraywithindex dest:req, src:req, index:req, size:req
|
||||
.byte 0x32
|
||||
.4byte \dest
|
||||
.4byte \src
|
||||
.4byte \index
|
||||
.byte \size
|
||||
.endm
|
||||
|
||||
.macro orbyte ptr:req, byte:req
|
||||
.byte 0x33
|
||||
.4byte \ptr
|
||||
.byte \byte
|
||||
.endm
|
||||
|
||||
.macro orhalfword ptr:req, hword:req
|
||||
.byte 0x34
|
||||
.4byte \ptr
|
||||
.2byte \hword
|
||||
.endm
|
||||
|
||||
.macro orword ptr:req, word:req
|
||||
.byte 0x35
|
||||
.4byte \ptr
|
||||
.4byte \word
|
||||
.endm
|
||||
|
||||
.macro bicbyte ptr:req, byte:req
|
||||
.byte 0x36
|
||||
.4byte \ptr
|
||||
.byte \byte
|
||||
.endm
|
||||
|
||||
.macro bichalfword ptr:req, hword:req
|
||||
.byte 0x37
|
||||
.4byte \ptr
|
||||
.2byte \hword
|
||||
.endm
|
||||
|
||||
.macro bicword ptr:req, word:req
|
||||
.byte 0x38
|
||||
.4byte \ptr
|
||||
.4byte \word
|
||||
.endm
|
||||
|
||||
.macro pause time:req
|
||||
.byte 0x39
|
||||
.2byte \time
|
||||
.endm
|
||||
|
||||
.macro waitstate
|
||||
.byte 0x3a
|
||||
.endm
|
||||
|
||||
.macro healthbar_update battler:req
|
||||
.byte 0x3b
|
||||
.byte \battler
|
||||
.endm
|
||||
|
||||
.macro return
|
||||
.byte 0x3c
|
||||
.endm
|
||||
|
||||
.macro end
|
||||
.byte 0x3d
|
||||
.endm
|
||||
|
||||
.macro end2
|
||||
.byte 0x3e
|
||||
.endm
|
||||
|
||||
.macro end3
|
||||
.byte 0x3f
|
||||
.endm
|
||||
|
||||
.macro jumpifaffectedbyprotect ptr:req
|
||||
.byte 0x40
|
||||
.4byte \ptr
|
||||
.endm
|
||||
|
||||
.macro call ptr:req
|
||||
.byte 0x41
|
||||
.4byte \ptr
|
||||
.endm
|
||||
|
||||
.macro jumpiftype2 battler:req, type:req, ptr:req
|
||||
.byte 0x42
|
||||
.byte \battler
|
||||
.byte \type
|
||||
.4byte \ptr
|
||||
.endm
|
||||
|
||||
.macro jumpifabilitypresent ability:req, ptr:req
|
||||
.byte 0x43
|
||||
.byte \ability
|
||||
.4byte \ptr
|
||||
.endm
|
||||
|
||||
.macro endselectionscript
|
||||
.byte 0x44
|
||||
.endm
|
||||
|
||||
.macro playanimation battler:req, animType:req, arg=NULL
|
||||
.byte 0x45
|
||||
.byte \battler
|
||||
.byte \animType
|
||||
.4byte \arg
|
||||
.endm
|
||||
|
||||
.macro playanimation_var battler:req, animType:req, arg=NULL
|
||||
.byte 0x46
|
||||
.byte \battler
|
||||
.4byte \animType
|
||||
.4byte \arg
|
||||
.endm
|
||||
|
||||
.macro setgraphicalstatchangevalues
|
||||
.byte 0x47
|
||||
.endm
|
||||
|
||||
.macro playstatchangeanimation battler:req, stats:req, statchange:req
|
||||
.byte 0x48
|
||||
.byte \battler
|
||||
.byte \stats
|
||||
.byte \statchange
|
||||
.endm
|
||||
|
||||
.macro moveend endMode:req, endState:req
|
||||
.byte 0x49
|
||||
.byte \endMode
|
||||
.byte \endState
|
||||
.endm
|
||||
|
||||
@ Help macros for 5 uses of moveend command
|
||||
|
||||
@ All cases
|
||||
.macro moveendall
|
||||
setbyte sMOVEEND_STATE, 0
|
||||
moveend 0, 0
|
||||
.endm
|
||||
|
||||
@ Chosen case
|
||||
.macro moveendcase case:req
|
||||
setbyte sMOVEEND_STATE, \case
|
||||
moveend 1, 0
|
||||
.endm
|
||||
|
||||
@ All cases from (inclusive)
|
||||
.macro moveendfrom from:req
|
||||
setbyte sMOVEEND_STATE, \from
|
||||
moveend 0, 0
|
||||
.endm
|
||||
|
||||
@ All cases from 0 to (not inclusive)
|
||||
.macro moveendto to:req
|
||||
setbyte sMOVEEND_STATE, 0
|
||||
moveend 2, \to
|
||||
.endm
|
||||
|
||||
@ Cases from (inclusive) to (not inclusive)
|
||||
.macro moveendfromto from:req, to:req
|
||||
setbyte sMOVEEND_STATE, \from
|
||||
moveend 2, \to
|
||||
.endm
|
||||
|
||||
.macro typecalc2
|
||||
.byte 0x4a
|
||||
.endm
|
||||
|
||||
.macro returnatktoball
|
||||
.byte 0x4b
|
||||
.endm
|
||||
|
||||
.macro getswitchedmondata battler:req
|
||||
.byte 0x4c
|
||||
.byte \battler
|
||||
.endm
|
||||
|
||||
.macro switchindataupdate battler:req
|
||||
.byte 0x4d
|
||||
.byte \battler
|
||||
.endm
|
||||
|
||||
.macro switchinanim battler:req, dontclearsubstitutebit:req
|
||||
.byte 0x4e
|
||||
.byte \battler
|
||||
.byte \dontclearsubstitutebit
|
||||
.endm
|
||||
|
||||
.macro jumpifcantswitch battler:req, ptr:req
|
||||
.byte 0x4f
|
||||
.byte \battler
|
||||
.4byte \ptr
|
||||
.endm
|
||||
|
||||
.macro openpartyscreen battler:req, ptr:req
|
||||
.byte 0x50
|
||||
.byte \battler
|
||||
.4byte \ptr
|
||||
.endm
|
||||
|
||||
.macro switchhandleorder battler:req, state:req
|
||||
.byte 0x51
|
||||
.byte \battler
|
||||
.byte \state
|
||||
.endm
|
||||
|
||||
.macro switchineffects battler:req
|
||||
.byte 0x52
|
||||
.byte \battler
|
||||
.endm
|
||||
|
||||
.macro trainerslidein battler:req
|
||||
.byte 0x53
|
||||
.byte \battler
|
||||
.endm
|
||||
|
||||
.macro playse song:req
|
||||
.byte 0x54
|
||||
.2byte \song
|
||||
.endm
|
||||
|
||||
.macro fanfare song:req
|
||||
.byte 0x55
|
||||
.2byte \song
|
||||
.endm
|
||||
|
||||
.macro playfaintcry battler:req
|
||||
.byte 0x56
|
||||
.byte \battler
|
||||
.endm
|
||||
|
||||
.macro endlinkbattle
|
||||
.byte 0x57
|
||||
.endm
|
||||
|
||||
.macro returntoball battler:req
|
||||
.byte 0x58
|
||||
.byte \battler
|
||||
.endm
|
||||
|
||||
.macro handlelearnnewmove learnedMovePtr:req, nothingToLearnPtr:req, isFirstMove:req
|
||||
.byte 0x59
|
||||
.4byte \learnedMovePtr
|
||||
.4byte \nothingToLearnPtr
|
||||
.byte \isFirstMove
|
||||
.endm
|
||||
|
||||
.macro yesnoboxlearnmove forgotMovePtr:req
|
||||
.byte 0x5a
|
||||
.4byte \forgotMovePtr
|
||||
.endm
|
||||
|
||||
.macro yesnoboxstoplearningmove noPtr:req
|
||||
.byte 0x5b
|
||||
.4byte \noPtr
|
||||
.endm
|
||||
|
||||
.macro hitanimation battler:req
|
||||
.byte 0x5c
|
||||
.byte \battler
|
||||
.endm
|
||||
|
||||
.macro getmoneyreward
|
||||
.byte 0x5d
|
||||
.endm
|
||||
|
||||
.macro updatebattlermoves battler:req
|
||||
.byte 0x5e
|
||||
.byte \battler
|
||||
.endm
|
||||
|
||||
.macro swapattackerwithtarget
|
||||
.byte 0x5f
|
||||
.endm
|
||||
|
||||
.macro incrementgamestat stat:req
|
||||
.byte 0x60
|
||||
.byte \stat
|
||||
.endm
|
||||
|
||||
.macro drawpartystatussummary battler:req
|
||||
.byte 0x61
|
||||
.byte \battler
|
||||
.endm
|
||||
|
||||
.macro hidepartystatussummary battler:req
|
||||
.byte 0x62
|
||||
.byte \battler
|
||||
.endm
|
||||
|
||||
.macro jumptocalledmove notChosenMove:req
|
||||
.byte 0x63
|
||||
.byte \notChosenMove
|
||||
.endm
|
||||
|
||||
.macro statusanimation battler:req
|
||||
.byte 0x64
|
||||
.byte \battler
|
||||
.endm
|
||||
|
||||
.macro status2animation battler:req, status2:req
|
||||
.byte 0x65
|
||||
.byte \battler
|
||||
.4byte \status2
|
||||
.endm
|
||||
|
||||
.macro chosenstatusanimation battler:req, isStatus2:req, status:req
|
||||
.byte 0x66
|
||||
.byte \battler
|
||||
.byte \isStatus2
|
||||
.4byte \status
|
||||
.endm
|
||||
|
||||
.macro yesnobox
|
||||
.byte 0x67
|
||||
.endm
|
||||
|
||||
.macro cancelallactions
|
||||
.byte 0x68
|
||||
.endm
|
||||
|
||||
.macro adjustsetdamage
|
||||
.byte 0x69
|
||||
.endm
|
||||
|
||||
.macro removeitem battler:req
|
||||
.byte 0x6a
|
||||
.byte \battler
|
||||
.endm
|
||||
|
||||
.macro atknameinbuff1
|
||||
.byte 0x6b
|
||||
.endm
|
||||
|
||||
.macro drawlvlupbox
|
||||
.byte 0x6c
|
||||
.endm
|
||||
|
||||
.macro resetsentmonsvalue
|
||||
.byte 0x6d
|
||||
.endm
|
||||
|
||||
.macro setatktoplayer0
|
||||
.byte 0x6e
|
||||
.endm
|
||||
|
||||
.macro makevisible battler:req
|
||||
.byte 0x6f
|
||||
.byte \battler
|
||||
.endm
|
||||
|
||||
.macro recordlastability battler:req
|
||||
.byte 0x70
|
||||
.byte \battler
|
||||
.endm
|
||||
|
||||
.macro buffermovetolearn
|
||||
.byte 0x71
|
||||
.endm
|
||||
|
||||
.macro jumpifplayerran ptr:req
|
||||
.byte 0x72
|
||||
.4byte \ptr
|
||||
.endm
|
||||
|
||||
.macro hpthresholds battler:req
|
||||
.byte 0x73
|
||||
.byte \battler
|
||||
.endm
|
||||
|
||||
.macro hpthresholds2 battler:req
|
||||
.byte 0x74
|
||||
.byte \battler
|
||||
.endm
|
||||
|
||||
.macro useitemonopponent
|
||||
.byte 0x75
|
||||
.endm
|
||||
|
||||
.macro various battler:req, id:req
|
||||
.byte 0x76
|
||||
.byte \battler
|
||||
.byte \id
|
||||
.endm
|
||||
|
||||
.macro setprotectlike
|
||||
.byte 0x77
|
||||
.endm
|
||||
|
||||
.macro faintifabilitynotdamp
|
||||
.byte 0x78
|
||||
.endm
|
||||
|
||||
.macro setatkhptozero
|
||||
.byte 0x79
|
||||
.endm
|
||||
|
||||
.macro jumpifnexttargetvalid ptr:req
|
||||
.byte 0x7a
|
||||
.4byte \ptr
|
||||
.endm
|
||||
|
||||
.macro tryhealhalfhealth ptr:req, battler:req
|
||||
.byte 0x7b
|
||||
.4byte \ptr
|
||||
.byte \battler
|
||||
.endm
|
||||
|
||||
.macro trymirrormove
|
||||
.byte 0x7c
|
||||
.endm
|
||||
|
||||
.macro setrain
|
||||
.byte 0x7d
|
||||
.endm
|
||||
|
||||
.macro setreflect
|
||||
.byte 0x7e
|
||||
.endm
|
||||
|
||||
.macro setseeded
|
||||
.byte 0x7f
|
||||
.endm
|
||||
|
||||
.macro manipulatedamage mode:req
|
||||
.byte 0x80
|
||||
.byte \mode
|
||||
.endm
|
||||
|
||||
.macro trysetrest ptr:req
|
||||
.byte 0x81
|
||||
.4byte \ptr
|
||||
.endm
|
||||
|
||||
.macro jumpifnotfirstturn ptr:req
|
||||
.byte 0x82
|
||||
.4byte \ptr
|
||||
.endm
|
||||
|
||||
.macro nop
|
||||
.byte 0x83
|
||||
.endm
|
||||
|
||||
.macro jumpifcantmakeasleep ptr:req
|
||||
.byte 0x84
|
||||
.4byte \ptr
|
||||
.endm
|
||||
|
||||
.macro stockpile
|
||||
.byte 0x85
|
||||
.endm
|
||||
|
||||
.macro stockpiletobasedamage ptr:req
|
||||
.byte 0x86
|
||||
.4byte \ptr
|
||||
.endm
|
||||
|
||||
.macro stockpiletohpheal ptr:req
|
||||
.byte 0x87
|
||||
.4byte \ptr
|
||||
.endm
|
||||
|
||||
.macro negativedamage
|
||||
.byte 0x88
|
||||
.endm
|
||||
|
||||
.macro statbuffchange flags:req, jumpptr:req
|
||||
.byte 0x89
|
||||
.byte \flags
|
||||
.4byte \jumpptr
|
||||
.endm
|
||||
|
||||
.macro normalisebuffs
|
||||
.byte 0x8a
|
||||
.endm
|
||||
|
||||
.macro setbide
|
||||
.byte 0x8b
|
||||
.endm
|
||||
|
||||
.macro confuseifrepeatingattackends
|
||||
.byte 0x8c
|
||||
.endm
|
||||
|
||||
.macro setmultihitcounter val:req
|
||||
.byte 0x8d
|
||||
.byte \val
|
||||
.endm
|
||||
|
||||
.macro initmultihitstring
|
||||
.byte 0x8e
|
||||
.endm
|
||||
|
||||
.macro forcerandomswitch ptr:req
|
||||
.byte 0x8f
|
||||
.4byte \ptr
|
||||
.endm
|
||||
|
||||
.macro tryconversiontypechange ptr:req
|
||||
.byte 0x90
|
||||
.4byte \ptr
|
||||
.endm
|
||||
|
||||
.macro givepaydaymoney
|
||||
.byte 0x91
|
||||
.endm
|
||||
|
||||
.macro setlightscreen
|
||||
.byte 0x92
|
||||
.endm
|
||||
|
||||
.macro tryKO ptr:req
|
||||
.byte 0x93
|
||||
.4byte \ptr
|
||||
.endm
|
||||
|
||||
.macro damagetohalftargethp
|
||||
.byte 0x94
|
||||
.endm
|
||||
|
||||
.macro setsandstorm
|
||||
.byte 0x95
|
||||
.endm
|
||||
|
||||
.macro weatherdamage
|
||||
.byte 0x96
|
||||
.endm
|
||||
|
||||
.macro tryinfatuating ptr:req
|
||||
.byte 0x97
|
||||
.4byte \ptr
|
||||
.endm
|
||||
|
||||
.macro updatestatusicon battler:req
|
||||
.byte 0x98
|
||||
.byte \battler
|
||||
.endm
|
||||
|
||||
.macro setmist
|
||||
.byte 0x99
|
||||
.endm
|
||||
|
||||
.macro setfocusenergy
|
||||
.byte 0x9a
|
||||
.endm
|
||||
|
||||
.macro transformdataexecution
|
||||
.byte 0x9b
|
||||
.endm
|
||||
|
||||
.macro setsubstitute
|
||||
.byte 0x9c
|
||||
.endm
|
||||
|
||||
.macro mimicattackcopy ptr:req
|
||||
.byte 0x9d
|
||||
.4byte \ptr
|
||||
.endm
|
||||
|
||||
.macro metronome
|
||||
.byte 0x9e
|
||||
.endm
|
||||
|
||||
.macro dmgtolevel
|
||||
.byte 0x9f
|
||||
.endm
|
||||
|
||||
.macro psywavedamageeffect
|
||||
.byte 0xa0
|
||||
.endm
|
||||
|
||||
.macro counterdamagecalculator ptr:req
|
||||
.byte 0xa1
|
||||
.4byte \ptr
|
||||
.endm
|
||||
|
||||
.macro mirrorcoatdamagecalculator ptr:req
|
||||
.byte 0xa2
|
||||
.4byte \ptr
|
||||
.endm
|
||||
|
||||
.macro disablelastusedattack ptr:req
|
||||
.byte 0xa3
|
||||
.4byte \ptr
|
||||
.endm
|
||||
|
||||
.macro trysetencore ptr:req
|
||||
.byte 0xa4
|
||||
.4byte \ptr
|
||||
.endm
|
||||
|
||||
.macro painsplitdmgcalc ptr:req
|
||||
.byte 0xa5
|
||||
.4byte \ptr
|
||||
.endm
|
||||
|
||||
.macro settypetorandomresistance ptr:req
|
||||
.byte 0xa6
|
||||
.4byte \ptr
|
||||
.endm
|
||||
|
||||
.macro setalwayshitflag
|
||||
.byte 0xa7
|
||||
.endm
|
||||
|
||||
.macro copymovepermanently ptr:req
|
||||
.byte 0xa8
|
||||
.4byte \ptr
|
||||
.endm
|
||||
|
||||
.macro trychoosesleeptalkmove ptr:req
|
||||
.byte 0xa9
|
||||
.4byte \ptr
|
||||
.endm
|
||||
|
||||
.macro setdestinybond
|
||||
.byte 0xaa
|
||||
.endm
|
||||
|
||||
.macro trysetdestinybondtohappen
|
||||
.byte 0xab
|
||||
.endm
|
||||
|
||||
.macro remaininghptopower
|
||||
.byte 0xac
|
||||
.endm
|
||||
|
||||
.macro tryspiteppreduce ptr:req
|
||||
.byte 0xad
|
||||
.4byte \ptr
|
||||
.endm
|
||||
|
||||
.macro healpartystatus
|
||||
.byte 0xae
|
||||
.endm
|
||||
|
||||
.macro cursetarget ptr:req
|
||||
.byte 0xaf
|
||||
.4byte \ptr
|
||||
.endm
|
||||
|
||||
.macro trysetspikes ptr:req
|
||||
.byte 0xb0
|
||||
.4byte \ptr
|
||||
.endm
|
||||
|
||||
.macro setforesight
|
||||
.byte 0xb1
|
||||
.endm
|
||||
|
||||
.macro trysetperishsong ptr:req
|
||||
.byte 0xb2
|
||||
.4byte \ptr
|
||||
.endm
|
||||
|
||||
.macro rolloutdamagecalculation
|
||||
.byte 0xb3
|
||||
.endm
|
||||
|
||||
.macro jumpifconfusedandstatmaxed stat:req, ptr:req
|
||||
.byte 0xb4
|
||||
.byte \stat
|
||||
.4byte \ptr
|
||||
.endm
|
||||
|
||||
.macro furycuttercalc
|
||||
.byte 0xb5
|
||||
.endm
|
||||
|
||||
.macro friendshiptodamagecalculation
|
||||
.byte 0xb6
|
||||
.endm
|
||||
|
||||
.macro presentdamagecalculation
|
||||
.byte 0xb7
|
||||
.endm
|
||||
|
||||
.macro setsafeguard
|
||||
.byte 0xb8
|
||||
.endm
|
||||
|
||||
.macro magnitudedamagecalculation
|
||||
.byte 0xb9
|
||||
.endm
|
||||
|
||||
.macro jumpifnopursuitswitchdmg ptr:req
|
||||
.byte 0xba
|
||||
.4byte \ptr
|
||||
.endm
|
||||
|
||||
.macro setsunny
|
||||
.byte 0xbb
|
||||
.endm
|
||||
|
||||
.macro maxattackhalvehp ptr:req
|
||||
.byte 0xbc
|
||||
.4byte \ptr
|
||||
.endm
|
||||
|
||||
.macro copyfoestats ptr:req
|
||||
.byte 0xbd
|
||||
.4byte \ptr
|
||||
.endm
|
||||
|
||||
.macro rapidspinfree
|
||||
.byte 0xbe
|
||||
.endm
|
||||
|
||||
.macro setdefensecurlbit
|
||||
.byte 0xbf
|
||||
.endm
|
||||
|
||||
.macro recoverbasedonsunlight ptr:req
|
||||
.byte 0xc0
|
||||
.4byte \ptr
|
||||
.endm
|
||||
|
||||
.macro hiddenpowercalc
|
||||
.byte 0xc1
|
||||
.endm
|
||||
|
||||
.macro selectfirstvalidtarget
|
||||
.byte 0xc2
|
||||
.endm
|
||||
|
||||
.macro trysetfutureattack ptr:req
|
||||
.byte 0xc3
|
||||
.4byte \ptr
|
||||
.endm
|
||||
|
||||
.macro trydobeatup endPtr:req, failPtr:req
|
||||
.byte 0xc4
|
||||
.4byte \endPtr
|
||||
.4byte \failPtr
|
||||
.endm
|
||||
|
||||
.macro setsemiinvulnerablebit
|
||||
.byte 0xc5
|
||||
.endm
|
||||
|
||||
.macro clearsemiinvulnerablebit
|
||||
.byte 0xc6
|
||||
.endm
|
||||
|
||||
.macro setminimize
|
||||
.byte 0xc7
|
||||
.endm
|
||||
|
||||
.macro sethail
|
||||
.byte 0xc8
|
||||
.endm
|
||||
|
||||
.macro jumpifattackandspecialattackcannotfall ptr:req
|
||||
.byte 0xc9
|
||||
.4byte \ptr
|
||||
.endm
|
||||
|
||||
.macro setforcedtarget
|
||||
.byte 0xca
|
||||
.endm
|
||||
|
||||
.macro setcharge
|
||||
.byte 0xcb
|
||||
.endm
|
||||
|
||||
.macro callterrainattack
|
||||
.byte 0xcc
|
||||
.endm
|
||||
|
||||
.macro cureifburnedparalysedorpoisoned ptr:req
|
||||
.byte 0xcd
|
||||
.4byte \ptr
|
||||
.endm
|
||||
|
||||
.macro settorment ptr:req
|
||||
.byte 0xce
|
||||
.4byte \ptr
|
||||
.endm
|
||||
|
||||
.macro jumpifnodamage ptr:req
|
||||
.byte 0xcf
|
||||
.4byte \ptr
|
||||
.endm
|
||||
|
||||
.macro settaunt ptr:req
|
||||
.byte 0xd0
|
||||
.4byte \ptr
|
||||
.endm
|
||||
|
||||
.macro trysethelpinghand ptr:req
|
||||
.byte 0xd1
|
||||
.4byte \ptr
|
||||
.endm
|
||||
|
||||
.macro tryswapitems ptr:req
|
||||
.byte 0xd2
|
||||
.4byte \ptr
|
||||
.endm
|
||||
|
||||
.macro trycopyability ptr:req
|
||||
.byte 0xd3
|
||||
.4byte \ptr
|
||||
.endm
|
||||
|
||||
.macro trywish turnNumber:req, ptr:req
|
||||
.byte 0xd4
|
||||
.byte \turnNumber
|
||||
.4byte \ptr
|
||||
.endm
|
||||
|
||||
.macro trysetroots ptr:req
|
||||
.byte 0xd5
|
||||
.4byte \ptr
|
||||
.endm
|
||||
|
||||
.macro doubledamagedealtifdamaged
|
||||
.byte 0xd6
|
||||
.endm
|
||||
|
||||
.macro setyawn ptr:req
|
||||
.byte 0xd7
|
||||
.4byte \ptr
|
||||
.endm
|
||||
|
||||
.macro setdamagetohealthdifference ptr:req
|
||||
.byte 0xd8
|
||||
.4byte \ptr
|
||||
.endm
|
||||
|
||||
.macro scaledamagebyhealthratio
|
||||
.byte 0xd9
|
||||
.endm
|
||||
|
||||
.macro tryswapabilities ptr:req
|
||||
.byte 0xda
|
||||
.4byte \ptr
|
||||
.endm
|
||||
|
||||
.macro tryimprison ptr:req
|
||||
.byte 0xdb
|
||||
.4byte \ptr
|
||||
.endm
|
||||
|
||||
.macro trysetgrudge ptr:req
|
||||
.byte 0xdc
|
||||
.4byte \ptr
|
||||
.endm
|
||||
|
||||
.macro weightdamagecalculation
|
||||
.byte 0xdd
|
||||
.endm
|
||||
|
||||
.macro assistattackselect ptr:req
|
||||
.byte 0xde
|
||||
.4byte \ptr
|
||||
.endm
|
||||
|
||||
.macro trysetmagiccoat ptr:req
|
||||
.byte 0xdf
|
||||
.4byte \ptr
|
||||
.endm
|
||||
|
||||
.macro trysetsnatch ptr:req
|
||||
.byte 0xe0
|
||||
.4byte \ptr
|
||||
.endm
|
||||
|
||||
.macro trygetintimidatetarget ptr:req
|
||||
.byte 0xe1
|
||||
.4byte \ptr
|
||||
.endm
|
||||
|
||||
.macro switchoutabilities battler:req
|
||||
.byte 0xe2
|
||||
.byte \battler
|
||||
.endm
|
||||
|
||||
.macro jumpifhasnohp battler:req, ptr:req
|
||||
.byte 0xe3
|
||||
.byte \battler
|
||||
.4byte \ptr
|
||||
.endm
|
||||
|
||||
.macro getsecretpowereffect
|
||||
.byte 0xe4
|
||||
.endm
|
||||
|
||||
.macro pickup
|
||||
.byte 0xe5
|
||||
.endm
|
||||
|
||||
.macro docastformchangeanimation
|
||||
.byte 0xe6
|
||||
.endm
|
||||
|
||||
.macro trycastformdatachange
|
||||
.byte 0xe7
|
||||
.endm
|
||||
|
||||
.macro settypebasedhalvers ptr:req
|
||||
.byte 0xe8
|
||||
.4byte \ptr
|
||||
.endm
|
||||
|
||||
.macro setweatherballtype
|
||||
.byte 0xe9
|
||||
.endm
|
||||
|
||||
.macro tryrecycleitem ptr:req
|
||||
.byte 0xea
|
||||
.4byte \ptr
|
||||
.endm
|
||||
|
||||
.macro settypetoterrain ptr:req
|
||||
.byte 0xeb
|
||||
.4byte \ptr
|
||||
.endm
|
||||
|
||||
.macro pursuitdoubles ptr:req
|
||||
.byte 0xec
|
||||
.4byte \ptr
|
||||
.endm
|
||||
|
||||
.macro snatchsetbattlers
|
||||
.byte 0xed
|
||||
.endm
|
||||
|
||||
.macro removelightscreenreflect
|
||||
.byte 0xee
|
||||
.endm
|
||||
|
||||
.macro handleballthrow
|
||||
.byte 0xef
|
||||
.endm
|
||||
|
||||
.macro givecaughtmon
|
||||
.byte 0xf0
|
||||
.endm
|
||||
|
||||
.macro trysetcaughtmondexflags ptr:req
|
||||
.byte 0xf1
|
||||
.4byte \ptr
|
||||
.endm
|
||||
|
||||
.macro displaydexinfo
|
||||
.byte 0xf2
|
||||
.endm
|
||||
|
||||
.macro trygivecaughtmonnick ptr:req
|
||||
.byte 0xf3
|
||||
.4byte \ptr
|
||||
.endm
|
||||
|
||||
.macro subattackerhpbydmg
|
||||
.byte 0xf4
|
||||
.endm
|
||||
|
||||
.macro removeattackerstatus1
|
||||
.byte 0xf5
|
||||
.endm
|
||||
|
||||
.macro finishaction
|
||||
.byte 0xf6
|
||||
.endm
|
||||
|
||||
.macro finishturn
|
||||
.byte 0xf7
|
||||
.endm
|
||||
|
||||
.macro trainerslideout position:req
|
||||
.byte 0xf8
|
||||
.byte \position
|
||||
.endm
|
||||
|
||||
@ various command changed to more readable macros
|
||||
.macro cancelmultiturnmoves battler:req
|
||||
various \battler, VARIOUS_CANCEL_MULTI_TURN_MOVES
|
||||
.endm
|
||||
|
||||
.macro setmagiccoattarget battler:req
|
||||
various \battler, VARIOUS_SET_MAGIC_COAT_TARGET
|
||||
.endm
|
||||
|
||||
.macro getifcantrunfrombattle battler:req
|
||||
various \battler, VARIOUS_IS_RUNNING_IMPOSSIBLE
|
||||
.endm
|
||||
|
||||
.macro getmovetarget battler:req
|
||||
various \battler, VARIOUS_GET_MOVE_TARGET
|
||||
.endm
|
||||
|
||||
.macro getbattlerfainted battler:req
|
||||
various \battler, VARIOUS_GET_BATTLER_FAINTED
|
||||
.endm
|
||||
|
||||
.macro resetintimidatetracebits battler:req
|
||||
various \battler, VARIOUS_RESET_INTIMIDATE_TRACE_BITS
|
||||
.endm
|
||||
|
||||
.macro updatechoicemoveonlvlup battler:req
|
||||
various \battler, VARIOUS_UPDATE_CHOICE_MOVE_ON_LVL_UP
|
||||
.endm
|
||||
|
||||
.macro resetplayerfainted
|
||||
various BS_ATTACKER, VARIOUS_RESET_PLAYER_FAINTED
|
||||
.endm
|
||||
|
||||
.macro palaceflavortext battler:req
|
||||
various \battler, VARIOUS_PALACE_FLAVOR_TEXT
|
||||
.endm
|
||||
|
||||
.macro arenajudgmentwindow
|
||||
various BS_ATTACKER, VARIOUS_ARENA_JUDGMENT_WINDOW
|
||||
.endm
|
||||
|
||||
.macro arenaopponentmonlost
|
||||
various BS_ATTACKER, VARIOUS_ARENA_OPPONENT_MON_LOST
|
||||
.endm
|
||||
|
||||
.macro arenaplayermonlost
|
||||
various BS_ATTACKER, VARIOUS_ARENA_PLAYER_MON_LOST
|
||||
.endm
|
||||
|
||||
.macro arenabothmonlost
|
||||
various BS_ATTACKER, VARIOUS_ARENA_BOTH_MONS_LOST
|
||||
.endm
|
||||
|
||||
.macro forfeityesnobox battler:req
|
||||
various \battler, VARIOUS_EMIT_YESNOBOX
|
||||
.endm
|
||||
|
||||
.macro arenadrawreftextbox
|
||||
various BS_ATTACKER, VARIOUS_DRAW_ARENA_REF_TEXT_BOX
|
||||
.endm
|
||||
|
||||
.macro arenaerasereftextbox
|
||||
various BS_ATTACKER, VARIOUS_ERASE_ARENA_REF_TEXT_BOX
|
||||
.endm
|
||||
|
||||
.macro arenajudgmentstring id:req
|
||||
various \id, VARIOUS_ARENA_JUDGMENT_STRING
|
||||
.endm
|
||||
|
||||
.macro arenawaitmessage id:req
|
||||
various \id, VARIOUS_ARENA_WAIT_STRING
|
||||
.endm
|
||||
|
||||
.macro waitcry battler:req
|
||||
various \battler, VARIOUS_WAIT_CRY
|
||||
.endm
|
||||
|
||||
.macro returnopponentmon1toball battler:req
|
||||
various \battler, VARIOUS_RETURN_OPPONENT_MON1
|
||||
.endm
|
||||
|
||||
.macro returnopponentmon2toball battler:req
|
||||
various \battler, VARIOUS_RETURN_OPPONENT_MON2
|
||||
.endm
|
||||
|
||||
.macro volumedown
|
||||
various BS_ATTACKER, VARIOUS_VOLUME_DOWN
|
||||
.endm
|
||||
|
||||
.macro volumeup
|
||||
various BS_ATTACKER, VARIOUS_VOLUME_UP
|
||||
.endm
|
||||
|
||||
.macro setalreadystatusedmoveattempt battler:req
|
||||
various \battler, VARIOUS_SET_ALREADY_STATUS_MOVE_ATTEMPT
|
||||
.endm
|
||||
|
||||
.macro palacetryescapestatus battler:req
|
||||
various \battler, VARIOUS_PALACE_TRY_ESCAPE_STATUS
|
||||
.endm
|
||||
|
||||
.macro setoutcomeonteleport battler:req
|
||||
various \battler, VARIOUS_SET_TELEPORT_OUTCOME
|
||||
.endm
|
||||
|
||||
.macro playtrainerdefeatbgm battler:req
|
||||
various \battler, VARIOUS_PLAY_TRAINER_DEFEATED_MUSIC
|
||||
.endm
|
||||
|
||||
@ helpful macros
|
||||
.macro setstatchanger stat:req, stages:req, down:req
|
||||
setbyte sSTATCHANGER, \stat | \stages << 4 | \down << 7
|
||||
.endm
|
||||
|
||||
.macro setmoveeffect effect:req
|
||||
setbyte cEFFECT_CHOOSER, \effect
|
||||
.endm
|
||||
|
||||
.macro chosenstatus1animation battler:req, status:req
|
||||
chosenstatusanimation \battler, 0x0, \status
|
||||
.endm
|
||||
|
||||
.macro chosenstatus2animation battler:req, status:req
|
||||
chosenstatusanimation \battler, 0x1, \status
|
||||
.endm
|
||||
|
||||
.macro sethword dst:req, value:req
|
||||
setbyte \dst, (\value) & 0xFF
|
||||
setbyte \dst + 1, ((\value) >> 8) & 0xFF
|
||||
.endm
|
||||
|
||||
.macro setword dst:req, value:req
|
||||
setbyte \dst, (\value) & 0xFF
|
||||
setbyte \dst + 1, ((\value) >> 8) & 0xFF
|
||||
setbyte \dst + 2, ((\value) >> 16) & 0xFF
|
||||
setbyte \dst + 3, ((\value) >> 24) & 0xFF
|
||||
.endm
|
||||
|
||||
.macro copybyte dst:req, src:req
|
||||
copyarray \dst, \src, 0x1
|
||||
.endm
|
||||
|
||||
.macro copyhword dst:req, src:req
|
||||
copyarray \dst, \src, 0x2
|
||||
.endm
|
||||
|
||||
.macro copyword dst:req, src:req
|
||||
copyarray \dst, \src, 0x4
|
||||
.endm
|
||||
|
||||
.macro jumpifbytenotequal byte1:req, byte2:req, jumpptr:req
|
||||
jumpifarraynotequal \byte1, \byte2, 0x1, \jumpptr
|
||||
.endm
|
||||
|
||||
.macro jumpifbyteequal byte1:req, byte2:req, jumpptr:req
|
||||
jumpifarrayequal \byte1, \byte2, 0x1, \jumpptr
|
||||
.endm
|
||||
|
||||
.macro jumpifmove move:req, jumpptr:req
|
||||
jumpifhalfword CMP_EQUAL, gCurrentMove, \move, \jumpptr
|
||||
.endm
|
||||
|
||||
.macro jumpifnotmove move:req, jumpptr:req
|
||||
jumpifhalfword CMP_NOT_EQUAL, gCurrentMove, \move, \jumpptr
|
||||
.endm
|
||||
|
||||
.macro jumpifstatus3 battler:req, status:req, jumpptr:req
|
||||
jumpifstatus3condition \battler, \status, FALSE, \jumpptr
|
||||
.endm
|
||||
|
||||
.macro jumpifnostatus3 battler:req, status:req, jumpptr:req
|
||||
jumpifstatus3condition \battler, \status, TRUE, \jumpptr
|
||||
.endm
|
||||
|
||||
.macro jumpifmovehadnoeffect jumpptr:req
|
||||
jumpifbyte CMP_COMMON_BITS, gMoveResultFlags, MOVE_RESULT_NO_EFFECT, \jumpptr
|
||||
.endm
|
||||
|
||||
.macro jumpifbattletype flags:req, jumpptr:req
|
||||
jumpifword CMP_COMMON_BITS, gBattleTypeFlags, \flags, \jumpptr
|
||||
.endm
|
||||
|
||||
.macro jumpifnotbattletype flags:req, jumpptr:req
|
||||
jumpifword CMP_NO_COMMON_BITS, gBattleTypeFlags, \flags, \jumpptr
|
||||
.endm
|
167
asm/macros/battle_tent.inc
Normal file
167
asm/macros/battle_tent.inc
Normal file
@ -0,0 +1,167 @@
|
||||
@ Verdanturf Tent
|
||||
|
||||
@ Initialize the Verdanturf Battle Tent challenge
|
||||
.macro verdanturftent_init
|
||||
setvar VAR_0x8004, VERDANTURF_TENT_FUNC_INIT
|
||||
special CallVerdanturfTentFunction
|
||||
.endm
|
||||
|
||||
@ Get the current prize item id
|
||||
.macro verdanturftent_getprize
|
||||
setvar VAR_0x8004, VERDANTURF_TENT_FUNC_GET_PRIZE
|
||||
special CallVerdanturfTentFunction
|
||||
.endm
|
||||
|
||||
@ Unused. Set the prize item to be given
|
||||
.macro verdanturftent_setprize unusedArg:req, itemId:req
|
||||
setvar VAR_0x8004, VERDANTURF_TENT_FUNC_SET_PRIZE
|
||||
setvar VAR_0x8005, \unusedArg
|
||||
setvar VAR_0x8006, \itemId
|
||||
special CallVerdanturfTentFunction
|
||||
.endm
|
||||
|
||||
@ Unused. Set the opponent trainer and gfx. SetNextBattleTentOpponent is used through tower_setopponent instead
|
||||
.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
|
||||
|
||||
@ Save the game and set the challenge status
|
||||
.macro verdanturftent_save challengeStatus:req
|
||||
setvar VAR_0x8004, VERDANTURF_TENT_FUNC_SAVE
|
||||
setvar VAR_0x8005, \challengeStatus
|
||||
special CallVerdanturfTentFunction
|
||||
.endm
|
||||
|
||||
@ Set the prize item as randomly selected from a list. Randomness unnecessary, as the list is only 1 item
|
||||
.macro verdanturftent_setrandomprize
|
||||
setvar VAR_0x8004, VERDANTURF_TENT_FUNC_SET_RANDOM_PRIZE
|
||||
special CallVerdanturfTentFunction
|
||||
.endm
|
||||
|
||||
@ Give the current prize item. FALSE if no room for prize
|
||||
.macro verdanturftent_giveprize
|
||||
setvar VAR_0x8004, VERDANTURF_TENT_FUNC_GIVE_PRIZE
|
||||
special CallVerdanturfTentFunction
|
||||
.endm
|
||||
|
||||
|
||||
@ Fallarbor Tent
|
||||
|
||||
@ Initialize the Fallarbor Battle Tent challenge
|
||||
.macro fallarbortent_init
|
||||
setvar VAR_0x8004, FALLARBOR_TENT_FUNC_INIT
|
||||
special CallFallarborTentFunction
|
||||
.endm
|
||||
|
||||
@ Get the current prize item id
|
||||
.macro fallarbortent_getprize
|
||||
setvar VAR_0x8004, FALLARBOR_TENT_FUNC_GET_PRIZE
|
||||
special CallFallarborTentFunction
|
||||
.endm
|
||||
|
||||
@ Unused. Set the prize item to be given
|
||||
.macro fallarbortent_setprize unusedArg:req, itemId:req
|
||||
setvar VAR_0x8004, FALLARBOR_TENT_FUNC_SET_PRIZE
|
||||
setvar VAR_0x8005, \unusedArg
|
||||
setvar VAR_0x8006, \itemId
|
||||
special CallFallarborTentFunction
|
||||
.endm
|
||||
|
||||
@ Save the game and set the challenge status
|
||||
.macro fallarbortent_save challengeStatus:req
|
||||
setvar VAR_0x8004, FALLARBOR_TENT_FUNC_SAVE
|
||||
setvar VAR_0x8005, \challengeStatus
|
||||
special CallFallarborTentFunction
|
||||
.endm
|
||||
|
||||
@ Set the prize item as randomly selected from a list. Randomness unnecessary, as the list is only 1 item
|
||||
.macro fallarbortent_setrandomprize
|
||||
setvar VAR_0x8004, FALLARBOR_TENT_FUNC_SET_RANDOM_PRIZE
|
||||
special CallFallarborTentFunction
|
||||
.endm
|
||||
|
||||
@ Give the current prize item. FALSE if no room for prize
|
||||
.macro fallarbortent_giveprize
|
||||
setvar VAR_0x8004, FALLARBOR_TENT_FUNC_GIVE_PRIZE
|
||||
special CallFallarborTentFunction
|
||||
.endm
|
||||
|
||||
@ Buffer the opponent trainers name to STR_VAR_1
|
||||
.macro fallarbortent_getopponentname
|
||||
setvar VAR_0x8004, FALLARBOR_TENT_FUNC_GET_OPPONENT_NAME
|
||||
special CallFallarborTentFunction
|
||||
.endm
|
||||
|
||||
|
||||
@ Slateport Tent
|
||||
|
||||
@ Initialize the Slateport Battle Tent challenge
|
||||
.macro slateporttent_init
|
||||
setvar VAR_0x8004, SLATEPORT_TENT_FUNC_INIT
|
||||
special CallSlateportTentFunction
|
||||
.endm
|
||||
|
||||
@ Get the current prize item id
|
||||
.macro slateporttent_getprize
|
||||
setvar VAR_0x8004, SLATEPORT_TENT_FUNC_GET_PRIZE
|
||||
special CallSlateportTentFunction
|
||||
.endm
|
||||
|
||||
@ Unused. Set the prize item to be given
|
||||
.macro slateporttent_setprize unusedArg:req, itemId:req
|
||||
setvar VAR_0x8004, SLATEPORT_TENT_FUNC_SET_PRIZE
|
||||
setvar VAR_0x8005, \unusedArg
|
||||
setvar VAR_0x8006, \itemId
|
||||
special CallSlateportTentFunction
|
||||
.endm
|
||||
|
||||
@ Save the game and set the challenge status
|
||||
.macro slateporttent_save challengeStatus:req
|
||||
setvar VAR_0x8004, SLATEPORT_TENT_FUNC_SAVE
|
||||
setvar VAR_0x8005, \challengeStatus
|
||||
special CallSlateportTentFunction
|
||||
.endm
|
||||
|
||||
@ Set the prize item as randomly selected from a list. Randomness unnecessary, as the list is only 1 item
|
||||
.macro slateporttent_setrandomprize
|
||||
setvar VAR_0x8004, SLATEPORT_TENT_FUNC_SET_RANDOM_PRIZE
|
||||
special CallSlateportTentFunction
|
||||
.endm
|
||||
|
||||
@ Give the current prize item. FALSE if no room for prize
|
||||
.macro slateporttent_giveprize
|
||||
setvar VAR_0x8004, SLATEPORT_TENT_FUNC_GIVE_PRIZE
|
||||
special CallSlateportTentFunction
|
||||
.endm
|
||||
|
||||
@ Slateport Tent's version of factory_rentmons
|
||||
.macro slateporttent_rentmons
|
||||
setvar VAR_0x8004, SLATEPORT_TENT_FUNC_SELECT_RENT_MONS
|
||||
special CallSlateportTentFunction
|
||||
.endm
|
||||
|
||||
@ Slateport Tent's version of factory_swapmons
|
||||
.macro slateporttent_swapmons
|
||||
setvar VAR_0x8004, SLATEPORT_TENT_FUNC_SWAP_RENT_MONS
|
||||
special CallSlateportTentFunction
|
||||
.endm
|
||||
|
||||
@ Slateport Tent's version of factory_generateopponentmons
|
||||
.macro slateporttent_generateopponentmons
|
||||
setvar VAR_0x8004, SLATEPORT_TENT_FUNC_GENERATE_OPPONENT_MONS
|
||||
special CallSlateportTentFunction
|
||||
.endm
|
||||
|
||||
@ Slateport Tent's version of factory_generaterentalmons
|
||||
.macro slateporttent_generaterentalmons
|
||||
setvar VAR_0x8004, SLATEPORT_TENT_FUNC_GENERATE_RENTAL_MONS
|
||||
special CallSlateportTentFunction
|
||||
.endm
|
||||
|
871
asm/macros/contest_ai_script.inc
Normal file
871
asm/macros/contest_ai_script.inc
Normal file
@ -0,0 +1,871 @@
|
||||
@ A large number of the Contest AI commands go unused, so their corresponding macros in this file are similarly unused
|
||||
|
||||
@ Add a positive/negative value to the score of the move being evaluated.
|
||||
|
||||
.macro score score:req
|
||||
.byte 0x00
|
||||
.byte \score
|
||||
.endm
|
||||
|
||||
.macro get_appeal_num
|
||||
.byte 0x01
|
||||
.endm
|
||||
|
||||
.macro if_appeal_num_less_than num:req, destination:req
|
||||
.byte 0x02
|
||||
.byte \num
|
||||
.4byte \destination
|
||||
.endm
|
||||
|
||||
.macro if_appeal_num_more_than num:req, destination:req
|
||||
.byte 0x03
|
||||
.byte \num
|
||||
.4byte \destination
|
||||
.endm
|
||||
|
||||
.macro if_appeal_num_eq num:req, destination:req
|
||||
.byte 0x04
|
||||
.byte \num
|
||||
.4byte \destination
|
||||
.endm
|
||||
|
||||
.macro if_appeal_num_not_eq num:req, destination:req
|
||||
.byte 0x05
|
||||
.byte \num
|
||||
.4byte \destination
|
||||
.endm
|
||||
|
||||
.macro if_last_appeal destination:req
|
||||
if_appeal_num_eq CONTEST_LAST_APPEAL, \destination
|
||||
.endm
|
||||
|
||||
.macro if_not_last_appeal destination:req
|
||||
if_appeal_num_not_eq CONTEST_LAST_APPEAL, \destination
|
||||
.endm
|
||||
|
||||
@ audience excitement
|
||||
|
||||
.macro get_excitement
|
||||
.byte 0x06
|
||||
.endm
|
||||
|
||||
.macro if_excitement_less_than num:req, destination:req
|
||||
.byte 0x07
|
||||
.byte \num
|
||||
.4byte \destination
|
||||
.endm
|
||||
|
||||
.macro if_excitement_more_than num:req, destination:req
|
||||
.byte 0x08
|
||||
.byte \num
|
||||
.4byte \destination
|
||||
.endm
|
||||
|
||||
.macro if_excitement_eq num:req, destination:req
|
||||
.byte 0x09
|
||||
.byte \num
|
||||
.4byte \destination
|
||||
.endm
|
||||
|
||||
.macro if_excitement_not_eq num:req, destination:req
|
||||
.byte 0x0A
|
||||
.byte \num
|
||||
.4byte \destination
|
||||
.endm
|
||||
|
||||
@ the order that the user goes in the current appeal
|
||||
|
||||
.macro get_user_order
|
||||
.byte 0x0B
|
||||
.endm
|
||||
|
||||
.macro if_user_order_less_than num:req, destination:req
|
||||
.byte 0x0C
|
||||
.byte \num
|
||||
.4byte \destination
|
||||
.endm
|
||||
|
||||
.macro if_user_order_more_than num:req, destination:req
|
||||
.byte 0x0D
|
||||
.byte \num
|
||||
.4byte \destination
|
||||
.endm
|
||||
|
||||
.macro if_user_order_eq num:req, destination:req
|
||||
.byte 0x0E
|
||||
.byte \num
|
||||
.4byte \destination
|
||||
.endm
|
||||
|
||||
.macro if_user_order_not_eq num:req, destination:req
|
||||
.byte 0x0F
|
||||
.byte \num
|
||||
.4byte \destination
|
||||
.endm
|
||||
|
||||
@ user condition
|
||||
|
||||
.macro get_user_condition
|
||||
.byte 0x10
|
||||
.endm
|
||||
|
||||
.macro if_user_condition_less_than num:req, destination:req
|
||||
.byte 0x11
|
||||
.byte \num
|
||||
.4byte \destination
|
||||
.endm
|
||||
|
||||
.macro if_user_condition_more_than num:req, destination:req
|
||||
.byte 0x12
|
||||
.byte \num
|
||||
.4byte \destination
|
||||
.endm
|
||||
|
||||
.macro if_user_condition_eq num:req, destination:req
|
||||
.byte 0x13
|
||||
.byte \num
|
||||
.4byte \destination
|
||||
.endm
|
||||
|
||||
.macro if_user_condition_not_eq num:req, destination:req
|
||||
.byte 0x14
|
||||
.byte \num
|
||||
.4byte \destination
|
||||
.endm
|
||||
|
||||
@ appeal points
|
||||
|
||||
.macro get_point_total
|
||||
.byte 0x15
|
||||
.endm
|
||||
|
||||
.macro if_points_less_than num:req, destination:req
|
||||
.byte 0x16
|
||||
.byte \num
|
||||
.4byte \destination
|
||||
.endm
|
||||
|
||||
.macro if_points_more_than num:req, destination:req
|
||||
.byte 0x17
|
||||
.byte \num
|
||||
.4byte \destination
|
||||
.endm
|
||||
|
||||
.macro if_points_eq num:req, destination:req
|
||||
.byte 0x18
|
||||
.byte \num
|
||||
.4byte \destination
|
||||
.endm
|
||||
|
||||
.macro if_points_not_eq num:req, destination:req
|
||||
.byte 0x19
|
||||
.byte \num
|
||||
.4byte \destination
|
||||
.endm
|
||||
|
||||
@ preliminary (pre-appeal) judging points
|
||||
|
||||
.macro get_preliminary_points
|
||||
.byte 0x1A
|
||||
.endm
|
||||
|
||||
.macro if_preliminary_points_less_than num:req, destination:req
|
||||
.byte 0x1B
|
||||
.byte \num
|
||||
.4byte \destination
|
||||
.endm
|
||||
|
||||
.macro if_preliminary_points_more_than num:req, destination:req
|
||||
.byte 0x1C
|
||||
.byte \num
|
||||
.4byte \destination
|
||||
.endm
|
||||
|
||||
.macro if_preliminary_points_eq num:req, destination:req
|
||||
.byte 0x1D
|
||||
.byte \num
|
||||
.4byte \destination
|
||||
.endm
|
||||
|
||||
.macro if_preliminary_points_not_eq num:req, destination:req
|
||||
.byte 0x1E
|
||||
.byte \num
|
||||
.4byte \destination
|
||||
.endm
|
||||
|
||||
@ contest type
|
||||
|
||||
.macro get_contest_type
|
||||
.byte 0x1F
|
||||
.endm
|
||||
|
||||
.macro if_contest_type_eq type:req, destination:req
|
||||
.byte 0x20
|
||||
.byte \type
|
||||
.4byte \destination
|
||||
.endm
|
||||
|
||||
.macro if_contest_type_not_eq type:req, destination:req
|
||||
.byte 0x21
|
||||
.byte \type
|
||||
.4byte \destination
|
||||
.endm
|
||||
|
||||
@ move excitement (change in excitement due to move)
|
||||
|
||||
.macro get_move_excitement
|
||||
.byte 0x22
|
||||
.endm
|
||||
|
||||
.macro if_move_excitement_less_than num:req, destination:req
|
||||
.byte 0x23
|
||||
.byte \num
|
||||
.4byte \destination
|
||||
.endm
|
||||
|
||||
.macro if_move_excitement_more_than num:req, destination:req
|
||||
.byte 0x24
|
||||
.byte \num
|
||||
.4byte \destination
|
||||
.endm
|
||||
|
||||
.macro if_move_excitement_eq num:req, destination:req
|
||||
.byte 0x25
|
||||
.byte \num
|
||||
.4byte \destination
|
||||
.endm
|
||||
|
||||
.macro if_move_excitement_not_eq num:req, destination:req
|
||||
.byte 0x26
|
||||
.byte \num
|
||||
.4byte \destination
|
||||
.endm
|
||||
|
||||
@ move effect
|
||||
|
||||
.macro get_effect
|
||||
.byte 0x27
|
||||
.endm
|
||||
|
||||
.macro if_effect_eq effect:req, destination:req
|
||||
.byte 0x28
|
||||
.byte \effect
|
||||
.4byte \destination
|
||||
.endm
|
||||
|
||||
.macro if_effect_not_eq effect:req, destination:req
|
||||
.byte 0x29
|
||||
.byte \effect
|
||||
.4byte \destination
|
||||
.endm
|
||||
|
||||
@ move effect type
|
||||
|
||||
.macro get_effect_type
|
||||
.byte 0x2A
|
||||
.endm
|
||||
|
||||
.macro if_effect_type_eq type:req, destination:req
|
||||
.byte 0x2B
|
||||
.byte \type
|
||||
.4byte \destination
|
||||
.endm
|
||||
|
||||
.macro if_effect_type_not_eq type:req, destination:req
|
||||
.byte 0x2C
|
||||
.byte \type
|
||||
.4byte \destination
|
||||
.endm
|
||||
|
||||
@ whether the current move is the most appealing in the user's moveset
|
||||
|
||||
.macro check_most_appealing_move
|
||||
.byte 0x2D
|
||||
.endm
|
||||
|
||||
.macro if_most_appealing_move destination:req
|
||||
.byte 0x2E
|
||||
.4byte \destination
|
||||
.endm
|
||||
|
||||
@ whether the current move is the most jamming in the user's moveset
|
||||
|
||||
.macro check_most_jamming_move
|
||||
.byte 0x2F
|
||||
.endm
|
||||
|
||||
.macro if_most_jamming_move destination:req
|
||||
.byte 0x30
|
||||
.4bye \destination
|
||||
.endm
|
||||
|
||||
@ number of hearts the current move's appeal would provide
|
||||
|
||||
.macro get_num_move_hearts
|
||||
.byte 0x31
|
||||
.endm
|
||||
|
||||
.macro if_num_move_hearts_less_than num:req, destination:req
|
||||
.byte 0x32
|
||||
.byte \num
|
||||
.4byte \destination
|
||||
.endm
|
||||
|
||||
.macro if_num_move_hearts_more_than num:req, destination:req
|
||||
.byte 0x33
|
||||
.byte \num
|
||||
.4byte \destination
|
||||
.endm
|
||||
|
||||
.macro if_num_move_hearts_eq num:req, destination:req
|
||||
.byte 0x34
|
||||
.byte \num
|
||||
.4byte \destination
|
||||
.endm
|
||||
|
||||
.macro if_num_move_hearts_not_eq num:req, destination:req
|
||||
.byte 0x35
|
||||
.byte \num
|
||||
.4byte \destination
|
||||
.endm
|
||||
|
||||
@ number of hearts the current move's jam would remove
|
||||
|
||||
.macro get_num_move_jam_hearts
|
||||
.byte 0x36
|
||||
.endm
|
||||
|
||||
.macro if_num_move_jam_hearts_less_than num:req, destination:req
|
||||
.byte 0x37
|
||||
.byte \num
|
||||
.4byte \destination
|
||||
.endm
|
||||
|
||||
.macro if_num_move_jam_hearts_more_than num:req, destination:req
|
||||
.byte 0x38
|
||||
.byte \num
|
||||
.4byte \destination
|
||||
.endm
|
||||
|
||||
.macro if_num_move_jam_hearts_eq num:req, destination:req
|
||||
.byte 0x39
|
||||
.byte \num
|
||||
.4byte \destination
|
||||
.endm
|
||||
|
||||
.macro if_num_move_jam_hearts_not_eq num:req, destination:req
|
||||
.byte 0x3A
|
||||
.byte \num
|
||||
.4byte \destination
|
||||
.endm
|
||||
|
||||
@ number of times current move has been used
|
||||
|
||||
.macro get_move_used_count
|
||||
.byte 0x3B
|
||||
.endm
|
||||
|
||||
.macro if_move_used_count_less_than num:req, destination:req
|
||||
.byte 0x3C
|
||||
.byte \num
|
||||
.4byte \destination
|
||||
.endm
|
||||
|
||||
.macro if_move_used_count_more_than num:req, destination:req
|
||||
.byte 0x3D
|
||||
.byte \num
|
||||
.4byte \destination
|
||||
.endm
|
||||
|
||||
.macro if_move_used_count_eq num:req, destination:req
|
||||
.byte 0x3E
|
||||
.byte \num
|
||||
.4byte \destination
|
||||
.endm
|
||||
|
||||
.macro if_move_used_count_not_eq num:req, destination:req
|
||||
.byte 0x3F
|
||||
.byte \num
|
||||
.4byte \destination
|
||||
.endm
|
||||
|
||||
@ whether the current move is a combo starter (with another move in the moveset)
|
||||
|
||||
.macro check_combo_starter
|
||||
.byte 0x40
|
||||
.endm
|
||||
|
||||
.macro if_combo_starter destination:req
|
||||
.byte 0x41
|
||||
.4byte \destination
|
||||
.endm
|
||||
|
||||
.macro if_not_combo_starter destination:req
|
||||
.byte 0x42
|
||||
.4byte \destination
|
||||
.endm
|
||||
|
||||
@ whether the current move is a combo finisher (with another move in the moveset)
|
||||
|
||||
.macro check_combo_finisher
|
||||
.byte 0x43
|
||||
.endm
|
||||
|
||||
.macro if_combo_finisher destination:req
|
||||
.byte 0x44
|
||||
.4byte \destination
|
||||
.endm
|
||||
|
||||
.macro if_not_combo_finisher destination:req
|
||||
.byte 0x45
|
||||
.4byte \destination
|
||||
.endm
|
||||
|
||||
@ whether the current move would finish a combo
|
||||
|
||||
.macro check_would_finish_combo
|
||||
.byte 0x46
|
||||
.endm
|
||||
|
||||
.macro if_would_finish_combo destination:req
|
||||
.byte 0x47
|
||||
.4byte \destination
|
||||
.endm
|
||||
|
||||
.macro if_would_not_finish_combo destination:req
|
||||
.byte 0x48
|
||||
.4byte \destination
|
||||
.endm
|
||||
|
||||
@ condition of mon (indexed by order)
|
||||
|
||||
.macro get_condition mon:req
|
||||
.byte 0x49
|
||||
.byte \mon
|
||||
.endm
|
||||
|
||||
.macro if_condition_less_than mon:req, num:req destination:req
|
||||
.byte 0x4A
|
||||
.byte \mon
|
||||
.byte \num
|
||||
.4byte \destination
|
||||
.endm
|
||||
|
||||
.macro if_condition_more_than mon:req, num:req, destination:req
|
||||
.byte 0x4B
|
||||
.byte \mon
|
||||
.byte \num
|
||||
.4byte \destination
|
||||
.endm
|
||||
|
||||
.macro if_condition_eq mon:req, num:req, destination:req
|
||||
.byte 0x4C
|
||||
.byte \mon
|
||||
.byte \num
|
||||
.4byte \destination
|
||||
.endm
|
||||
|
||||
.macro if_condition_not_eq mon:req, num:req, destination:req
|
||||
.byte 0x4D
|
||||
.byte \mon
|
||||
.byte \num
|
||||
.4byte \destination
|
||||
.endm
|
||||
|
||||
@ whether the mon used a combo starter move
|
||||
@ Even though this value is always 1 or 0 (i.e. TRUE/FALSE),
|
||||
@ there are less-than and greater-than comparison operations for some reason.
|
||||
|
||||
.macro get_used_combo_starter mon:req
|
||||
.byte 0x4E
|
||||
.byte \mon
|
||||
.endm
|
||||
|
||||
.macro if_used_combo_starter_less_than mon:req, num:req, destination:req
|
||||
.byte 0x4F
|
||||
.byte \mon
|
||||
.byte \num
|
||||
.4byte \destination
|
||||
.endm
|
||||
|
||||
.macro if_used_combo_starter_more_than mon:req, num:req, destination:req
|
||||
.byte 0x50
|
||||
.byte \mon
|
||||
.byte \num
|
||||
.4byte \destination
|
||||
.endm
|
||||
|
||||
|
||||
.macro if_used_combo_starter_eq mon:req, num:req, destination:req
|
||||
.byte 0x51
|
||||
.byte \mon
|
||||
.byte \num
|
||||
.4byte \destination
|
||||
.endm
|
||||
|
||||
.macro if_used_combo_starter_not_eq mon:req, num:req, destination:req
|
||||
.byte 0x52
|
||||
.byte \mon
|
||||
.byte \num
|
||||
.4byte \destination
|
||||
.endm
|
||||
|
||||
.macro if_used_combo_starter mon:req, destination:req
|
||||
if_used_combo_starter_eq \mon, TRUE, \destination
|
||||
.endm
|
||||
|
||||
.macro if_not_used_combo_starter mon:req, destination:req
|
||||
if_used_combo_starter_eq \mon, FALSE, \destination
|
||||
.endm
|
||||
|
||||
@ whether the mon can make an appeal
|
||||
|
||||
.macro check_can_participate mon:req
|
||||
.byte 0x53
|
||||
.byte \mon
|
||||
.endm
|
||||
|
||||
.macro if_can_participate mon:req, destination:req
|
||||
.byte 0x54
|
||||
.byte \mon
|
||||
.4byte \destination
|
||||
.endm
|
||||
|
||||
.macro if_cannot_participate mon:req, destination:req
|
||||
.byte 0x55
|
||||
.byte \mon
|
||||
.4byte \destination
|
||||
.endm
|
||||
|
||||
@ whether the mon just completed a combo
|
||||
|
||||
.macro get_completed_combo mon:req
|
||||
.byte 0x56
|
||||
.byte \mon
|
||||
.4byte \destination
|
||||
.endm
|
||||
|
||||
.macro if_completed_combo mon:req, destination:req
|
||||
.byte 0x57
|
||||
.byte \mon
|
||||
.4byte \destination
|
||||
.endm
|
||||
|
||||
.macro if_not_completed_combo mon:req destination:req
|
||||
.byte 0x58
|
||||
.byte \mon
|
||||
.4byte \destination
|
||||
.endm
|
||||
|
||||
@ comparing appeal points to another mon
|
||||
|
||||
.macro get_points_diff mon:req
|
||||
.byte 0x59
|
||||
.byte \mon
|
||||
.endm
|
||||
|
||||
.macro if_points_more_than_mon mon:req, destination:req
|
||||
.byte 0x5A
|
||||
.byte \mon
|
||||
.4byte \destination
|
||||
.endm
|
||||
|
||||
.macro if_points_less_than_mon mon:req, destination:req
|
||||
.byte 0x5B
|
||||
.byte \mon
|
||||
.4byte \destination
|
||||
.endm
|
||||
|
||||
.macro if_points_eq_mon mon:req, destination:req
|
||||
.byte 0x5C
|
||||
.byte \mon
|
||||
.4byte \destination
|
||||
.endm
|
||||
|
||||
.macro if_points_not_eq_mon mon:req, destination:req
|
||||
.byte 0x5D
|
||||
.byte \mon
|
||||
.4byte \destination
|
||||
.endm
|
||||
|
||||
@ comparing preliminary judging points to another mon
|
||||
|
||||
.macro get_preliminary_points_diff mon:req
|
||||
.byte 0x5E
|
||||
.byte \mon
|
||||
.endm
|
||||
|
||||
.macro if_preliminary_points_more_than_mon mon:req, destination:req
|
||||
.byte 0x5F
|
||||
.byte \mon
|
||||
.4byte \destination
|
||||
.endm
|
||||
|
||||
.macro if_preliminary_points_less_than_mon mon:req, destination:req
|
||||
.byte 0x60
|
||||
.byte \mon
|
||||
.4byte \destination
|
||||
.endm
|
||||
|
||||
.macro if_preliminary_points_eq_mon mon:req, destination:req
|
||||
.byte 0x61
|
||||
.byte \mon
|
||||
.4byte \destination
|
||||
.endm
|
||||
|
||||
.macro if_preliminary_points_not_eq_mon mon:req, destination:req
|
||||
.byte 0x62
|
||||
.byte \mon
|
||||
.4byte \destination
|
||||
.endm
|
||||
|
||||
@ checking move history for move effect
|
||||
|
||||
.macro get_used_moves_effect mon:req, round:req
|
||||
.byte 0x63
|
||||
.byte \mon
|
||||
.byte \round
|
||||
.endm
|
||||
|
||||
.macro if_used_moves_effect_less_than mon:req, round:req, effect:req, destination:req
|
||||
.byte 0x64
|
||||
.byte \mon
|
||||
.byte \round
|
||||
.byte \effect
|
||||
.4byte \destination
|
||||
.endm
|
||||
|
||||
.macro if_used_moves_effect_more_than mon:req, round:req, effect:req, destination:req
|
||||
.byte 0x65
|
||||
.byte \mon
|
||||
.byte \round
|
||||
.byte \effect
|
||||
.4byte \destination
|
||||
.endm
|
||||
|
||||
.macro if_used_moves_effect_eq mon:req, round:req, effect:req, destination:req
|
||||
.byte 0x66
|
||||
.byte \mon
|
||||
.byte \round
|
||||
.byte \effect
|
||||
.4byte \destination
|
||||
.endm
|
||||
|
||||
.macro if_used_moves_effect_not_eq mon:req, round:req, effect:req, destination:req
|
||||
.byte 0x67
|
||||
.byte \mon
|
||||
.byte \round
|
||||
.byte \effect
|
||||
.4byte \destination
|
||||
.endm
|
||||
|
||||
@ checking move history for excitement
|
||||
|
||||
.macro get_used_moves_excitement mon:req, round:req
|
||||
.byte 0x68
|
||||
.byte \mon
|
||||
.byte \round
|
||||
.endm
|
||||
|
||||
.macro if_used_moves_excitement_less_than mon:req, round:req, num:req, destination:req
|
||||
.byte 0x69
|
||||
.byte \mon
|
||||
.byte \round
|
||||
.byte \num
|
||||
.4byte \destination
|
||||
.endm
|
||||
|
||||
.macro if_used_moves_excitement_more_than mon:req, round:req, num:req, destination:req
|
||||
.byte 0x6A
|
||||
.byte \mon
|
||||
.byte \round
|
||||
.byte \num
|
||||
.4byte \destination
|
||||
.endm
|
||||
|
||||
.macro if_used_moves_excitement_eq mon:req, round:req, num:req, destination:req
|
||||
.byte 0x6B
|
||||
.byte \mon
|
||||
.byte \round
|
||||
.byte \num
|
||||
.4byte \destination
|
||||
.endm
|
||||
|
||||
.macro if_used_moves_excitement_not_eq mon:req, round:req, num:req, destination:req
|
||||
.byte 0x6C
|
||||
.byte \mon
|
||||
.byte \round
|
||||
.byte \num
|
||||
.4byte \destination
|
||||
.endm
|
||||
|
||||
@ checking move history for effect type
|
||||
|
||||
.macro get_used_moves_effect_type mon:req, round:req
|
||||
.byte 0x6D
|
||||
.byte \mon
|
||||
.byte \round
|
||||
.endm
|
||||
|
||||
.macro if_used_moves_effect_type_eq mon:req, round:req, type:req, destination:req
|
||||
.byte 0x6E
|
||||
.byte \mon
|
||||
.byte \round
|
||||
.byte \type
|
||||
.4byte \destination
|
||||
.endm
|
||||
|
||||
.macro if_used_moves_effect_type_not_eq mon:req, round:req, type:req, destination:req
|
||||
.byte 0x6F
|
||||
.byte \mon
|
||||
.byte \round
|
||||
.byte \type
|
||||
.4byte \destination
|
||||
.endm
|
||||
|
||||
@ generic commands
|
||||
|
||||
.macro save_result varId:req
|
||||
.byte 0x70
|
||||
.byte \varId
|
||||
.endm
|
||||
|
||||
.macro setvar varId:req, num:req
|
||||
.byte 0x71
|
||||
.byte \varId
|
||||
.2byte \num
|
||||
.endm
|
||||
|
||||
.macro add varId:req, num:req
|
||||
.byte 0x72
|
||||
.byte \varId
|
||||
.2byte \num
|
||||
.endm
|
||||
|
||||
.macro addvar varId1:req, varId2:req
|
||||
.byte 0x73
|
||||
.byte \varId1
|
||||
.byte \varId2
|
||||
.endm
|
||||
|
||||
@ Duplicate of above
|
||||
.macro addvar_duplicate varId1:req, varId2:req
|
||||
.byte 0x74
|
||||
.byte \varId1
|
||||
.byte \varId2
|
||||
.endm
|
||||
|
||||
.macro if_less_than varId:req, num:req, destination:req
|
||||
.byte 0x75
|
||||
.byte \varId
|
||||
.2byte \num
|
||||
.4byte \destination
|
||||
.endm
|
||||
|
||||
.macro if_greater_than varId:req, num:req, destination:req
|
||||
.byte 0x76
|
||||
.byte \varId
|
||||
.2byte \num
|
||||
.4byte \destination
|
||||
.endm
|
||||
|
||||
.macro if_eq varId:req, num:req, destination:req
|
||||
.byte 0x77
|
||||
.byte \varId
|
||||
.2byte \num
|
||||
.4byte \destination
|
||||
.endm
|
||||
|
||||
.macro if_not_eq varId:req, num:req, destination:req
|
||||
.byte 0x78
|
||||
.byte \varId
|
||||
.2byte \num
|
||||
.4byte \destination
|
||||
.endm
|
||||
|
||||
.macro if_less_than_var varId1:req, varId2:req, destination:req
|
||||
.byte 0x79
|
||||
.byte \varId1
|
||||
.byte \varId2
|
||||
.4byte \destination
|
||||
.endm
|
||||
|
||||
.macro if_greater_than_var varId1:req, varId2:req, destination:req
|
||||
.byte 0x7A
|
||||
.byte \varId1
|
||||
.byte \varId2
|
||||
.4byte \destination
|
||||
.endm
|
||||
|
||||
.macro if_eq_var varId1:req, varId2:req, destination:req
|
||||
.byte 0x7B
|
||||
.byte \varId1
|
||||
.byte \varId2
|
||||
.4byte \destination
|
||||
.endm
|
||||
|
||||
.macro if_not_eq_var varId1:req, varId2:req, destination:req
|
||||
.byte 0x7C
|
||||
.byte \varId1
|
||||
.byte \varId2
|
||||
.4byte \destination
|
||||
.endm
|
||||
|
||||
@ NOTE: The random commands are broken (see ContestAICmd_if_random_less_than)
|
||||
.macro if_random_less_than num:req, destination:req
|
||||
.byte 0x7D
|
||||
.byte \num
|
||||
.4byte \destination
|
||||
.endm
|
||||
|
||||
.macro if_random_greater_than num:req, destination:req
|
||||
.byte 0x7E
|
||||
.byte \num
|
||||
.4byte \destination
|
||||
.endm
|
||||
|
||||
.macro goto destination:req
|
||||
.byte 0x7F
|
||||
.4byte \destination
|
||||
.endm
|
||||
|
||||
.macro call destination:req
|
||||
.byte 0x80
|
||||
.4byte \destination
|
||||
.endm
|
||||
|
||||
.macro end
|
||||
.byte 0x81
|
||||
.endm
|
||||
|
||||
.macro check_user_has_exciting_move
|
||||
.byte 0x82
|
||||
.endm
|
||||
|
||||
.macro if_user_has_exciting_move destination:req
|
||||
.byte 0x83
|
||||
.4byte \destination
|
||||
.endm
|
||||
|
||||
.macro if_user_doesnt_have_exciting_move destination:req
|
||||
.byte 0x84
|
||||
.4byte \destination
|
||||
.endm
|
||||
|
||||
@ This is used incorrectly to check for an effect; see ContestAICmd_check_user_has_move
|
||||
.macro check_user_has_move move:req
|
||||
.byte 0x85
|
||||
.2byte \move
|
||||
.endm
|
||||
|
||||
.macro if_user_has_move move:req, destination:req
|
||||
.byte 0x86
|
||||
.2byte \move
|
||||
.4byte \destination
|
||||
.endm
|
||||
|
||||
.macro if_user_doesnt_have_move move:req, destination:req
|
||||
.byte 0x87
|
||||
.2byte \move
|
||||
.4byte \destination
|
||||
.endm
|
1934
asm/macros/event.inc
Normal file
1934
asm/macros/event.inc
Normal file
@ -0,0 +1,1934 @@
|
||||
@ Does nothing.
|
||||
.macro nop
|
||||
.byte 0x00
|
||||
.endm
|
||||
|
||||
@ Does nothing.
|
||||
.macro nop1
|
||||
.byte 0x01
|
||||
.endm
|
||||
|
||||
@ Terminates script execution.
|
||||
.macro end
|
||||
.byte 0x02
|
||||
.endm
|
||||
|
||||
@ Jumps back to after the last-executed call statement, and continues script execution from there.
|
||||
.macro return
|
||||
.byte 0x03
|
||||
.endm
|
||||
|
||||
@ Jumps to destination and continues script execution from there. The location of the calling script is remembered and can be returned to later.
|
||||
.macro call destination:req
|
||||
.byte 0x04
|
||||
.4byte \destination
|
||||
.endm
|
||||
|
||||
@ Jumps to destination and continues script execution from there.
|
||||
.macro goto destination:req
|
||||
.byte 0x05
|
||||
.4byte \destination
|
||||
.endm
|
||||
|
||||
@ If the result of the last comparison matches condition (see Comparison operators), jumps to destination and continues script execution from there.
|
||||
.macro goto_if condition:req, destination:req
|
||||
.byte 0x06
|
||||
.byte \condition
|
||||
.4byte \destination
|
||||
.endm
|
||||
|
||||
@ If the result of the last comparison matches condition (see Comparison operators), calls destination.
|
||||
.macro call_if condition:req, destination:req
|
||||
.byte 0x07
|
||||
.byte \condition
|
||||
.4byte \destination
|
||||
.endm
|
||||
|
||||
@ Jumps to the script in gStdScripts at index function.
|
||||
.macro gotostd function:req
|
||||
.byte 0x08
|
||||
.byte \function
|
||||
.endm
|
||||
|
||||
@ callstd function names
|
||||
STD_OBTAIN_ITEM = 0
|
||||
STD_FIND_ITEM = 1
|
||||
STD_OBTAIN_DECORATION = 7
|
||||
STD_REGISTER_MATCH_CALL = 8
|
||||
|
||||
@ Calls the script in gStdScripts at index function.
|
||||
.macro callstd function:req
|
||||
.byte 0x09
|
||||
.byte \function
|
||||
.endm
|
||||
|
||||
@ If the result of the last comparison matches condition (see Comparison operators), jumps to the script in gStdScripts at index function.
|
||||
.macro gotostd_if condition:req, function:req
|
||||
.byte 0x0a
|
||||
.byte \condition
|
||||
.byte \function
|
||||
.endm
|
||||
|
||||
@ If the result of the last comparison matches condition (see Comparison operators), calls the script in gStdScripts at index function.
|
||||
.macro callstd_if condition:req, function:req
|
||||
.byte 0x0b
|
||||
.byte \condition
|
||||
.byte \function
|
||||
.endm
|
||||
|
||||
@ Equivalent to the 'return' command for a RAM script.
|
||||
.macro returnram
|
||||
.byte 0x0c
|
||||
.endm
|
||||
|
||||
@ Equivalent to the 'end' command for a RAM script.
|
||||
.macro endram
|
||||
.byte 0x0d
|
||||
.endm
|
||||
|
||||
@ Sets the Mystery Event script status (MEVENT_STATUS_*).
|
||||
.macro setmysteryeventstatus value:req
|
||||
.byte 0x0e
|
||||
.byte \value
|
||||
.endm
|
||||
|
||||
@ Sets the value at the specified script data index to a fixed 4-byte value.
|
||||
.macro loadword destIndex:req, value:req
|
||||
.byte 0x0f
|
||||
.byte \destIndex
|
||||
.4byte \value
|
||||
.endm
|
||||
|
||||
@ Sets the value at the specified script data index to a fixed byte value.
|
||||
.macro loadbyte destIndex:req, value:req
|
||||
.byte 0x10
|
||||
.byte \destIndex
|
||||
.byte \value
|
||||
.endm
|
||||
|
||||
@ Sets the value at the specified pointer.
|
||||
.macro setptr value:req, ptr:req
|
||||
.byte 0x11
|
||||
.byte \value
|
||||
.4byte \ptr
|
||||
.endm
|
||||
|
||||
@ Sets the value at the specified script data index to the value at pointer 'source'.
|
||||
.macro loadbytefromptr destIndex:req, source:req
|
||||
.byte 0x12
|
||||
.byte \destIndex
|
||||
.4byte \source
|
||||
.endm
|
||||
|
||||
@ Sets the value at pointer 'destination' to the contents of the script data at 'srcIndex'.
|
||||
.macro setptrbyte srcIndex:req, destination:req
|
||||
.byte 0x13
|
||||
.byte \srcIndex
|
||||
.4byte \destination
|
||||
.endm
|
||||
|
||||
@ Copies the contents of the script data from one index to another.
|
||||
.macro copylocal destIndex:req, srcIndex:req
|
||||
.byte 0x14
|
||||
.byte \destIndex
|
||||
.byte \srcIndex
|
||||
.endm
|
||||
|
||||
@ Copies the byte at source to destination, replacing whatever byte was previously there.
|
||||
.macro copybyte destination:req, source:req
|
||||
.byte 0x15
|
||||
.4byte \destination
|
||||
.4byte \source
|
||||
.endm
|
||||
|
||||
@ Changes the value of destination to value.
|
||||
.macro setvar destination:req, value:req
|
||||
.byte 0x16
|
||||
.2byte \destination
|
||||
.2byte \value
|
||||
.endm
|
||||
|
||||
@ Changes the value of destination by adding value to it. Overflow is not prevented (0xFFFF + 1 = 0x0000).
|
||||
.macro addvar destination:req, value:req
|
||||
.byte 0x17
|
||||
.2byte \destination
|
||||
.2byte \value
|
||||
.endm
|
||||
|
||||
@ Changes the value of destination by subtracting value to it. Overflow is not prevented (0x0000 - 1 = 0xFFFF).
|
||||
.macro subvar destination:req, value:req
|
||||
.byte 0x18
|
||||
.2byte \destination
|
||||
.2byte \value
|
||||
.endm
|
||||
|
||||
@ Copies the value of source into destination.
|
||||
.macro copyvar destination:req, source:req
|
||||
.byte 0x19
|
||||
.2byte \destination
|
||||
.2byte \source
|
||||
.endm
|
||||
|
||||
@ If source is not a variable, then this function acts like setvar. Otherwise, it acts like copyvar.
|
||||
.macro setorcopyvar destination:req, source:req
|
||||
.byte 0x1a
|
||||
.2byte \destination
|
||||
.2byte \source
|
||||
.endm
|
||||
|
||||
@ Compares the values of the script data at indexes 'local1' and 'local2'.
|
||||
@ The result is stored in comparisonResult to be acted on by goto_if / call_if
|
||||
.macro compare_local_to_local local1:req, local2:req
|
||||
.byte 0x1b
|
||||
.byte \local1
|
||||
.byte \local2
|
||||
.endm
|
||||
|
||||
@ Compares the value of the script data at index 'local' to a fixed value.
|
||||
@ The result is stored in comparisonResult to be acted on by goto_if / call_if
|
||||
.macro compare_local_to_value local:req, value:req
|
||||
.byte 0x1c
|
||||
.byte \local
|
||||
.byte \value
|
||||
.endm
|
||||
|
||||
@ Compares the value of the script data at index 'local' to the value at 'ptr'
|
||||
@ The result is stored in comparisonResult to be acted on by goto_if / call_if
|
||||
.macro compare_local_to_ptr local:req, ptr:req
|
||||
.byte 0x1d
|
||||
.byte \local
|
||||
.4byte \ptr
|
||||
.endm
|
||||
|
||||
@ Compares the value at 'ptr' to the value of the script data at index 'local'.
|
||||
@ The result is stored in comparisonResult to be acted on by goto_if / call_if
|
||||
.macro compare_ptr_to_local ptr:req, local:req
|
||||
.byte 0x1e
|
||||
.4byte \ptr
|
||||
.byte \local
|
||||
.endm
|
||||
|
||||
@ Compares the value at 'ptr' to a fixed value.
|
||||
@ The result is stored in comparisonResult to be acted on by goto_if / call_if
|
||||
.macro compare_ptr_to_value ptr:req, value:req
|
||||
.byte 0x1f
|
||||
.4byte \ptr
|
||||
.byte \value
|
||||
.endm
|
||||
|
||||
@ Compares the value at 'ptr1' to the value at 'ptr2'.
|
||||
@ The result is stored in comparisonResult to be acted on by goto_if / call_if
|
||||
.macro compare_ptr_to_ptr ptr1:req, ptr2:req
|
||||
.byte 0x20
|
||||
.4byte \ptr1
|
||||
.4byte \ptr2
|
||||
.endm
|
||||
|
||||
@ Compares the value of 'var' to a fixed value.
|
||||
@ The result is stored in comparisonResult to be acted on by goto_if / call_if
|
||||
.macro compare_var_to_value var:req, value:req
|
||||
.byte 0x21
|
||||
.2byte \var
|
||||
.2byte \value
|
||||
.endm
|
||||
|
||||
@ Compares the value of 'var1' to the value of 'var2'.
|
||||
@ The result is stored in comparisonResult to be acted on by goto_if / call_if
|
||||
.macro compare_var_to_var var1:req, var2:req
|
||||
.byte 0x22
|
||||
.2byte \var1
|
||||
.2byte \var2
|
||||
.endm
|
||||
|
||||
@ Generic compare macro which attempts to deduce argument types based on their values
|
||||
@ Any values between VARS_START to VARS_END and SPECIAL_VARS_START to SPECIAL_VARS_END are considered event variable identifiers
|
||||
.macro compare var:req, arg:req
|
||||
.if ((\arg >= VARS_START && \arg <= VARS_END) || (\arg >= SPECIAL_VARS_START && \arg <= SPECIAL_VARS_END))
|
||||
compare_var_to_var \var, \arg
|
||||
.else
|
||||
compare_var_to_value \var, \arg
|
||||
.endif
|
||||
.endm
|
||||
|
||||
@ Calls the native C function stored at func.
|
||||
.macro callnative func:req
|
||||
.byte 0x23
|
||||
.4byte \func
|
||||
.endm
|
||||
|
||||
@ Replaces the script with the function stored at func. Execution returns to the bytecode script when func returns TRUE.
|
||||
.macro gotonative func:req
|
||||
.byte 0x24
|
||||
.4byte \func
|
||||
.endm
|
||||
|
||||
@ Calls a function listed in the table in data/specials.inc.
|
||||
.macro special function:req
|
||||
.byte 0x25
|
||||
.2byte SPECIAL_\function
|
||||
.endm
|
||||
|
||||
@ Calls a function listed in the table in data/specials.inc.
|
||||
@ That function's output (if any) will be written to the variable specified by 'output'.
|
||||
.macro specialvar output:req, function:req
|
||||
.byte 0x26
|
||||
.2byte \output
|
||||
.2byte SPECIAL_\function
|
||||
.endm
|
||||
|
||||
@ Blocks script execution until a command or C code manually unblocks it. Generally used with specific
|
||||
@ commands and specials. Calling EnableBothScriptContexts for instance will allow execution to continue.
|
||||
.macro waitstate
|
||||
.byte 0x27
|
||||
.endm
|
||||
|
||||
@ Blocks script execution for frames. (Pokemon Emerald runs at just shy of 60 frames per second.)
|
||||
.macro delay frames:req
|
||||
.byte 0x28
|
||||
.2byte \frames
|
||||
.endm
|
||||
|
||||
@ Sets flag to TRUE.
|
||||
.macro setflag flag:req
|
||||
.byte 0x29
|
||||
.2byte \flag
|
||||
.endm
|
||||
|
||||
@ Sets flag to FALSE.
|
||||
.macro clearflag flag:req
|
||||
.byte 0x2a
|
||||
.2byte \flag
|
||||
.endm
|
||||
|
||||
@ Compares flag to TRUE and stores the result in comparisonResult to be used by goto_if, etc
|
||||
@ See additional _if_unset and _if_set macros
|
||||
.macro checkflag flag:req
|
||||
.byte 0x2b
|
||||
.2byte \flag
|
||||
.endm
|
||||
|
||||
@ Initializes the RTC`s local time offset to the given hour and minute.
|
||||
.macro initclock hour:req, minute:req
|
||||
.byte 0x2c
|
||||
.2byte \hour
|
||||
.2byte \minute
|
||||
.endm
|
||||
|
||||
@ Updates local time using the RTC and runs time based events.
|
||||
.macro dotimebasedevents
|
||||
.byte 0x2d
|
||||
.endm
|
||||
|
||||
@ Sets the values of variables VAR_0x8000, VAR_0x8001, and VAR_0x8002 to the current hour, minute, and second.
|
||||
.macro gettime
|
||||
.byte 0x2e
|
||||
.endm
|
||||
|
||||
@ Plays the specified sound. Only one sound may play at a time, with newer ones interrupting older ones.
|
||||
.macro playse song:req
|
||||
.byte 0x2f
|
||||
.2byte \song
|
||||
.endm
|
||||
|
||||
@ Blocks script execution until the currently-playing sound (triggered by playse) finishes playing.
|
||||
.macro waitse
|
||||
.byte 0x30
|
||||
.endm
|
||||
|
||||
@ Plays the fanfare specified by the song number. If the specified song is not a fanfare it will instead play the first song in sFanfares.
|
||||
.macro playfanfare song:req
|
||||
.byte 0x31
|
||||
.2byte \song
|
||||
.endm
|
||||
|
||||
@ Blocks script execution until all currently-playing fanfares finish.
|
||||
.macro waitfanfare
|
||||
.byte 0x32
|
||||
.endm
|
||||
|
||||
@ Plays the specified song. If save_song is TRUE, the
|
||||
@ specified song will be saved as if savebgm was called with it.
|
||||
.macro playbgm song:req, save_song:req
|
||||
.byte 0x33
|
||||
.2byte \song
|
||||
.byte \save_song
|
||||
.endm
|
||||
|
||||
@ Saves the specified song to be played later. Saved music may be played when Overworld_PlaySpecialMapMusic is called. This occurs on
|
||||
@ exiting most warps.
|
||||
.macro savebgm song:req
|
||||
.byte 0x34
|
||||
.2byte \song
|
||||
.endm
|
||||
|
||||
@ Crossfades the currently-playing song into the map's default song.
|
||||
.macro fadedefaultbgm
|
||||
.byte 0x35
|
||||
.endm
|
||||
|
||||
@ Crossfades the currently-playing song into the specified song.
|
||||
.macro fadenewbgm song:req
|
||||
.byte 0x36
|
||||
.2byte \song
|
||||
.endm
|
||||
|
||||
@ Fades out the currently-playing song.
|
||||
.macro fadeoutbgm speed:req
|
||||
.byte 0x37
|
||||
.byte \speed
|
||||
.endm
|
||||
|
||||
@ Fades the previously-playing song back in.
|
||||
.macro fadeinbgm speed:req
|
||||
.byte 0x38
|
||||
.byte \speed
|
||||
.endm
|
||||
|
||||
@ Helper macro for warp commands that formats their arguments.
|
||||
@ It allows warp macros to either provide 1. a valid id for which warp location to use,
|
||||
@ or 2. a pair of x/y coordinates to use. Both may be provided but at least one will be
|
||||
@ ignored by SetPlayerCoordsFromWarp. If none are provided it will use dummy arguments,
|
||||
@ and the warp will send the player to the center of the map.
|
||||
@ Examples of valid inputs for a warp command:
|
||||
@ - warp MAP, x, y
|
||||
@ - warp MAP, warpId
|
||||
@ - warp MAP
|
||||
@ - warp MAP, warpId, x, y
|
||||
.macro formatwarp map:req, a, b, c
|
||||
map \map
|
||||
.ifb \a @ No arguments provided, use dummy warpId and coords.
|
||||
.byte WARP_ID_NONE
|
||||
.2byte -1 @ x
|
||||
.2byte -1 @ y
|
||||
.else
|
||||
.ifb \b @ Only one argument provided, treat it as a warpId and use dummy coords.
|
||||
.byte \a @ warpId
|
||||
.2byte -1 @ x
|
||||
.2byte -1 @ y
|
||||
.else
|
||||
.ifb \c @ Only two arguments provided, treat them as a coord pair and use dummy warpId.
|
||||
.byte WARP_ID_NONE
|
||||
.2byte \a @ x
|
||||
.2byte \b @ y
|
||||
.else @ All three arguments provided. Output them and let the warp sort out which to use.
|
||||
.byte \a @ warpId
|
||||
.2byte \b @ x
|
||||
.2byte \c @ y
|
||||
.endif
|
||||
.endif
|
||||
.endif
|
||||
.endm
|
||||
|
||||
|
||||
@ Warps the player to the specified map.
|
||||
@ Warp commands can be given either the id of which warp location to go to on the destination map
|
||||
@ or a pair of x/y coordinates to go to directly on the destination map.
|
||||
.macro warp map:req, a, b, c
|
||||
.byte 0x39
|
||||
formatwarp \map, \a, \b, \c
|
||||
.endm
|
||||
|
||||
@ Warps the player to the specified map without playing a sound effect.
|
||||
@ Warp commands can be given either the id of which warp location to go to on the destination map
|
||||
@ or a pair of x/y coordinates to go to directly on the destination map.
|
||||
.macro warpsilent map:req, a, b, c
|
||||
.byte 0x3a
|
||||
formatwarp \map, \a, \b, \c
|
||||
.endm
|
||||
|
||||
@ Warps the player to the specified map and plays a door opening animation before stepping upwards into it.
|
||||
@ Warp commands can be given either the id of which warp location to go to on the destination map
|
||||
@ or a pair of x/y coordinates to go to directly on the destination map.
|
||||
.macro warpdoor map:req, a, b, c
|
||||
.byte 0x3b
|
||||
formatwarp \map, \a, \b, \c
|
||||
.endm
|
||||
|
||||
@ Warps the player to another map using a hole animation. If the specified map is MAP_UNDEFINED it will instead
|
||||
@ use the map set by setholewarp. In either case the target coordinates on the destination map will be the
|
||||
@ player's current position.
|
||||
.macro warphole map:req
|
||||
.byte 0x3c
|
||||
map \map
|
||||
.endm
|
||||
|
||||
@ Warps the player to the specified map using a teleport effect. Effect is similar to warpspinenter but
|
||||
@ this warp has a fade out first and doesn't maintain the original facing direction.
|
||||
@ Warp commands can be given either the id of which warp location to go to on the destination map
|
||||
@ or a pair of x/y coordinates to go to directly on the destination map.
|
||||
.macro warpteleport map:req, a, b, c
|
||||
.byte 0x3d
|
||||
formatwarp \map, \a, \b, \c
|
||||
.endm
|
||||
|
||||
@ Sets the warp destination to be used later.
|
||||
@ Warp commands can be given either the id of which warp location to go to on the destination map
|
||||
@ or a pair of x/y coordinates to go to directly on the destination map.
|
||||
.macro setwarp map:req, a, b, c
|
||||
.byte 0x3e
|
||||
formatwarp \map, \a, \b, \c
|
||||
.endm
|
||||
|
||||
@ Sets the dynamic warp destination. Warps with a destination map of MAP_NONE will target this destination.
|
||||
@ Warp commands can be given either the id of which warp location to go to on the destination map
|
||||
@ or a pair of x/y coordinates to go to directly on the destination map.
|
||||
.macro setdynamicwarp map:req, a, b, c
|
||||
.byte 0x3f
|
||||
formatwarp \map, \a, \b, \c
|
||||
.endm
|
||||
|
||||
@ Sets the destination that diving or emerging from a dive will take the player to. Note that this only
|
||||
@ applies if the current map does not have a dive/emerge connection. If it does have a corresponding
|
||||
@ map connection then that map and the player's current coordinates will be used as the destination instead.
|
||||
@ Warp commands can be given either the id of which warp location to go to on the destination map
|
||||
@ or a pair of x/y coordinates to go to directly on the destination map.
|
||||
.macro setdivewarp map:req, a, b, c
|
||||
.byte 0x40
|
||||
formatwarp \map, \a, \b, \c
|
||||
.endm
|
||||
|
||||
@ Sets the destination that falling into a hole will take the player to.
|
||||
@ While it does accept and set the x/y coordinates and warpId, they are ultimately ignored.
|
||||
@ This is only used to set the map the player should fall to. The exact location on the
|
||||
@ map to fall to is determined by warphole.
|
||||
@ Warp commands can be given either the id of which warp location to go to on the destination map
|
||||
@ or a pair of x/y coordinates to go to directly on the destination map.
|
||||
.macro setholewarp map:req, a=0, b=0, c
|
||||
.byte 0x41
|
||||
formatwarp \map, \a, \b, \c
|
||||
.endm
|
||||
|
||||
@ Retrieves the player's zero-indexed x- and y-coordinates in the map, and stores them in the specified variables.
|
||||
.macro getplayerxy x:req, y:req
|
||||
.byte 0x42
|
||||
.2byte \x
|
||||
.2byte \y
|
||||
.endm
|
||||
|
||||
@ Retrieves the number of Pokemon in the player's party, and stores that number in VAR_RESULT.
|
||||
.macro getpartysize
|
||||
.byte 0x43
|
||||
.endm
|
||||
|
||||
@ Attempts to add quantity of the specified item to the player's Bag. If the player has enough room, the item will
|
||||
@ be added and VAR_RESULT will be set to TRUE; otherwise, VAR_RESULT is set to FALSE.
|
||||
.macro additem itemId:req, quantity=1
|
||||
.byte 0x44
|
||||
.2byte \itemId
|
||||
.2byte \quantity
|
||||
.endm
|
||||
|
||||
@ Removes quantity of the specified item from the player's Bag. If the player has fewer than 'quantity' in their bag
|
||||
@ then none will be removed and VAR_RESULT will be set to FALSE. Otherwise it will be set to TRUE.
|
||||
.macro removeitem itemId:req, quantity=1
|
||||
.byte 0x45
|
||||
.2byte \itemId
|
||||
.2byte \quantity
|
||||
.endm
|
||||
|
||||
@ Checks if the player has enough space in their Bag to hold quantity more of the specified item. Sets VAR_RESULT to
|
||||
@ TRUE if there is room, or FALSE is there is no room.
|
||||
.macro checkitemspace itemId:req, quantity=1
|
||||
.byte 0x46
|
||||
.2byte \itemId
|
||||
.2byte \quantity
|
||||
.endm
|
||||
|
||||
@ Checks if the player has quantity or more of the specified item in their Bag. Sets VAR_RESULT to TRUE if the player has
|
||||
@ enough of the item, or FALSE if they have fewer than quantity of the item.
|
||||
.macro checkitem itemId:req, quantity=1
|
||||
.byte 0x47
|
||||
.2byte \itemId
|
||||
.2byte \quantity
|
||||
.endm
|
||||
|
||||
@ Checks which Bag pocket the specified item belongs in, and writes the pocket value (POCKET_*) to VAR_RESULT.
|
||||
@ This is used to show the name of the proper Bag pocket when the player receives an item via callstd.
|
||||
.macro checkitemtype itemId:req
|
||||
.byte 0x48
|
||||
.2byte \itemId
|
||||
.endm
|
||||
|
||||
@ Adds quantity of the specified item to the player's PC.
|
||||
.macro addpcitem itemId:req, quantity=1
|
||||
.byte 0x49
|
||||
.2byte \itemId
|
||||
.2byte \quantity
|
||||
.endm
|
||||
|
||||
@ Checks for quantity of the specified item in the player's PC.
|
||||
.macro checkpcitem itemId:req, quantity=1
|
||||
.byte 0x4a
|
||||
.2byte \itemId
|
||||
.2byte \quantity
|
||||
.endm
|
||||
|
||||
@ Adds a decoration to the player's PC.
|
||||
.macro adddecoration decoration:req
|
||||
.byte 0x4b
|
||||
.2byte \decoration
|
||||
.endm
|
||||
|
||||
@ Removes a decoration from the player's PC.
|
||||
.macro removedecoration decoration:req
|
||||
.byte 0x4c
|
||||
.2byte \decoration
|
||||
.endm
|
||||
|
||||
@ Checks for decoration in the player's PC.
|
||||
.macro checkdecor decoration:req
|
||||
.byte 0x4d
|
||||
.2byte \decoration
|
||||
.endm
|
||||
|
||||
@ Checks if the player has enough space in their PC to hold the decoration.
|
||||
@ Sets VAR_RESULT to TRUE if there is room, or FALSE is there is no room.
|
||||
.macro checkdecorspace decoration:req
|
||||
.byte 0x4e
|
||||
.2byte \decoration
|
||||
.endm
|
||||
|
||||
@ Applies the movement data at movements to the specified (localId) object. If no map is specified, then the current map is used.
|
||||
.macro applymovement localId:req, movements:req, map
|
||||
.ifb \map
|
||||
.byte 0x4f
|
||||
.2byte \localId
|
||||
.4byte \movements
|
||||
.else
|
||||
@ Really only useful if the object has followed from one map to another (e.g. Wally during the catching event).
|
||||
.byte 0x50
|
||||
.2byte \localId
|
||||
.4byte \movements
|
||||
map \map
|
||||
.endif
|
||||
.endm
|
||||
|
||||
@ Blocks script execution until the movements being applied to the specified (localId) object finish.
|
||||
@ If the specified object is 0, then the command will block script execution until all objects
|
||||
@ affected by applymovement finish their movements. If the specified object is not currently being
|
||||
@ manipulated with applymovement, then this command does nothing.
|
||||
@ If no map is specified, then the current map is used.
|
||||
.macro waitmovement localId:req, map
|
||||
.ifb \map
|
||||
.byte 0x51
|
||||
.2byte \localId
|
||||
.else
|
||||
.byte 0x52
|
||||
.2byte \localId
|
||||
map \map
|
||||
.endif
|
||||
.endm
|
||||
|
||||
@ Attempts to despawn the specified (localId) object on the specified map.
|
||||
@ It also sets the object's visibility flag if it has one.
|
||||
@ If no map is specified, then the current map is used.
|
||||
.macro removeobject localId:req, map
|
||||
.ifb \map
|
||||
.byte 0x53
|
||||
.2byte \localId
|
||||
.else
|
||||
.byte 0x54
|
||||
.2byte \localId
|
||||
map \map
|
||||
.endif
|
||||
.endm
|
||||
|
||||
@ Attempts to spawn the specified (localId) object the specified map.
|
||||
@ Note that unlike removeobject this does not modify the object's flag.
|
||||
@ If no map is specified, then the current map is used.
|
||||
.macro addobject localId:req, map
|
||||
.ifb \map
|
||||
.byte 0x55
|
||||
.2byte \localId
|
||||
.else
|
||||
.byte 0x56
|
||||
.2byte \localId
|
||||
map \map
|
||||
.endif
|
||||
.endm
|
||||
|
||||
@ Sets the specified (localId) object's position on the current map.
|
||||
.macro setobjectxy localId:req, x:req, y:req
|
||||
.byte 0x57
|
||||
.2byte \localId
|
||||
.2byte \x
|
||||
.2byte \y
|
||||
.endm
|
||||
|
||||
@ Sets the specified object's invisibility to FALSE.
|
||||
.macro showobjectat localId:req, map:req
|
||||
.byte 0x58
|
||||
.2byte \localId
|
||||
map \map
|
||||
.endm
|
||||
|
||||
@ Sets the specified object's invisibility to TRUE.
|
||||
.macro hideobjectat localId:req, map:req
|
||||
.byte 0x59
|
||||
.2byte \localId
|
||||
map \map
|
||||
.endm
|
||||
|
||||
@ Turns the currently selected object (if there is one) to face the player.
|
||||
.macro faceplayer
|
||||
.byte 0x5a
|
||||
.endm
|
||||
|
||||
@ Turns the specified object in the specified direction.
|
||||
.macro turnobject localId:req, direction:req
|
||||
.byte 0x5b
|
||||
.2byte \localId
|
||||
.byte \direction
|
||||
.endm
|
||||
|
||||
@ Configures the arguments for a trainer battle, then jumps to the appropriate script in scripts/trainer_battle.inc
|
||||
.macro trainerbattle type:req, trainer:req, local_id:req, pointer1:req, pointer2, pointer3, pointer4
|
||||
.byte 0x5c
|
||||
.byte \type
|
||||
.2byte \trainer
|
||||
.2byte \local_id
|
||||
.if \type == TRAINER_BATTLE_SINGLE
|
||||
.4byte \pointer1 @ text
|
||||
.4byte \pointer2 @ text
|
||||
.elseif \type == TRAINER_BATTLE_CONTINUE_SCRIPT_NO_MUSIC
|
||||
.4byte \pointer1 @ text
|
||||
.4byte \pointer2 @ text
|
||||
.4byte \pointer3 @ event script
|
||||
.elseif \type == TRAINER_BATTLE_CONTINUE_SCRIPT
|
||||
.4byte \pointer1 @ text
|
||||
.4byte \pointer2 @ text
|
||||
.4byte \pointer3 @ event script
|
||||
.elseif \type == TRAINER_BATTLE_SINGLE_NO_INTRO_TEXT
|
||||
.4byte \pointer1 @ text
|
||||
.elseif \type == TRAINER_BATTLE_DOUBLE
|
||||
.4byte \pointer1 @ text
|
||||
.4byte \pointer2 @ text
|
||||
.4byte \pointer3 @ text
|
||||
.elseif \type == TRAINER_BATTLE_REMATCH
|
||||
.4byte \pointer1 @ text
|
||||
.4byte \pointer2 @ text
|
||||
.elseif \type == TRAINER_BATTLE_CONTINUE_SCRIPT_DOUBLE
|
||||
.4byte \pointer1 @ text
|
||||
.4byte \pointer2 @ text
|
||||
.4byte \pointer3 @ text
|
||||
.4byte \pointer4 @ event script
|
||||
.elseif \type == TRAINER_BATTLE_REMATCH_DOUBLE
|
||||
.4byte \pointer1 @ text
|
||||
.4byte \pointer2 @ text
|
||||
.4byte \pointer3 @ text
|
||||
.elseif \type == TRAINER_BATTLE_CONTINUE_SCRIPT_DOUBLE_NO_MUSIC
|
||||
.4byte \pointer1 @ text
|
||||
.4byte \pointer2 @ text
|
||||
.4byte \pointer3 @ text
|
||||
.4byte \pointer4 @ event script
|
||||
.elseif \type == TRAINER_BATTLE_PYRAMID
|
||||
.4byte \pointer1 @ text
|
||||
.4byte \pointer2 @ text
|
||||
.elseif \type == TRAINER_BATTLE_SET_TRAINER_A
|
||||
.4byte \pointer1 @ text
|
||||
.4byte \pointer2 @ text
|
||||
.elseif \type == TRAINER_BATTLE_SET_TRAINER_B
|
||||
.4byte \pointer1 @ text
|
||||
.4byte \pointer2 @ text
|
||||
.elseif \type == TRAINER_BATTLE_HILL
|
||||
.4byte \pointer1 @ text
|
||||
.4byte \pointer2 @ text
|
||||
.endif
|
||||
.endm
|
||||
|
||||
NO_MUSIC = FALSE
|
||||
|
||||
@ Starts a single trainer battle. Takes a trainer, intro text, loss text, and an optional event script.
|
||||
@ When used with an event script, you can also pass in an optional flag to disable music
|
||||
.macro trainerbattle_single trainer:req, intro_text:req, lose_text:req, event_script=FALSE, music=TRUE
|
||||
.if \event_script == FALSE
|
||||
trainerbattle TRAINER_BATTLE_SINGLE, \trainer, 0, \intro_text, \lose_text
|
||||
.elseif \music == TRUE
|
||||
trainerbattle TRAINER_BATTLE_CONTINUE_SCRIPT, \trainer, 0, \intro_text, \lose_text, \event_script
|
||||
.else
|
||||
trainerbattle TRAINER_BATTLE_CONTINUE_SCRIPT_NO_MUSIC, \trainer, 0, \intro_text, \lose_text, \event_script
|
||||
.endif
|
||||
.endm
|
||||
|
||||
@ Starts a double trainer battle. Takes a trainer, intro text, loss text, text for when you have too few pokemon
|
||||
@ and an optional event script. When used with an event script you can pass in an optional flag to disable music
|
||||
.macro trainerbattle_double trainer:req, intro_text:req, lose_text:req, not_enough_pkmn_text:req, event_script=FALSE, music=TRUE
|
||||
.if \event_script == FALSE
|
||||
trainerbattle TRAINER_BATTLE_DOUBLE, \trainer, 0, \intro_text, \lose_text, \not_enough_pkmn_text
|
||||
.elseif \music == TRUE
|
||||
trainerbattle TRAINER_BATTLE_CONTINUE_SCRIPT_DOUBLE, \trainer, 0, \intro_text, \lose_text, \not_enough_pkmn_text, \event_script
|
||||
.else
|
||||
trainerbattle TRAINER_BATTLE_CONTINUE_SCRIPT_DOUBLE_NO_MUSIC, \trainer, 0, \intro_text, \lose_text, \not_enough_pkmn_text, \event_script
|
||||
.endif
|
||||
.endm
|
||||
|
||||
@ Starts a rematch battle. Takes a trainer, intro text and loss text
|
||||
.macro trainerbattle_rematch trainer:req, intro_text:req, lose_text:req
|
||||
trainerbattle TRAINER_BATTLE_REMATCH, \trainer, 0, \intro_text, \lose_text
|
||||
.endm
|
||||
|
||||
@ Starts a rematch double battle. Takes a trainer, intro text, loss text, and text for when you have too few pokemon
|
||||
.macro trainerbattle_rematch_double trainer:req, intro_text:req, lose_text:req, not_enough_pkmn_text:req
|
||||
trainerbattle TRAINER_BATTLE_REMATCH_DOUBLE, \trainer, 0, \intro_text, \lose_text, \not_enough_pkmn_text
|
||||
.endm
|
||||
|
||||
@ Starts a trainer battle, skipping intro text. Takes a trainer and loss text
|
||||
.macro trainerbattle_no_intro trainer:req, lose_text:req
|
||||
trainerbattle TRAINER_BATTLE_SINGLE_NO_INTRO_TEXT, \trainer, 0, \lose_text
|
||||
.endm
|
||||
|
||||
|
||||
@ Starts a trainer battle using the battle information stored in RAM (usually by the scripts in trainer_battle.inc, which
|
||||
@ are run by trainerbattle), and blocks script execution until the battle finishes.
|
||||
.macro dotrainerbattle
|
||||
.byte 0x5d
|
||||
.endm
|
||||
|
||||
@ Goes to address after the trainerbattle command (called by the battle functions, see battle_setup.c)
|
||||
.macro gotopostbattlescript
|
||||
.byte 0x5e
|
||||
.endm
|
||||
|
||||
@ Goes to address specified in the trainerbattle command (called by the battle functions, see battle_setup.c)
|
||||
.macro gotobeatenscript
|
||||
.byte 0x5f
|
||||
.endm
|
||||
|
||||
@ Checks if the trainer has been defeated by the player (by comparing the flag 'trainer + TRAINER_FLAGS_START' to TRUE).
|
||||
.macro checktrainerflag trainer:req
|
||||
.byte 0x60
|
||||
.2byte \trainer
|
||||
.endm
|
||||
|
||||
@ Sets the trainer flag (trainer + TRAINER_FLAGS_START) to TRUE (defeated).
|
||||
.macro settrainerflag trainer:req
|
||||
.byte 0x61
|
||||
.2byte \trainer
|
||||
.endm
|
||||
|
||||
@ Sets the trainer flag (trainer + TRAINER_FLAGS_START) to FALSE (not defeated).
|
||||
.macro cleartrainerflag trainer:req
|
||||
.byte 0x62
|
||||
.2byte \trainer
|
||||
.endm
|
||||
|
||||
@ Sets the coordinates of an object's template, so that if the sprite goes off screen
|
||||
@ it'll still be there when it comes back on screen.
|
||||
.macro setobjectxyperm localId:req, x:req, y:req
|
||||
.byte 0x63
|
||||
.2byte \localId
|
||||
.2byte \x
|
||||
.2byte \y
|
||||
.endm
|
||||
|
||||
@ Copies a live object event's xy position to its template, so that if the sprite goes off screen
|
||||
@ it'll still be there when it comes back on screen.
|
||||
.macro copyobjectxytoperm localId:req
|
||||
.byte 0x64
|
||||
.2byte \localId
|
||||
.endm
|
||||
|
||||
@ Sets the movement type (MOVEMENT_TYPE_*) for an object's template.
|
||||
.macro setobjectmovementtype word:req, byte:req
|
||||
.byte 0x65
|
||||
.2byte \word
|
||||
.byte \byte
|
||||
.endm
|
||||
|
||||
@ If a standard message box (or its text) is being drawn on-screen, this command blocks script execution until the
|
||||
@ box and its text have been fully drawn.
|
||||
.macro waitmessage
|
||||
.byte 0x66
|
||||
.endm
|
||||
|
||||
@ Starts displaying a standard message box containing the specified text. If text is a pointer, then the string at
|
||||
@ that offset will be loaded and used. If text is NULL, then the value of script data 0 will be treated as
|
||||
@ a pointer to the text. The 'loadword 0' in msgbox sets this value, for instance.
|
||||
.macro message text:req
|
||||
.byte 0x67
|
||||
.4byte \text
|
||||
.endm
|
||||
|
||||
@ Closes the current message box.
|
||||
.macro closemessage
|
||||
.byte 0x68
|
||||
.endm
|
||||
|
||||
@ Freezes all objects immediately except the player. The player is frozen once their movement is finished.
|
||||
.macro lockall
|
||||
.byte 0x69
|
||||
.endm
|
||||
|
||||
@ Freezes all objects immediately except the player and the selected object. The player and selected object are frozen once their movement is finished.
|
||||
.macro lock
|
||||
.byte 0x6a
|
||||
.endm
|
||||
|
||||
@ Resumes normal movement for all objects on-screen, and closes any standard message boxes that are still open.
|
||||
.macro releaseall
|
||||
.byte 0x6b
|
||||
.endm
|
||||
|
||||
@ Resumes normal movement for the selected object (if there is one) and the player. Also closes any standard message boxes that are still open.
|
||||
.macro release
|
||||
.byte 0x6c
|
||||
.endm
|
||||
|
||||
@ Blocks script execution until the player presses the A or B button.
|
||||
.macro waitbuttonpress
|
||||
.byte 0x6d
|
||||
.endm
|
||||
|
||||
@ Displays a YES/NO multichoice box at the specified coordinates, and blocks script execution until the user makes a selection.
|
||||
@ Their selection is stored in VAR_RESULT as NO (0) or YES (1). Pressing B is equivalent to answering NO
|
||||
.macro yesnobox x:req, y:req
|
||||
.byte 0x6e
|
||||
.byte \x
|
||||
.byte \y
|
||||
.endm
|
||||
|
||||
@ Displays a multichoice box from which the user can choose a selection, and blocks script execution until a selection is made.
|
||||
@ Lists of options are predefined (sMultichoiceLists) and the one to be used is specified with multichoiceId.
|
||||
@ If ignoreBPress is set to a non-zero value, then the user will not be allowed to back out of the multichoice with the B button.
|
||||
.macro multichoice x:req, y:req, multichoiceId:req, ignoreBPress:req
|
||||
.byte 0x6f
|
||||
.byte \x
|
||||
.byte \y
|
||||
.byte \multichoiceId
|
||||
.byte \ignoreBPress
|
||||
.endm
|
||||
|
||||
@ Displays a multichoice box from which the user can choose a selection, and blocks script execution until a selection is made.
|
||||
@ Lists of options are predefined (sMultichoiceLists) and the one to be used is specified with multichoiceId.
|
||||
@ The default argument determines the initial position of the cursor when the box is first opened; it is zero-indexed, and if it is too large, it is treated as 0.
|
||||
@ If ignoreBPress is set to a non-zero value, then the user will not be allowed to back out of the multichoice with the B button.
|
||||
.macro multichoicedefault x:req, y:req, multichoiceId:req, default:req, ignoreBPress:req
|
||||
.byte 0x70
|
||||
.byte \x
|
||||
.byte \y
|
||||
.byte \multichoiceId
|
||||
.byte \default
|
||||
.byte \ignoreBPress
|
||||
.endm
|
||||
|
||||
@ Displays a multichoice box from which the user can choose a selection, and blocks script execution until a selection is made.
|
||||
@ Lists of options are predefined (sMultichoiceLists) and the one to be used is specified with multichoiceId.
|
||||
@ The per_row argument determines how many list items will be shown on a single row of the box.
|
||||
@ If ignoreBPress is set to a non-zero value, then the user will not be allowed to back out of the multichoice with the B button.
|
||||
.macro multichoicegrid x:req, y:req, multichoiceId:req, per_row:req, ignoreBPress:req
|
||||
.byte 0x71
|
||||
.byte \x
|
||||
.byte \y
|
||||
.byte \multichoiceId
|
||||
.byte \per_row
|
||||
.byte \ignoreBPress
|
||||
.endm
|
||||
|
||||
@ Nopped in Emerald.
|
||||
.macro drawbox
|
||||
.byte 0x72
|
||||
.endm
|
||||
|
||||
@ Nopped in Emerald, but still consumes parameters.
|
||||
.macro erasebox left:req, top:req, right:req, bottom:req
|
||||
.byte 0x73
|
||||
.byte \left
|
||||
.byte \top
|
||||
.byte \right
|
||||
.byte \bottom
|
||||
.endm
|
||||
|
||||
@ Nopped in Emerald, but still consumes parameters.
|
||||
.macro drawboxtext left:req, top:req, multichoiceId:req, ignoreBPress:req
|
||||
.byte 0x74
|
||||
.byte \left
|
||||
.byte \top
|
||||
.byte \multichoiceId
|
||||
.byte \ignoreBPress
|
||||
.endm
|
||||
|
||||
@ Displays a box containing the front sprite for the specified Pokemon species.
|
||||
.macro showmonpic species:req, x:req, y:req
|
||||
.byte 0x75
|
||||
.2byte \species
|
||||
.byte \x
|
||||
.byte \y
|
||||
.endm
|
||||
|
||||
@ Hides the box displayed by showmonpic.
|
||||
.macro hidemonpic
|
||||
.byte 0x76
|
||||
.endm
|
||||
|
||||
@ Draws an image of the winner of the contest. winnerId is any CONTEST_WINNER_* constant.
|
||||
.macro showcontestpainting winnerId:req
|
||||
.byte 0x77
|
||||
.byte \winnerId
|
||||
.endm
|
||||
|
||||
@ Displays the given string as braille text in a standard message box. The string should use the .braille directive
|
||||
@ to convert text to braille, and be preceded by brailleformat. The brailleformat data is skipped over (in RS, these
|
||||
@ bytes determined the box's size and position, but in Emerald these are calculated automatically).
|
||||
.macro braillemessage text:req
|
||||
.byte 0x78
|
||||
.4byte \text
|
||||
.endm
|
||||
|
||||
@ Formatting for the braille window, to be put at the start of a pointer used by braillemessage.
|
||||
@ These are from RS and are ignored in Emerald (see ScrCmd_braillemessage, and comment above)
|
||||
.macro brailleformat winLeft:req, winTop:req, winRight:req, winBottom:req, textLeft:req, textTop:req
|
||||
.byte \winLeft
|
||||
.byte \winTop
|
||||
.byte \winRight
|
||||
.byte \winBottom
|
||||
.byte \textLeft
|
||||
.byte \textTop
|
||||
.endm
|
||||
|
||||
@ Gives the player a Pokémon of the specified species and level, holding the specified item. The trailing 0s are unused parameters.
|
||||
@ VAR_RESULT will be set to MON_GIVEN_TO_PARTY, MON_GIVEN_TO_PC, or MON_CANT_GIVE depending on the outcome.
|
||||
.macro givemon species:req, level:req, item:req
|
||||
.byte 0x79
|
||||
.2byte \species
|
||||
.byte \level
|
||||
.2byte \item
|
||||
.4byte 0
|
||||
.4byte 0
|
||||
.byte 0
|
||||
.endm
|
||||
|
||||
@ Gives the player an Egg of the specified species.
|
||||
@ VAR_RESULT will be set to MON_GIVEN_TO_PARTY, MON_GIVEN_TO_PC, or MON_CANT_GIVE depending on the outcome.
|
||||
.macro giveegg species:req
|
||||
.byte 0x7a
|
||||
.2byte \species
|
||||
.endm
|
||||
|
||||
@ Replaces the move at 'slot' of the Pokémon in the player's party at 'partyIndex' with the specified move.
|
||||
@ If a value greater than PARTY_SIZE is given for partyIndex it will use the last Pokémon in the party instead.
|
||||
@ Note that this means in vanilla a value equal to PARTY_SIZE for partyIndex will go out of bounds.
|
||||
.macro setmonmove partyIndex:req, slot:req, move:req
|
||||
.byte 0x7b
|
||||
.byte \partyIndex
|
||||
.byte \slot
|
||||
.2byte \move
|
||||
.endm
|
||||
|
||||
@ Checks if at least one Pokemon in the player's party knows the specified move. If so, VAR_RESULT is set to the
|
||||
@ (zero-indexed) slot number of the first Pokemon that knows the move. If not, VAR_RESULT is set to PARTY_SIZE.
|
||||
@ VAR_0x8004 is also set to this Pokemon's species.
|
||||
.macro checkpartymove move:req
|
||||
.byte 0x7c
|
||||
.2byte \move
|
||||
.endm
|
||||
|
||||
@ Converts STR_VAR_1, STR_VAR_2, or STR_VAR_3 to its corresponding index into sScriptStringVars (0, 1, or 2).
|
||||
@ If given anything else it will output it directly.
|
||||
@ Note: Because the STR_VAR_# arguments given to this macro are not part of a processed string they are not
|
||||
@ replaced with their charmap values, they are just passed as the literal characters "STR_VAR_#".
|
||||
.macro stringvar id:req
|
||||
.if \id == STR_VAR_1
|
||||
.byte 0
|
||||
.elseif \id == STR_VAR_2
|
||||
.byte 1
|
||||
.elseif \id == STR_VAR_3
|
||||
.byte 2
|
||||
.else
|
||||
.byte \id
|
||||
.endif
|
||||
.endm
|
||||
|
||||
@ Writes the name of the given Pokemon species to the specified buffer.
|
||||
.macro bufferspeciesname stringVarId:req, species:req
|
||||
.byte 0x7d
|
||||
stringvar \stringVarId
|
||||
.2byte \species
|
||||
.endm
|
||||
|
||||
@ Writes the name of the species of the first Pokemon in the player's party to the specified buffer.
|
||||
.macro bufferleadmonspeciesname stringVarId:req
|
||||
.byte 0x7e
|
||||
stringvar \stringVarId
|
||||
.endm
|
||||
|
||||
@ Writes the nickname of the Pokemon in 'slot' (zero-indexed) of the player's party to the specified buffer.
|
||||
@ If an empty or invalid slot is specified, ten spaces ("") are written to the buffer.
|
||||
.macro bufferpartymonnick stringVarId:req, slot:req
|
||||
.byte 0x7f
|
||||
stringvar \stringVarId
|
||||
.2byte \slot
|
||||
.endm
|
||||
|
||||
@ Writes the name of the specified item to the specified buffer. If itemId is >= ITEMS_COUNT,
|
||||
@ then the name of ITEM_NONE ("????????") is buffered instead.
|
||||
.macro bufferitemname stringVarId:req, item:req
|
||||
.byte 0x80
|
||||
stringvar \stringVarId
|
||||
.2byte \item
|
||||
.endm
|
||||
|
||||
@ Writes the name of the specified decoration to the specified buffer.
|
||||
.macro bufferdecorationname stringVarId:req, decoration:req
|
||||
.byte 0x81
|
||||
stringvar \stringVarId
|
||||
.2byte \decoration
|
||||
.endm
|
||||
|
||||
@ Writes the name of the specified move to the specified buffer.
|
||||
.macro buffermovename stringVarId:req, move:req
|
||||
.byte 0x82
|
||||
stringvar \stringVarId
|
||||
.2byte \move
|
||||
.endm
|
||||
|
||||
@ Converts the value of input to a decimal string, and writes that string to the specified buffer.
|
||||
.macro buffernumberstring stringVarId:req, input:req
|
||||
.byte 0x83
|
||||
stringvar \stringVarId
|
||||
.2byte \input
|
||||
.endm
|
||||
|
||||
@ Writes the given standard string (STDSTRING_*) to the specified buffer. Invalid std string ids are not handled.
|
||||
.macro bufferstdstring stringVarId:req, index:req
|
||||
.byte 0x84
|
||||
stringvar \stringVarId
|
||||
.2byte \index
|
||||
.endm
|
||||
|
||||
@ Copies the string at the given pointer to the specified buffer.
|
||||
.macro bufferstring stringVarId:req, text:req
|
||||
.byte 0x85
|
||||
stringvar \stringVarId
|
||||
.4byte \text
|
||||
.endm
|
||||
|
||||
@ Opens the Pokemart system, offering the specified products for sale.
|
||||
@ Products should be a list of .2byte item values preceded by an .align 2
|
||||
.macro pokemart products:req
|
||||
.byte 0x86
|
||||
.4byte \products
|
||||
.endm
|
||||
|
||||
@ Opens the Pokemart system and treats the list of items as decorations.
|
||||
@ Products should be a list of .2byte decoration values preceded by an .align 2
|
||||
.macro pokemartdecoration products:req
|
||||
.byte 0x87
|
||||
.4byte \products
|
||||
.endm
|
||||
|
||||
@ Identical to pokemartdecoration, but with slight changes to the clerk dialogue. See uses of MART_TYPE_DECOR2.
|
||||
.macro pokemartdecoration2 products:req
|
||||
.byte 0x88
|
||||
.4byte \products
|
||||
.endm
|
||||
|
||||
@ Starts up the slot machine minigame. id is a SLOT_MACHINE_* value that influences probabilities of certain reel outcomes.
|
||||
.macro playslotmachine id:req
|
||||
.byte 0x89
|
||||
.2byte \id
|
||||
.endm
|
||||
|
||||
@ Sets a berry tree's berry and growth stage. treeId is any BERRY_TREE_* constant (an index into berryTrees in SaveBlock1),
|
||||
@ berry is any ITEM_TO_BERRY(ITEM_BERRY_NAME) value, and growthStage is any BERRY_STAGE_* constant.
|
||||
.macro setberrytree treeId:req, berry:req, growthStage:req
|
||||
.byte 0x8a
|
||||
.byte \treeId
|
||||
.byte \berry
|
||||
.byte \growthStage
|
||||
.endm
|
||||
|
||||
@ Opens the party menu to select a Pokemon for a contest.
|
||||
.macro choosecontestmon
|
||||
.byte 0x8b
|
||||
.endm
|
||||
|
||||
@ Starts the appeals round of a contest.
|
||||
.macro startcontest
|
||||
.byte 0x8c
|
||||
.endm
|
||||
|
||||
@ Shows the results screen of a contest.
|
||||
.macro showcontestresults
|
||||
.byte 0x8d
|
||||
.endm
|
||||
|
||||
@ Starts communication to initialize a link contest.
|
||||
.macro contestlinktransfer
|
||||
.byte 0x8e
|
||||
.endm
|
||||
|
||||
@ Stores a random integer between 0 and limit (exclusive of limit) in VAR_RESULT.
|
||||
.macro random limit:req
|
||||
.byte 0x8f
|
||||
.2byte \limit
|
||||
.endm
|
||||
|
||||
@ Adds value to the player's money. If adding 'value' money would exceed MAX_MONEY, the player's money is set to MAX_MONEY.
|
||||
@ If 'disable' is set to anything but 0 then this command does nothing.
|
||||
.macro addmoney value:req, disable=0
|
||||
.byte 0x90
|
||||
.4byte \value
|
||||
.byte \disable
|
||||
.endm
|
||||
|
||||
@ Subtracts value from the player's money. If the player has less than 'value' money, their money is set to 0.
|
||||
@ If 'disable' is set to anything but 0 then this command does nothing.
|
||||
.macro removemoney value:req, disable=0
|
||||
.byte 0x91
|
||||
.4byte \value
|
||||
.byte \disable
|
||||
.endm
|
||||
|
||||
@ Checks if the player has money >= value. VAR_RESULT is set to TRUE if the player has enough money, or FALSE if they do not.
|
||||
@ If 'disable' is set to anything but 0 then this command does nothing.
|
||||
.macro checkmoney value:req, disable=0
|
||||
.byte 0x92
|
||||
.4byte \value
|
||||
.byte \disable
|
||||
.endm
|
||||
|
||||
@ Creates a window showing how much money the player has.
|
||||
@ If 'disable' is set to anything but 0 then this command does nothing.
|
||||
.macro showmoneybox x:req, y:req, disable=0
|
||||
.byte 0x93
|
||||
.byte \x
|
||||
.byte \y
|
||||
.byte \disable
|
||||
.endm
|
||||
|
||||
@ Destroys the window created by showmoneybox. Consumption of the x and y arguments was dummied out.
|
||||
.macro hidemoneybox
|
||||
.byte 0x94
|
||||
.byte 0 @ \x
|
||||
.byte 0 @ \y
|
||||
.endm
|
||||
|
||||
@ Updates the window created by showmoneybox. Consumption of the x and y arguments was dummied out.
|
||||
@ If 'disable' is set to anything but 0 then this command does nothing.
|
||||
.macro updatemoneybox disable=0
|
||||
.byte 0x95
|
||||
.byte 0 @ \x
|
||||
.byte 0 @ \y
|
||||
.byte \disable
|
||||
.endm
|
||||
|
||||
@ Gets whether the effects of the specified PokeNews program are active. newsKind is a POKENEWS_* constant.
|
||||
.macro getpokenewsactive newsKind:req
|
||||
.byte 0x96
|
||||
.2byte \newsKind
|
||||
.endm
|
||||
|
||||
@ Fades the screen to and from black and white. Modes are FADE_(TO/FROM)_(WHITE/BLACK)
|
||||
.macro fadescreen mode:req
|
||||
.byte 0x97
|
||||
.byte \mode
|
||||
.endm
|
||||
|
||||
@ Fades the screen to and from black and white. Modes are FADE_(TO/FROM)_(WHITE/BLACK)
|
||||
.macro fadescreenspeed mode:req, speed:req
|
||||
.byte 0x98
|
||||
.byte \mode
|
||||
.byte \speed
|
||||
.endm
|
||||
|
||||
@ Sets the flash level. A level of 0 is fully bright, a level of 1 is the largest flash radius, a level
|
||||
@ of 7 is the smallest flash radius, a level of 8 is fully black.
|
||||
.macro setflashlevel level:req
|
||||
.byte 0x99
|
||||
.2byte \level
|
||||
.endm
|
||||
|
||||
@ Animates the flash radius from its current size to the size it would be at the specified level.
|
||||
@ Note that this does not actually change the current flash level. It's typically used just before a setflashlevel.
|
||||
.macro animateflash level:req
|
||||
.byte 0x9a
|
||||
.byte \level
|
||||
.endm
|
||||
|
||||
@ Automatically scrolls through the message without player input and at a fixed speed.
|
||||
.macro messageautoscroll text:req
|
||||
.byte 0x9b
|
||||
.4byte \text
|
||||
.endm
|
||||
|
||||
@ Executes the specified field effect animation (FLDEFF_*).
|
||||
.macro dofieldeffect animation:req
|
||||
.byte 0x9c
|
||||
.2byte \animation
|
||||
.endm
|
||||
|
||||
@ Sets the field effect argument at index 'argNum' to 'value.'
|
||||
.macro setfieldeffectargument argNum:req, value:req
|
||||
.byte 0x9d
|
||||
.byte \argNum
|
||||
.2byte \value
|
||||
.endm
|
||||
|
||||
@ Blocks script execution until all playing field effect animations complete.
|
||||
.macro waitfieldeffect animation:req
|
||||
.byte 0x9e
|
||||
.2byte \animation
|
||||
.endm
|
||||
|
||||
@ Sets which healing location (HEAL_LOCATION_*) the player will return to if all of the Pokemon in their party faint.
|
||||
.macro setrespawn heallocation:req
|
||||
.byte 0x9f
|
||||
.2byte \heallocation
|
||||
.endm
|
||||
|
||||
@ Checks the player's gender. Stores the result (MALE (0) or FEMALE (1)) in VAR_RESULT.
|
||||
.macro checkplayergender
|
||||
.byte 0xa0
|
||||
.endm
|
||||
|
||||
@ Plays the cry of the given species. Mode is any CRY_MODE_* constant.
|
||||
@ You can use waitmoncry to block script execution until the cry finishes.
|
||||
.macro playmoncry species:req, mode:req
|
||||
.byte 0xa1
|
||||
.2byte \species
|
||||
.2byte \mode
|
||||
.endm
|
||||
|
||||
@ Set the metatile at (x, y) on the current map to the given metatile and impassability.
|
||||
.macro setmetatile x:req, y:req, metatileId:req, impassable:req
|
||||
.byte 0xa2
|
||||
.2byte \x
|
||||
.2byte \y
|
||||
.2byte \metatileId
|
||||
.2byte \impassable
|
||||
.endm
|
||||
|
||||
@ Queues a weather change to the default weather for the map.
|
||||
.macro resetweather
|
||||
.byte 0xa3
|
||||
.endm
|
||||
|
||||
@ Queues a weather change to type weather.
|
||||
.macro setweather type:req
|
||||
.byte 0xa4
|
||||
.2byte \type
|
||||
.endm
|
||||
|
||||
@ Executes the weather change queued with resetweather or setweather. The current weather will smoothly fade into the queued weather.
|
||||
.macro doweather
|
||||
.byte 0xa5
|
||||
.endm
|
||||
|
||||
@ Enables the overworld task specified by stepCbId (STEP_CB_*). Only 1 can be active at a time. See src/field_tasks.c for more.
|
||||
.macro setstepcallback stepCbId:req
|
||||
.byte 0xa6
|
||||
.byte \stepCbId
|
||||
.endm
|
||||
|
||||
@ Sets the current map layout to the one specified by index (LAYOUT_*).
|
||||
@ This should be done before the layout is loaded, typically in the ON_TRANSITION map script.
|
||||
.macro setmaplayoutindex index:req
|
||||
.byte 0xa7
|
||||
.2byte \index
|
||||
.endm
|
||||
|
||||
@ Sets the specified object's sprite's subpriority, and sets fixedPriority to TRUE.
|
||||
@ Only used to hide the player and Briney behind the boat.
|
||||
.macro setobjectsubpriority localId:req, map:req, subpriority:req
|
||||
.byte 0xa8
|
||||
.2byte \localId
|
||||
map \map
|
||||
.byte \subpriority
|
||||
.endm
|
||||
|
||||
@ Sets the specified object's fixedPriority to FALSE. Does not change the subpriority field.
|
||||
.macro resetobjectsubpriority localId:req, map:req
|
||||
.byte 0xa9
|
||||
.2byte \localId
|
||||
map \map
|
||||
.endm
|
||||
|
||||
@ Creates a sprite with object graphics. Used when creating large groups of static NPCs that exceed
|
||||
@ the object event limit (e.g. Contest / Battle Dome audiences and Union Room group members).
|
||||
@ The specified id can be used to refer to the sprite again later with turnvobject.
|
||||
.macro createvobject graphicsId:req, id:req, x:req, y:req, elevation=3, direction=DIR_SOUTH
|
||||
.byte 0xaa
|
||||
.2byte \graphicsId
|
||||
.byte \id
|
||||
.2byte \x
|
||||
.2byte \y
|
||||
.byte \elevation
|
||||
.byte \direction
|
||||
.endm
|
||||
|
||||
@ Turns a sprite created with createvobject.
|
||||
.macro turnvobject id:req, direction:req
|
||||
.byte 0xab
|
||||
.byte \id
|
||||
.byte \direction
|
||||
.endm
|
||||
|
||||
@ Opens the door metatile at (x, y) with an animation.
|
||||
.macro opendoor x:req, y:req
|
||||
.byte 0xac
|
||||
.2byte \x
|
||||
.2byte \y
|
||||
.endm
|
||||
|
||||
@ Closes the door metatile at (x, y) with an animation.
|
||||
.macro closedoor x:req, y:req
|
||||
.byte 0xad
|
||||
.2byte \x
|
||||
.2byte \y
|
||||
.endm
|
||||
|
||||
@ Waits for the door animation started with opendoor or closedoor to finish.
|
||||
.macro waitdooranim
|
||||
.byte 0xae
|
||||
.endm
|
||||
|
||||
@ Sets the door metatile at (x, y) to be open without an animation.
|
||||
.macro setdooropen x:req, y:req
|
||||
.byte 0xaf
|
||||
.2byte \x
|
||||
.2byte \y
|
||||
.endm
|
||||
|
||||
@ Sets the door metatile at (x, y) to be closed without an animation.
|
||||
.macro setdoorclosed x:req, y:req
|
||||
.byte 0xb0
|
||||
.2byte \x
|
||||
.2byte \y
|
||||
.endm
|
||||
|
||||
@ Consumes its parameters and does nothing. It is implemented but unused in Ruby/Sapphire.
|
||||
.macro addelevmenuitem a:req, b:req, c:req, d:req
|
||||
.byte 0xb1
|
||||
.byte \a
|
||||
.2byte \b
|
||||
.2byte \c
|
||||
.2byte \d
|
||||
.endm
|
||||
|
||||
@ Does nothing. It is implemented but unused in Ruby/Sapphire.
|
||||
.macro showelevmenu
|
||||
.byte 0xb2
|
||||
.endm
|
||||
|
||||
@ Gets the number of coins the player has and stores it in the variable 'out'.
|
||||
.macro checkcoins out:req
|
||||
.byte 0xb3
|
||||
.2byte \out
|
||||
.endm
|
||||
|
||||
@ Gives 'count' coins to the player, up to a total of MAX_COINS.
|
||||
@ If the player already has MAX_COINS then VAR_RESULT is set to TRUE, otherwise it is set to FALSE.
|
||||
.macro addcoins count:req
|
||||
.byte 0xb4
|
||||
.2byte \count
|
||||
.endm
|
||||
|
||||
@ Takes 'count' coins from the player.
|
||||
@ If the player has fewer than 'count' coins then no coins are taken and VAR_RESULT is set to TRUE.
|
||||
@ Otherwise VAR_RESULT is set to FALSE.
|
||||
.macro removecoins count:req
|
||||
.byte 0xb5
|
||||
.2byte \count
|
||||
.endm
|
||||
|
||||
@ Prepares to start a wild battle against a 'species' at 'level' holding 'item'. Running this command will not affect
|
||||
@ normal wild battles. You start the prepared battle with dowildbattle.
|
||||
.macro setwildbattle species:req, level:req, item:req
|
||||
.byte 0xb6
|
||||
.2byte \species
|
||||
.byte \level
|
||||
.2byte \item
|
||||
.endm
|
||||
|
||||
@ Starts a wild battle against the Pokemon generated by setwildbattle. Blocks script execution until the battle finishes.
|
||||
.macro dowildbattle
|
||||
.byte 0xb7
|
||||
.endm
|
||||
|
||||
@ Sets a relative address to be used by the other vcommands as part of a Mystery Gift script.
|
||||
.macro setvaddress pointer:req
|
||||
.byte 0xb8
|
||||
.4byte \pointer
|
||||
.endm
|
||||
|
||||
@ Equivalent to goto using the relative address set by setvaddress.
|
||||
.macro vgoto pointer:req
|
||||
.byte 0xb9
|
||||
.4byte \pointer
|
||||
.endm
|
||||
|
||||
@ Equivalent to call using the relative address set by setvaddress.
|
||||
.macro vcall pointer:req
|
||||
.byte 0xba
|
||||
.4byte \pointer
|
||||
.endm
|
||||
|
||||
@ Equivalent to goto_if using the relative address set by setvaddress.
|
||||
.macro vgoto_if byte:req, pointer:req
|
||||
.byte 0xbb
|
||||
.byte \byte
|
||||
.4byte \pointer
|
||||
.endm
|
||||
|
||||
@ Equivalent to call_if using the relative address set by setvaddress.
|
||||
.macro vcall_if byte:req, pointer:req
|
||||
.byte 0xbc
|
||||
.byte \byte
|
||||
.4byte \pointer
|
||||
.endm
|
||||
|
||||
@ Equivalent to message using the relative address set by setvaddress.
|
||||
.macro vmessage pointer:req
|
||||
.byte 0xbd
|
||||
.4byte \pointer
|
||||
.endm
|
||||
|
||||
@ Expands the given text at the pointer (- the relative address set by setvaddress) into gStringVar4
|
||||
.macro vbuffermessage ptr:req
|
||||
.byte 0xbe
|
||||
.4byte \ptr
|
||||
.endm
|
||||
|
||||
@ Equivalent to bufferstring using the relative address set by setvaddress.
|
||||
.macro vbufferstring stringVarIndex:req, pointer:req
|
||||
.byte 0xbf
|
||||
stringvar \stringVarIndex
|
||||
.4byte \pointer
|
||||
.endm
|
||||
|
||||
@ Create a window showing how many Coins the player has.
|
||||
.macro showcoinsbox x:req, y:req
|
||||
.byte 0xc0
|
||||
.byte \x
|
||||
.byte \y
|
||||
.endm
|
||||
|
||||
@ Destroys the window created by showcoins. It consumes its arguments but doesn't use them.
|
||||
.macro hidecoinsbox x:req, y:req
|
||||
.byte 0xc1
|
||||
.byte \x
|
||||
.byte \y
|
||||
.endm
|
||||
|
||||
@ Updates the window created by showcoins. It consumes its arguments but doesn't use them.
|
||||
.macro updatecoinsbox x:req, y:req
|
||||
.byte 0xc2
|
||||
.byte \x
|
||||
.byte \y
|
||||
.endm
|
||||
|
||||
@ Increases the value of the specified game stat by 1. The maximum value of a stat is 0xFFFFFF. See include/constants/game_stat.h
|
||||
.macro incrementgamestat stat:req
|
||||
.byte 0xc3
|
||||
.byte \stat
|
||||
.endm
|
||||
|
||||
@ Sets the destination that using an Escape Rope or Dig will take the player to.
|
||||
@ Warp commands can be given either the id of which warp location to go to on the destination map
|
||||
@ or a pair of x/y coordinates to go to directly on the destination map.
|
||||
.macro setescapewarp map:req, a, b, c
|
||||
.byte 0xc4
|
||||
formatwarp \map, \a, \b, \c
|
||||
.endm
|
||||
|
||||
@ Blocks script execution until cry finishes.
|
||||
.macro waitmoncry
|
||||
.byte 0xc5
|
||||
.endm
|
||||
|
||||
@ Writes the name of the specified PC box to the specified buffer.
|
||||
.macro bufferboxname stringVarId:req, box:req
|
||||
.byte 0xc6
|
||||
stringvar \stringVarId
|
||||
.2byte \box
|
||||
.endm
|
||||
|
||||
@ Used only in FireRed/LeafGreen, does nothing in Emerald.
|
||||
.macro textcolor color:req
|
||||
.byte 0xc7
|
||||
.byte \color
|
||||
.endm
|
||||
|
||||
@ Used only in FireRed/LeafGreen, does nothing in Emerald.
|
||||
.macro loadhelp pointer:req
|
||||
.byte 0xc8
|
||||
.4byte \pointer
|
||||
.endm
|
||||
|
||||
@ Used only in FireRed/LeafGreen, does nothing in Emerald.
|
||||
.macro unloadhelp
|
||||
.byte 0xc9
|
||||
.endm
|
||||
|
||||
@ Used only in FireRed/LeafGreen, does nothing in Emerald.
|
||||
.macro signmsg
|
||||
.byte 0xca
|
||||
.endm
|
||||
|
||||
@ Used only in FireRed/LeafGreen, does nothing in Emerald.
|
||||
.macro normalmsg
|
||||
.byte 0xcb
|
||||
.endm
|
||||
|
||||
@ Used only in FireRed/LeafGreen, does nothing in Emerald.
|
||||
.macro comparehiddenvar a:req, value:req
|
||||
.byte 0xcc
|
||||
.byte \a
|
||||
.4byte \value
|
||||
.endm
|
||||
|
||||
@ Sets the eventLegal bit for the Pokemon in the specified slot of the player's party.
|
||||
.macro setmoneventlegal slot:req
|
||||
.byte 0xcd
|
||||
.2byte \slot
|
||||
.endm
|
||||
|
||||
@ Checks if the eventLegal bit is set for the Pokemon in the specified slot of the player's party. If it isn't set,
|
||||
@ VAR_RESULT is TRUE. If the bit is set (or if the specified slot is empty or invalid), VAR_RESULT is FALSE.
|
||||
.macro checkmoneventlegal slot:req
|
||||
.byte 0xce
|
||||
.2byte \slot
|
||||
.endm
|
||||
|
||||
@ Jumps to the ram script saved from a Wonder Card. If there is no valid saved Wonder Card or if the
|
||||
@ ram script is invalid then this does nothing.
|
||||
.macro trywondercardscript
|
||||
.byte 0xcf
|
||||
.endm
|
||||
|
||||
@ Used only in FireRed/LeafGreen, does nothing in Emerald.
|
||||
.macro setworldmapflag worldmapflag:req
|
||||
.byte 0xd0
|
||||
.2byte \worldmapflag
|
||||
.endm
|
||||
|
||||
@ Warps the player to the specified map using a teleport effect. Effect is similar to warpteleport, but
|
||||
@ this warp has no fade out and maintains the original facing direction.
|
||||
@ Warp commands can be given either the id of which warp location to go to on the destination map
|
||||
@ or a pair of x/y coordinates to go to directly on the destination map.
|
||||
.macro warpspinenter map:req, a, b, c
|
||||
.byte 0xd1
|
||||
formatwarp \map, \a, \b, \c
|
||||
.endm
|
||||
|
||||
@ Changes the location where the player caught the Pokemon in the specified slot of their party.
|
||||
.macro setmonmetlocation slot:req, location:req
|
||||
.byte 0xd2
|
||||
.2byte \slot
|
||||
.byte \location
|
||||
.endm
|
||||
|
||||
@ For the rotating tile puzzles in Mossdeep Gym / Trick House Room 7. Moves the objects one rotation
|
||||
@ on the colored puzzle specified by puzzleNumber.
|
||||
.macro moverotatingtileobjects puzzleNumber:req
|
||||
.byte 0xd3
|
||||
.2byte \puzzleNumber
|
||||
.endm
|
||||
|
||||
@ For the rotating tile puzzles in Mossdeep Gym / Trick House Room 7. Updates the facing direction of all objects on the puzzle tiles
|
||||
.macro turnrotatingtileobjects
|
||||
.byte 0xd4
|
||||
.endm
|
||||
|
||||
@ For the rotating tile puzzles in Mossdeep Gym / Trick House Room 7. Allocates memory for the puzzle objects.
|
||||
@ isTrickHouse is needed to determine which of the two maps the puzzle is on, in order to know where in the tileset
|
||||
@ the puzzle tiles start (TRUE for Trick House Room, FALSE for Mossdeep Gym).
|
||||
.macro initrotatingtilepuzzle isTrickHouse:req
|
||||
.byte 0xd5
|
||||
.2byte \isTrickHouse
|
||||
.endm
|
||||
|
||||
@ For the rotating tile puzzles in Mossdeep Gym / Trick House Room 7. Frees the memory allocated for the puzzle objects.
|
||||
.macro freerotatingtilepuzzle
|
||||
.byte 0xd6
|
||||
.endm
|
||||
|
||||
@ Warp used by the teleport tiles in the Mossdeep Gym. Plays SE_WARP_IN and does a simple fade transition.
|
||||
@ Also skips reloading object events by setting SKIP_OBJECT_EVENT_LOAD.
|
||||
@ Warp commands can be given either the id of which warp location to go to on the destination map
|
||||
@ or a pair of x/y coordinates to go to directly on the destination map.
|
||||
.macro warpmossdeepgym map:req, a, b, c
|
||||
.byte 0xd7
|
||||
formatwarp \map, \a, \b, \c
|
||||
.endm
|
||||
|
||||
@ Sets the selected object to the id of the currently approaching trainer.
|
||||
.macro selectapproachingtrainer
|
||||
.byte 0xd8
|
||||
.endm
|
||||
|
||||
@ Freezes all objects immediately except the player and the approaching trainers.
|
||||
@ The player and trainers are frozen once their movement is finished.
|
||||
.macro lockfortrainer
|
||||
.byte 0xd9
|
||||
.endm
|
||||
|
||||
@ Destroys the window created by braillemessage.
|
||||
.macro closebraillemessage
|
||||
.byte 0xda
|
||||
.endm
|
||||
|
||||
@ Prints and draws the message all at once rather than character by character.
|
||||
@ Does not wait for player input to continue.
|
||||
.macro messageinstant text:req
|
||||
.byte 0xdb
|
||||
.4byte \text
|
||||
.endm
|
||||
|
||||
@ Equivalent to fadescreen but copies gPlttBufferUnfaded to gPaletteDecompressionBuffer on the fade out
|
||||
@ and the reverse on the fade in, in effect saving gPlttBufferUnfaded to restore it.
|
||||
.macro fadescreenswapbuffers mode:req
|
||||
.byte 0xdc
|
||||
.byte \mode
|
||||
.endm
|
||||
|
||||
@ Buffers the specified trainer's class name to the given string var.
|
||||
@ If the trainer id is >= TRAINERS_COUNT it will be treated as TRAINER_NONE.
|
||||
.macro buffertrainerclassname stringVarId:req, trainerId:req
|
||||
.byte 0xdd
|
||||
stringvar \stringVarId
|
||||
.2byte \trainerId
|
||||
.endm
|
||||
|
||||
@ Buffers the specified trainer's name to the given string var.
|
||||
@ If the trainer id is >= TRAINERS_COUNT it will be treated as TRAINER_NONE.
|
||||
.macro buffertrainername stringVarId:req, trainerId:req
|
||||
.byte 0xde
|
||||
stringvar \stringVarId
|
||||
.2byte \trainerId
|
||||
.endm
|
||||
|
||||
@ Starts a Pokenav call with the given text.
|
||||
.macro pokenavcall text:req
|
||||
.byte 0xdf
|
||||
.4byte \text
|
||||
.endm
|
||||
|
||||
@ Warp with a fade to white. Used during the Sootopolis legendary fight.
|
||||
@ Warp commands can be given either the id of which warp location to go to on the destination map
|
||||
@ or a pair of x/y coordinates to go to directly on the destination map.
|
||||
.macro warpwhitefade map:req, a, b, c
|
||||
.byte 0xe0
|
||||
formatwarp \map, \a, \b, \c
|
||||
.endm
|
||||
|
||||
@ Buffers the name of the contest category to the buffer.
|
||||
@ For example a category of CONTEST_CATEGORY_COOL will buffer the string "COOLNESS CONTEST".
|
||||
.macro buffercontestname stringVarId:req, category:req
|
||||
.byte 0xe1
|
||||
stringvar \stringVarId
|
||||
.2byte \category
|
||||
.endm
|
||||
|
||||
@ Writes the name of the specified item to the specified buffer. If 'item' is a Berry or ITEM_POKE_BALL
|
||||
@ and if the quantity is 2 or more, the buffered string will be pluralized ("IES" or "S" appended).
|
||||
@ If the specified item is >= ITEMS_COUNT then the name of ITEM_NONE ("????????") is buffered instead.
|
||||
.macro bufferitemnameplural stringVarId:req, item:req, quantity:req
|
||||
.byte 0xe2
|
||||
stringvar \stringVarId
|
||||
.2byte \item
|
||||
.2byte \quantity
|
||||
.endm
|
||||
|
||||
|
||||
@ Supplementary
|
||||
|
||||
.macro goto_if_unset flag:req, dest:req
|
||||
checkflag \flag
|
||||
goto_if FALSE, \dest
|
||||
.endm
|
||||
|
||||
.macro goto_if_set flag:req, dest:req
|
||||
checkflag \flag
|
||||
goto_if TRUE, \dest
|
||||
.endm
|
||||
|
||||
@ Allows 'compare' followed by a conditional goto/call to be combined into a single statement.
|
||||
@ The following are examples of the two acceptable formats this facilitates:
|
||||
@ compare VAR_RESULT, TRUE
|
||||
@ goto_if_eq MyScript
|
||||
@ - or -
|
||||
@ goto_if_eq VAR_RESULT, TRUE, MyScript
|
||||
@
|
||||
@ The first two arguments to this macro are the base command, e.g. 'goto_if 1' for goto_if_eq.
|
||||
@ The remaining arguments 'a, b, c' depend on the format:
|
||||
@ For a single statement, 'a' and 'b' are the values to compare and 'c' is the destination pointer.
|
||||
@ For a statement preceded by a compare, 'a' is the destination pointer and 'b/c' are not provided.
|
||||
.macro trycompare jump:req, condition:req, a:req, b, c
|
||||
.ifnb \c
|
||||
compare \a, \b
|
||||
\jump \condition, \c
|
||||
.else
|
||||
\jump \condition, \a
|
||||
.endif
|
||||
.endm
|
||||
|
||||
.macro goto_if_lt a:req, b, c @ LESS THAN
|
||||
trycompare goto_if, 0, \a, \b, \c
|
||||
.endm
|
||||
|
||||
.macro goto_if_eq a:req, b, c @ EQUAL
|
||||
trycompare goto_if, 1, \a, \b, \c
|
||||
.endm
|
||||
|
||||
.macro goto_if_gt a:req, b, c @ GREATER THAN
|
||||
trycompare goto_if, 2, \a, \b, \c
|
||||
.endm
|
||||
|
||||
.macro goto_if_le a:req, b, c @ LESS THAN OR EQUAL
|
||||
trycompare goto_if, 3, \a, \b, \c
|
||||
.endm
|
||||
|
||||
.macro goto_if_ge a:req, b, c @ GREATER THAN OR EQUAL
|
||||
trycompare goto_if, 4, \a, \b, \c
|
||||
.endm
|
||||
|
||||
.macro goto_if_ne a:req, b, c @ NOT EQUAL
|
||||
trycompare goto_if, 5, \a, \b, \c
|
||||
.endm
|
||||
|
||||
.macro call_if_unset flag:req, dest:req
|
||||
checkflag \flag
|
||||
call_if FALSE, \dest
|
||||
.endm
|
||||
|
||||
.macro call_if_set flag:req, dest:req
|
||||
checkflag \flag
|
||||
call_if TRUE, \dest
|
||||
.endm
|
||||
|
||||
.macro call_if_lt a:req, b, c @ LESS THAN
|
||||
trycompare call_if, 0, \a, \b, \c
|
||||
.endm
|
||||
|
||||
.macro call_if_eq a:req, b, c @ EQUAL
|
||||
trycompare call_if, 1, \a, \b, \c
|
||||
.endm
|
||||
|
||||
.macro call_if_gt a:req, b, c @ GREATER THAN
|
||||
trycompare call_if, 2, \a, \b, \c
|
||||
.endm
|
||||
|
||||
.macro call_if_le a:req, b, c @ LESS THAN OR EQUAL
|
||||
trycompare call_if, 3, \a, \b, \c
|
||||
.endm
|
||||
|
||||
.macro call_if_ge a:req, b, c @ GREATER THAN OR EQUAL
|
||||
trycompare call_if, 4, \a, \b, \c
|
||||
.endm
|
||||
|
||||
.macro call_if_ne a:req, b, c @ NOT EQUAL
|
||||
trycompare call_if, 5, \a, \b, \c
|
||||
.endm
|
||||
|
||||
.macro vgoto_if_eq a:req, b, c
|
||||
trycompare vgoto_if, TRUE, \a, \b, \c
|
||||
.endm
|
||||
|
||||
.macro vgoto_if_ne a:req, b, c
|
||||
trycompare vgoto_if, FALSE, \a, \b, \c
|
||||
.endm
|
||||
|
||||
.macro vgoto_if_unset flag:req, dest:req
|
||||
checkflag \flag
|
||||
vgoto_if FALSE, \dest
|
||||
.endm
|
||||
|
||||
.macro vgoto_if_set flag:req, dest:req
|
||||
checkflag \flag
|
||||
vgoto_if TRUE, \dest
|
||||
.endm
|
||||
|
||||
.macro goto_if_defeated trainer:req, dest:req
|
||||
checktrainerflag \trainer
|
||||
goto_if TRUE, \dest
|
||||
.endm
|
||||
|
||||
.macro goto_if_not_defeated trainer:req, dest:req
|
||||
checktrainerflag \trainer
|
||||
goto_if FALSE, \dest
|
||||
.endm
|
||||
|
||||
.macro call_if_defeated trainer:req, dest:req
|
||||
checktrainerflag \trainer
|
||||
call_if TRUE, \dest
|
||||
.endm
|
||||
|
||||
.macro call_if_not_defeated trainer:req, dest:req
|
||||
checktrainerflag \trainer
|
||||
call_if FALSE, \dest
|
||||
.endm
|
||||
|
||||
.macro switch var:req
|
||||
copyvar VAR_0x8000, \var
|
||||
.endm
|
||||
|
||||
.macro case condition:req, dest:req
|
||||
compare VAR_0x8000, \condition
|
||||
goto_if_eq \dest
|
||||
.endm
|
||||
|
||||
@ Message box types
|
||||
MSGBOX_NPC = 2
|
||||
MSGBOX_SIGN = 3
|
||||
MSGBOX_DEFAULT = 4
|
||||
MSGBOX_YESNO = 5
|
||||
MSGBOX_AUTOCLOSE = 6
|
||||
MSGBOX_GETPOINTS = 9
|
||||
MSGBOX_POKENAV = 10
|
||||
|
||||
YES = 1
|
||||
NO = 0
|
||||
|
||||
@ Buffers the given text and calls the relevant standard message script (see gStdScripts).
|
||||
.macro msgbox text:req, type=MSGBOX_DEFAULT
|
||||
loadword 0, \text
|
||||
callstd \type
|
||||
.endm
|
||||
|
||||
@ Gives 'amount' of the specified 'item' to the player and prints a message with fanfare.
|
||||
@ If the player doesn't have space for all the items then as many are added as possible, the
|
||||
@ message indicates there is no room, and VAR_RESULT is set to FALSE.
|
||||
@ Otherwise VAR_RESULT is set to TRUE, and the message indicates they have received the item(s).
|
||||
.macro giveitem item:req, amount=1
|
||||
setorcopyvar VAR_0x8000, \item
|
||||
setorcopyvar VAR_0x8001, \amount
|
||||
callstd STD_OBTAIN_ITEM
|
||||
.endm
|
||||
|
||||
@ For picking up items in the overworld. Similar to giveitem, but with different language and
|
||||
@ sets the flag of the last-talked to object (the item the player picked up).
|
||||
.macro finditem item:req, amount=1
|
||||
setorcopyvar VAR_0x8000, \item
|
||||
setorcopyvar VAR_0x8001, \amount
|
||||
callstd STD_FIND_ITEM
|
||||
.endm
|
||||
|
||||
@ Equivalent to giveitem but for a single decoration.
|
||||
.macro givedecoration decoration:req
|
||||
setorcopyvar VAR_0x8000, \decoration
|
||||
callstd STD_OBTAIN_DECORATION
|
||||
.endm
|
||||
|
||||
@ Registers the specified trainer in Match Call and plays a fanfare with a notification message.
|
||||
.macro register_matchcall trainer:req
|
||||
setvar VAR_0x8004, \trainer
|
||||
special SetMatchCallRegisteredFlag
|
||||
setorcopyvar VAR_0x8000, \trainer
|
||||
callstd STD_REGISTER_MATCH_CALL
|
||||
.endm
|
||||
|
||||
@ Does a sparkle field effect (e.g. when the Trick Master is hiding) at the given coordinates.
|
||||
.macro dofieldeffectsparkle x:req, y:req, priority:req
|
||||
setfieldeffectargument 0, \x
|
||||
setfieldeffectargument 1, \y
|
||||
setfieldeffectargument 2, \priority
|
||||
dofieldeffect FLDEFF_SPARKLE
|
||||
.endm
|
||||
|
||||
@ Prints a braille message, waits for an A or B press, then closes the message.
|
||||
.macro braillemsgbox text:req
|
||||
braillemessage \text
|
||||
waitbuttonpress
|
||||
closebraillemessage
|
||||
.endm
|
42
asm/macros/field_effect_script.inc
Normal file
42
asm/macros/field_effect_script.inc
Normal file
@ -0,0 +1,42 @@
|
||||
.macro field_eff_loadtiles address
|
||||
.byte 0
|
||||
.4byte \address
|
||||
.endm
|
||||
|
||||
.macro field_eff_loadfadedpal address
|
||||
.byte 1
|
||||
.4byte \address
|
||||
.endm
|
||||
|
||||
.macro field_eff_loadpal address
|
||||
.byte 2
|
||||
.4byte \address
|
||||
.endm
|
||||
|
||||
.macro field_eff_callnative address
|
||||
.byte 3
|
||||
.4byte \address
|
||||
.endm
|
||||
|
||||
.macro field_eff_end
|
||||
.byte 4
|
||||
.endm
|
||||
|
||||
.macro field_eff_loadgfx_callnative tiles_address, palette_address, function_address
|
||||
.byte 5
|
||||
.4byte \tiles_address
|
||||
.4byte \palette_address
|
||||
.4byte \function_address
|
||||
.endm
|
||||
|
||||
.macro field_eff_loadtiles_callnative tiles_address, function_address
|
||||
.byte 6
|
||||
.4byte \tiles_address
|
||||
.4byte \function_address
|
||||
.endm
|
||||
|
||||
.macro field_eff_loadfadedpal_callnative palette_address, function_address
|
||||
.byte 7
|
||||
.4byte \palette_address
|
||||
.4byte \function_address
|
||||
.endm
|
29
asm/macros/function.inc
Normal file
29
asm/macros/function.inc
Normal file
@ -0,0 +1,29 @@
|
||||
.macro arm_func_start name
|
||||
.align 2, 0
|
||||
.global \name
|
||||
.arm
|
||||
.type \name, %function
|
||||
.endm
|
||||
|
||||
.macro arm_func_end name
|
||||
.size \name, .-\name
|
||||
.endm
|
||||
|
||||
.macro thumb_func_start name
|
||||
.align 2, 0
|
||||
.global \name
|
||||
.thumb
|
||||
.thumb_func
|
||||
.type \name, %function
|
||||
.endm
|
||||
|
||||
.macro non_word_aligned_thumb_func_start name
|
||||
.global \name
|
||||
.thumb
|
||||
.thumb_func
|
||||
.type \name, %function
|
||||
.endm
|
||||
|
||||
.macro thumb_func_end name
|
||||
.size \name, .-\name
|
||||
.endm
|
13
asm/macros/m4a.inc
Normal file
13
asm/macros/m4a.inc
Normal file
@ -0,0 +1,13 @@
|
||||
.macro song label, music_player, unknown
|
||||
.4byte \label
|
||||
.2byte \music_player
|
||||
.2byte \unknown
|
||||
.endm
|
||||
|
||||
.macro music_player info_struct, track_struct, unknown_1, unknown_2
|
||||
.4byte \info_struct
|
||||
.4byte \track_struct
|
||||
.byte \unknown_1
|
||||
.space 1
|
||||
.2byte \unknown_2
|
||||
.endm
|
108
asm/macros/map.inc
Normal file
108
asm/macros/map.inc
Normal file
@ -0,0 +1,108 @@
|
||||
.macro map map_id
|
||||
.byte \map_id >> 8 @ map group
|
||||
.byte \map_id & 0xFF @ map num
|
||||
.endm
|
||||
|
||||
.macro map_script type, address
|
||||
.byte \type
|
||||
.4byte \address
|
||||
.endm
|
||||
|
||||
.macro map_script_2 word1, word2, address
|
||||
.2byte \word1
|
||||
.2byte \word2
|
||||
.4byte \address
|
||||
.endm
|
||||
|
||||
.macro object_event index:req, gfx:req, replacement:req, x:req, y:req, elevation:req, movement_type:req, x_radius:req, y_radius:req, trainer_type:req, sight_radius_tree_etc:req, script:req, event_flag:req
|
||||
.byte \index, \replacement
|
||||
.2byte \gfx
|
||||
.2byte \x
|
||||
.2byte \y
|
||||
.byte \elevation, \movement_type, ((\y_radius << 4) | \x_radius), 0
|
||||
.2byte \trainer_type, \sight_radius_tree_etc
|
||||
.4byte \script
|
||||
.2byte \event_flag
|
||||
.2byte 0
|
||||
inc _num_npcs
|
||||
.endm
|
||||
|
||||
.macro warp_def x, y, byte, warp, map_id
|
||||
.2byte \x, \y
|
||||
.byte \byte, \warp
|
||||
.byte \map_id & 0xFF @ map num
|
||||
.byte \map_id >> 8 @ map group
|
||||
inc _num_warps
|
||||
.endm
|
||||
|
||||
.macro coord_event x, y, elevation, trigger, index, script
|
||||
.2byte \x, \y
|
||||
.byte \elevation, 0
|
||||
.2byte \trigger, \index, 0
|
||||
.4byte \script
|
||||
inc _num_traps
|
||||
.endm
|
||||
|
||||
.macro coord_weather_event x, y, elevation, weather
|
||||
.2byte \x, \y
|
||||
.byte \elevation, 0
|
||||
.2byte \weather
|
||||
.2byte 0, 0
|
||||
.4byte 0
|
||||
inc _num_traps
|
||||
.endm
|
||||
|
||||
.macro bg_event x, y, elevation, kind, arg6, arg7
|
||||
.2byte \x, \y
|
||||
.byte \elevation, \kind
|
||||
.2byte 0
|
||||
.if \kind != BG_EVENT_HIDDEN_ITEM
|
||||
.4byte \arg6
|
||||
.else
|
||||
.2byte \arg6
|
||||
.2byte \arg7
|
||||
.endif
|
||||
inc _num_signs
|
||||
.endm
|
||||
|
||||
.macro bg_hidden_item_event x, y, height, item, flag
|
||||
bg_event \x, \y, \height, BG_EVENT_HIDDEN_ITEM, \item, ((\flag) - FLAG_HIDDEN_ITEMS_START)
|
||||
.endm
|
||||
|
||||
.macro bg_secret_base_event x, y, height, secret_base_id
|
||||
bg_event \x, \y, \height, BG_EVENT_SECRET_BASE, \secret_base_id
|
||||
.endm
|
||||
|
||||
.macro map_events npcs, warps, traps, signs
|
||||
.byte _num_npcs, _num_warps, _num_traps, _num_signs
|
||||
.4byte \npcs, \warps, \traps, \signs
|
||||
reset_map_events
|
||||
.endm
|
||||
|
||||
.macro reset_map_events
|
||||
.set _num_npcs, 0
|
||||
.set _num_warps, 0
|
||||
.set _num_traps, 0
|
||||
.set _num_signs, 0
|
||||
.endm
|
||||
|
||||
reset_map_events
|
||||
|
||||
|
||||
.equiv connection_down, 1
|
||||
.equiv connection_up, 2
|
||||
.equiv connection_left, 3
|
||||
.equiv connection_right, 4
|
||||
.equiv connection_dive, 5
|
||||
.equiv connection_emerge, 6
|
||||
|
||||
.macro connection direction, offset, map
|
||||
.4byte connection_\direction
|
||||
.4byte \offset
|
||||
map \map
|
||||
.space 2
|
||||
.endm
|
||||
|
||||
.macro map_header_flags allow_cycling:req, allow_escaping:req, allow_running:req, show_map_name:req
|
||||
.byte ((\show_map_name & 1) << 3) | ((\allow_running & 1) << 2) | ((\allow_escaping & 1) << 1) | \allow_cycling
|
||||
.endm
|
166
asm/macros/movement.inc
Normal file
166
asm/macros/movement.inc
Normal file
@ -0,0 +1,166 @@
|
||||
.macro create_movement_action name:req, value:req
|
||||
.macro \name
|
||||
.byte \value
|
||||
.endm
|
||||
.endm
|
||||
|
||||
create_movement_action face_down, MOVEMENT_ACTION_FACE_DOWN
|
||||
create_movement_action face_up, MOVEMENT_ACTION_FACE_UP
|
||||
create_movement_action face_left, MOVEMENT_ACTION_FACE_LEFT
|
||||
create_movement_action face_right, MOVEMENT_ACTION_FACE_RIGHT
|
||||
create_movement_action walk_slow_down, MOVEMENT_ACTION_WALK_SLOW_DOWN
|
||||
create_movement_action walk_slow_up, MOVEMENT_ACTION_WALK_SLOW_UP
|
||||
create_movement_action walk_slow_left, MOVEMENT_ACTION_WALK_SLOW_LEFT
|
||||
create_movement_action walk_slow_right, MOVEMENT_ACTION_WALK_SLOW_RIGHT
|
||||
create_movement_action walk_down, MOVEMENT_ACTION_WALK_NORMAL_DOWN
|
||||
create_movement_action walk_up, MOVEMENT_ACTION_WALK_NORMAL_UP
|
||||
create_movement_action walk_left, MOVEMENT_ACTION_WALK_NORMAL_LEFT
|
||||
create_movement_action walk_right, MOVEMENT_ACTION_WALK_NORMAL_RIGHT
|
||||
create_movement_action jump_2_down, MOVEMENT_ACTION_JUMP_2_DOWN
|
||||
create_movement_action jump_2_up, MOVEMENT_ACTION_JUMP_2_UP
|
||||
create_movement_action jump_2_left, MOVEMENT_ACTION_JUMP_2_LEFT
|
||||
create_movement_action jump_2_right, MOVEMENT_ACTION_JUMP_2_RIGHT
|
||||
create_movement_action delay_1, MOVEMENT_ACTION_DELAY_1
|
||||
create_movement_action delay_2, MOVEMENT_ACTION_DELAY_2
|
||||
create_movement_action delay_4, MOVEMENT_ACTION_DELAY_4
|
||||
create_movement_action delay_8, MOVEMENT_ACTION_DELAY_8
|
||||
create_movement_action delay_16, MOVEMENT_ACTION_DELAY_16
|
||||
create_movement_action walk_fast_down, MOVEMENT_ACTION_WALK_FAST_DOWN
|
||||
create_movement_action walk_fast_up, MOVEMENT_ACTION_WALK_FAST_UP
|
||||
create_movement_action walk_fast_left, MOVEMENT_ACTION_WALK_FAST_LEFT
|
||||
create_movement_action walk_fast_right, MOVEMENT_ACTION_WALK_FAST_RIGHT
|
||||
create_movement_action walk_in_place_slow_down, MOVEMENT_ACTION_WALK_IN_PLACE_SLOW_DOWN
|
||||
create_movement_action walk_in_place_slow_up, MOVEMENT_ACTION_WALK_IN_PLACE_SLOW_UP
|
||||
create_movement_action walk_in_place_slow_left, MOVEMENT_ACTION_WALK_IN_PLACE_SLOW_LEFT
|
||||
create_movement_action walk_in_place_slow_right, MOVEMENT_ACTION_WALK_IN_PLACE_SLOW_RIGHT
|
||||
create_movement_action walk_in_place_down, MOVEMENT_ACTION_WALK_IN_PLACE_NORMAL_DOWN
|
||||
create_movement_action walk_in_place_up, MOVEMENT_ACTION_WALK_IN_PLACE_NORMAL_UP
|
||||
create_movement_action walk_in_place_left, MOVEMENT_ACTION_WALK_IN_PLACE_NORMAL_LEFT
|
||||
create_movement_action walk_in_place_right, MOVEMENT_ACTION_WALK_IN_PLACE_NORMAL_RIGHT
|
||||
create_movement_action walk_in_place_fast_down, MOVEMENT_ACTION_WALK_IN_PLACE_FAST_DOWN
|
||||
create_movement_action walk_in_place_fast_up, MOVEMENT_ACTION_WALK_IN_PLACE_FAST_UP
|
||||
create_movement_action walk_in_place_fast_left, MOVEMENT_ACTION_WALK_IN_PLACE_FAST_LEFT
|
||||
create_movement_action walk_in_place_fast_right, MOVEMENT_ACTION_WALK_IN_PLACE_FAST_RIGHT
|
||||
create_movement_action walk_in_place_faster_down, MOVEMENT_ACTION_WALK_IN_PLACE_FASTER_DOWN
|
||||
create_movement_action walk_in_place_faster_up, MOVEMENT_ACTION_WALK_IN_PLACE_FASTER_UP
|
||||
create_movement_action walk_in_place_faster_left, MOVEMENT_ACTION_WALK_IN_PLACE_FASTER_LEFT
|
||||
create_movement_action walk_in_place_faster_right, MOVEMENT_ACTION_WALK_IN_PLACE_FASTER_RIGHT
|
||||
create_movement_action ride_water_current_down, MOVEMENT_ACTION_RIDE_WATER_CURRENT_DOWN
|
||||
create_movement_action ride_water_current_up, MOVEMENT_ACTION_RIDE_WATER_CURRENT_UP
|
||||
create_movement_action ride_water_current_left, MOVEMENT_ACTION_RIDE_WATER_CURRENT_LEFT
|
||||
create_movement_action ride_water_current_right, MOVEMENT_ACTION_RIDE_WATER_CURRENT_RIGHT
|
||||
create_movement_action walk_faster_down, MOVEMENT_ACTION_WALK_FASTER_DOWN
|
||||
create_movement_action walk_faster_up, MOVEMENT_ACTION_WALK_FASTER_UP
|
||||
create_movement_action walk_faster_left, MOVEMENT_ACTION_WALK_FASTER_LEFT
|
||||
create_movement_action walk_faster_right, MOVEMENT_ACTION_WALK_FASTER_RIGHT
|
||||
create_movement_action slide_down, MOVEMENT_ACTION_SLIDE_DOWN
|
||||
create_movement_action slide_up, MOVEMENT_ACTION_SLIDE_UP
|
||||
create_movement_action slide_left, MOVEMENT_ACTION_SLIDE_LEFT
|
||||
create_movement_action slide_right, MOVEMENT_ACTION_SLIDE_RIGHT
|
||||
create_movement_action player_run_down, MOVEMENT_ACTION_PLAYER_RUN_DOWN
|
||||
create_movement_action player_run_up, MOVEMENT_ACTION_PLAYER_RUN_UP
|
||||
create_movement_action player_run_left, MOVEMENT_ACTION_PLAYER_RUN_LEFT
|
||||
create_movement_action player_run_right, MOVEMENT_ACTION_PLAYER_RUN_RIGHT
|
||||
create_movement_action start_anim_in_direction, MOVEMENT_ACTION_START_ANIM_IN_DIRECTION
|
||||
create_movement_action jump_special_down, MOVEMENT_ACTION_JUMP_SPECIAL_DOWN
|
||||
create_movement_action jump_special_up, MOVEMENT_ACTION_JUMP_SPECIAL_UP
|
||||
create_movement_action jump_special_left, MOVEMENT_ACTION_JUMP_SPECIAL_LEFT
|
||||
create_movement_action jump_special_right, MOVEMENT_ACTION_JUMP_SPECIAL_RIGHT
|
||||
create_movement_action face_player, MOVEMENT_ACTION_FACE_PLAYER
|
||||
create_movement_action face_away_player, MOVEMENT_ACTION_FACE_AWAY_PLAYER
|
||||
create_movement_action lock_facing_direction, MOVEMENT_ACTION_LOCK_FACING_DIRECTION
|
||||
create_movement_action unlock_facing_direction, MOVEMENT_ACTION_UNLOCK_FACING_DIRECTION
|
||||
create_movement_action jump_down, MOVEMENT_ACTION_JUMP_DOWN
|
||||
create_movement_action jump_up, MOVEMENT_ACTION_JUMP_UP
|
||||
create_movement_action jump_left, MOVEMENT_ACTION_JUMP_LEFT
|
||||
create_movement_action jump_right, MOVEMENT_ACTION_JUMP_RIGHT
|
||||
create_movement_action jump_in_place_down, MOVEMENT_ACTION_JUMP_IN_PLACE_DOWN
|
||||
create_movement_action jump_in_place_up, MOVEMENT_ACTION_JUMP_IN_PLACE_UP
|
||||
create_movement_action jump_in_place_left, MOVEMENT_ACTION_JUMP_IN_PLACE_LEFT
|
||||
create_movement_action jump_in_place_right, MOVEMENT_ACTION_JUMP_IN_PLACE_RIGHT
|
||||
create_movement_action jump_in_place_down_up, MOVEMENT_ACTION_JUMP_IN_PLACE_DOWN_UP
|
||||
create_movement_action jump_in_place_up_down, MOVEMENT_ACTION_JUMP_IN_PLACE_UP_DOWN
|
||||
create_movement_action jump_in_place_left_right, MOVEMENT_ACTION_JUMP_IN_PLACE_LEFT_RIGHT
|
||||
create_movement_action jump_in_place_right_left, MOVEMENT_ACTION_JUMP_IN_PLACE_RIGHT_LEFT
|
||||
create_movement_action face_original_direction, MOVEMENT_ACTION_FACE_ORIGINAL_DIRECTION
|
||||
create_movement_action nurse_joy_bow, MOVEMENT_ACTION_NURSE_JOY_BOW_DOWN
|
||||
create_movement_action enable_jump_landing_ground_effect, MOVEMENT_ACTION_ENABLE_JUMP_LANDING_GROUND_EFFECT
|
||||
create_movement_action disable_jump_landing_ground_effect, MOVEMENT_ACTION_DISABLE_JUMP_LANDING_GROUND_EFFECT
|
||||
create_movement_action disable_anim, MOVEMENT_ACTION_DISABLE_ANIMATION
|
||||
create_movement_action restore_anim, MOVEMENT_ACTION_RESTORE_ANIMATION
|
||||
create_movement_action set_invisible, MOVEMENT_ACTION_SET_INVISIBLE
|
||||
create_movement_action set_visible, MOVEMENT_ACTION_SET_VISIBLE
|
||||
create_movement_action emote_exclamation_mark, MOVEMENT_ACTION_EMOTE_EXCLAMATION_MARK
|
||||
create_movement_action emote_question_mark, MOVEMENT_ACTION_EMOTE_QUESTION_MARK
|
||||
create_movement_action emote_heart, MOVEMENT_ACTION_EMOTE_HEART
|
||||
create_movement_action reveal_trainer, MOVEMENT_ACTION_REVEAL_TRAINER
|
||||
create_movement_action rock_smash_break, MOVEMENT_ACTION_ROCK_SMASH_BREAK
|
||||
create_movement_action cut_tree, MOVEMENT_ACTION_CUT_TREE
|
||||
create_movement_action set_fixed_priority, MOVEMENT_ACTION_SET_FIXED_PRIORITY
|
||||
create_movement_action clear_fixed_priority, MOVEMENT_ACTION_CLEAR_FIXED_PRIORITY
|
||||
create_movement_action init_affine_anim, MOVEMENT_ACTION_INIT_AFFINE_ANIM
|
||||
create_movement_action clear_affine_anim, MOVEMENT_ACTION_CLEAR_AFFINE_ANIM
|
||||
create_movement_action hide_reflection, MOVEMENT_ACTION_HIDE_REFLECTION
|
||||
create_movement_action show_reflection, MOVEMENT_ACTION_SHOW_REFLECTION
|
||||
create_movement_action walk_down_start_affine, MOVEMENT_ACTION_WALK_DOWN_START_AFFINE
|
||||
create_movement_action walk_down_affine, MOVEMENT_ACTION_WALK_DOWN_AFFINE
|
||||
create_movement_action acro_wheelie_face_down, MOVEMENT_ACTION_ACRO_WHEELIE_FACE_DOWN
|
||||
create_movement_action acro_wheelie_face_up, MOVEMENT_ACTION_ACRO_WHEELIE_FACE_UP
|
||||
create_movement_action acro_wheelie_face_left, MOVEMENT_ACTION_ACRO_WHEELIE_FACE_LEFT
|
||||
create_movement_action acro_wheelie_face_right, MOVEMENT_ACTION_ACRO_WHEELIE_FACE_RIGHT
|
||||
create_movement_action acro_pop_wheelie_down, MOVEMENT_ACTION_ACRO_POP_WHEELIE_DOWN
|
||||
create_movement_action acro_pop_wheelie_up, MOVEMENT_ACTION_ACRO_POP_WHEELIE_UP
|
||||
create_movement_action acro_pop_wheelie_left, MOVEMENT_ACTION_ACRO_POP_WHEELIE_LEFT
|
||||
create_movement_action acro_pop_wheelie_right, MOVEMENT_ACTION_ACRO_POP_WHEELIE_RIGHT
|
||||
create_movement_action acro_end_wheelie_face_down, MOVEMENT_ACTION_ACRO_END_WHEELIE_FACE_DOWN
|
||||
create_movement_action acro_end_wheelie_face_up, MOVEMENT_ACTION_ACRO_END_WHEELIE_FACE_UP
|
||||
create_movement_action acro_end_wheelie_face_left, MOVEMENT_ACTION_ACRO_END_WHEELIE_FACE_LEFT
|
||||
create_movement_action acro_end_wheelie_face_right, MOVEMENT_ACTION_ACRO_END_WHEELIE_FACE_RIGHT
|
||||
create_movement_action acro_wheelie_hop_face_down, MOVEMENT_ACTION_ACRO_WHEELIE_HOP_FACE_DOWN
|
||||
create_movement_action acro_wheelie_hop_face_up, MOVEMENT_ACTION_ACRO_WHEELIE_HOP_FACE_UP
|
||||
create_movement_action acro_wheelie_hop_face_left, MOVEMENT_ACTION_ACRO_WHEELIE_HOP_FACE_LEFT
|
||||
create_movement_action acro_wheelie_hop_face_right, MOVEMENT_ACTION_ACRO_WHEELIE_HOP_FACE_RIGHT
|
||||
create_movement_action acro_wheelie_hop_down, MOVEMENT_ACTION_ACRO_WHEELIE_HOP_DOWN
|
||||
create_movement_action acro_wheelie_hop_up, MOVEMENT_ACTION_ACRO_WHEELIE_HOP_UP
|
||||
create_movement_action acro_wheelie_hop_left, MOVEMENT_ACTION_ACRO_WHEELIE_HOP_LEFT
|
||||
create_movement_action acro_wheelie_hop_right, MOVEMENT_ACTION_ACRO_WHEELIE_HOP_RIGHT
|
||||
create_movement_action acro_wheelie_jump_down, MOVEMENT_ACTION_ACRO_WHEELIE_JUMP_DOWN
|
||||
create_movement_action acro_wheelie_jump_up, MOVEMENT_ACTION_ACRO_WHEELIE_JUMP_UP
|
||||
create_movement_action acro_wheelie_jump_left, MOVEMENT_ACTION_ACRO_WHEELIE_JUMP_LEFT
|
||||
create_movement_action acro_wheelie_jump_right, MOVEMENT_ACTION_ACRO_WHEELIE_JUMP_RIGHT
|
||||
create_movement_action acro_wheelie_in_place_down, MOVEMENT_ACTION_ACRO_WHEELIE_IN_PLACE_DOWN
|
||||
create_movement_action acro_wheelie_in_place_up, MOVEMENT_ACTION_ACRO_WHEELIE_IN_PLACE_UP
|
||||
create_movement_action acro_wheelie_in_place_left, MOVEMENT_ACTION_ACRO_WHEELIE_IN_PLACE_LEFT
|
||||
create_movement_action acro_wheelie_in_place_right, MOVEMENT_ACTION_ACRO_WHEELIE_IN_PLACE_RIGHT
|
||||
create_movement_action acro_pop_wheelie_move_down, MOVEMENT_ACTION_ACRO_POP_WHEELIE_MOVE_DOWN
|
||||
create_movement_action acro_pop_wheelie_move_up, MOVEMENT_ACTION_ACRO_POP_WHEELIE_MOVE_UP
|
||||
create_movement_action acro_pop_wheelie_move_left, MOVEMENT_ACTION_ACRO_POP_WHEELIE_MOVE_LEFT
|
||||
create_movement_action acro_pop_wheelie_move_right, MOVEMENT_ACTION_ACRO_POP_WHEELIE_MOVE_RIGHT
|
||||
create_movement_action acro_wheelie_move_down, MOVEMENT_ACTION_ACRO_WHEELIE_MOVE_DOWN
|
||||
create_movement_action acro_wheelie_move_up, MOVEMENT_ACTION_ACRO_WHEELIE_MOVE_UP
|
||||
create_movement_action acro_wheelie_move_left, MOVEMENT_ACTION_ACRO_WHEELIE_MOVE_LEFT
|
||||
create_movement_action acro_wheelie_move_right, MOVEMENT_ACTION_ACRO_WHEELIE_MOVE_RIGHT
|
||||
create_movement_action acro_end_wheelie_move_down, MOVEMENT_ACTION_ACRO_END_WHEELIE_MOVE_DOWN
|
||||
create_movement_action acro_end_wheelie_move_up, MOVEMENT_ACTION_ACRO_END_WHEELIE_MOVE_UP
|
||||
create_movement_action acro_end_wheelie_move_left, MOVEMENT_ACTION_ACRO_END_WHEELIE_MOVE_LEFT
|
||||
create_movement_action acro_end_wheelie_move_right, MOVEMENT_ACTION_ACRO_END_WHEELIE_MOVE_RIGHT
|
||||
create_movement_action walk_diag_northwest, MOVEMENT_ACTION_WALK_NORMAL_DIAGONAL_UP_LEFT
|
||||
create_movement_action walk_diag_northeast, MOVEMENT_ACTION_WALK_NORMAL_DIAGONAL_UP_RIGHT
|
||||
create_movement_action walk_diag_southwest, MOVEMENT_ACTION_WALK_NORMAL_DIAGONAL_DOWN_LEFT
|
||||
create_movement_action walk_diag_southeast, MOVEMENT_ACTION_WALK_NORMAL_DIAGONAL_DOWN_RIGHT
|
||||
create_movement_action walk_slow_diag_northwest, MOVEMENT_ACTION_WALK_SLOW_DIAGONAL_UP_LEFT
|
||||
create_movement_action walk_slow_diag_northeast, MOVEMENT_ACTION_WALK_SLOW_DIAGONAL_UP_RIGHT
|
||||
create_movement_action walk_slow_diag_southwest, MOVEMENT_ACTION_WALK_SLOW_DIAGONAL_DOWN_LEFT
|
||||
create_movement_action walk_slow_diag_southeast, MOVEMENT_ACTION_WALK_SLOW_DIAGONAL_DOWN_RIGHT
|
||||
create_movement_action store_lock_anim, MOVEMENT_ACTION_STORE_AND_LOCK_ANIM
|
||||
create_movement_action free_unlock_anim, MOVEMENT_ACTION_FREE_AND_UNLOCK_ANIM
|
||||
create_movement_action walk_left_affine, MOVEMENT_ACTION_WALK_LEFT_AFFINE
|
||||
create_movement_action walk_right_affine, MOVEMENT_ACTION_WALK_RIGHT_AFFINE
|
||||
create_movement_action levitate, MOVEMENT_ACTION_LEVITATE
|
||||
create_movement_action stop_levitate, MOVEMENT_ACTION_STOP_LEVITATE
|
||||
create_movement_action destroy_extra_task, MOVEMENT_ACTION_STOP_LEVITATE_AT_TOP
|
||||
create_movement_action figure_8, MOVEMENT_ACTION_FIGURE_8
|
||||
create_movement_action fly_up, MOVEMENT_ACTION_FLY_UP
|
||||
create_movement_action fly_down, MOVEMENT_ACTION_FLY_DOWN
|
||||
|
||||
create_movement_action step_end, MOVEMENT_ACTION_STEP_END
|
152
asm/macros/music_voice.inc
Normal file
152
asm/macros/music_voice.inc
Normal file
@ -0,0 +1,152 @@
|
||||
.macro voice_directsound base_midi_key:req, pan:req, sample_data_pointer:req, attack:req, decay:req, sustain:req, release:req
|
||||
.byte 0
|
||||
_voice_directsound \base_midi_key, \pan, \sample_data_pointer, \attack, \decay, \sustain, \release
|
||||
.endm
|
||||
|
||||
.macro voice_directsound_no_resample base_midi_key:req, pan:req, sample_data_pointer:req, attack:req, decay:req, sustain:req, release:req
|
||||
.byte 8
|
||||
_voice_directsound \base_midi_key, \pan, \sample_data_pointer, \attack, \decay, \sustain, \release
|
||||
.endm
|
||||
|
||||
.macro voice_directsound_alt base_midi_key:req, pan:req, sample_data_pointer:req, attack:req, decay:req, sustain:req, release:req
|
||||
.byte 16
|
||||
_voice_directsound \base_midi_key, \pan, \sample_data_pointer, \attack, \decay, \sustain, \release
|
||||
.endm
|
||||
|
||||
.macro _voice_directsound base_midi_key:req, pan:req, sample_data_pointer:req, attack:req, decay:req, sustain:req, release:req
|
||||
.byte \base_midi_key
|
||||
.byte 0
|
||||
.if \pan != 0
|
||||
.byte (0x80 | \pan)
|
||||
.else
|
||||
.byte 0
|
||||
.endif
|
||||
.4byte \sample_data_pointer
|
||||
.byte \attack
|
||||
.byte \decay
|
||||
.byte \sustain
|
||||
.byte \release
|
||||
.endm
|
||||
|
||||
.macro voice_square_1 base_midi_key:req, pan:req, sweep:req, duty_cycle:req, attack:req, decay:req, sustain:req, release:req
|
||||
_voice_square_1 1, \base_midi_key, \pan, \sweep, \duty_cycle, \attack, \decay, \sustain, \release
|
||||
.endm
|
||||
|
||||
.macro voice_square_1_alt base_midi_key:req, pan:req, sweep:req, duty_cycle:req, attack:req, decay:req, sustain:req, release:req
|
||||
_voice_square_1 9, \base_midi_key, \pan, \sweep, \duty_cycle, \attack, \decay, \sustain, \release
|
||||
.endm
|
||||
|
||||
.macro _voice_square_1 type:req, base_midi_key:req, pan:req, sweep:req, duty_cycle:req, attack:req, decay:req, sustain:req, release:req
|
||||
.byte \type
|
||||
.byte \base_midi_key
|
||||
.if \pan != 0
|
||||
.byte (0x80 | \pan)
|
||||
.else
|
||||
.byte 0
|
||||
.endif
|
||||
.byte \sweep
|
||||
.byte (\duty_cycle & 0x3)
|
||||
.byte 0, 0, 0
|
||||
.byte (\attack & 0x7)
|
||||
.byte (\decay & 0x7)
|
||||
.byte (\sustain & 0xF)
|
||||
.byte (\release & 0x7)
|
||||
.endm
|
||||
|
||||
.macro voice_square_2 base_midi_key:req, pan:req, duty_cycle:req, attack:req, decay:req, sustain:req, release:req
|
||||
_voice_square_2 2, \base_midi_key, \pan, \duty_cycle, \attack, \decay, \sustain, \release
|
||||
.endm
|
||||
|
||||
.macro voice_square_2_alt base_midi_key:req, pan:req, duty_cycle:req, attack:req, decay:req, sustain:req, release:req
|
||||
_voice_square_2 10, \base_midi_key, \pan, \duty_cycle, \attack, \decay, \sustain, \release
|
||||
.endm
|
||||
|
||||
.macro _voice_square_2 type:req, base_midi_key:req, pan:req, duty_cycle:req, attack:req, decay:req, sustain:req, release:req
|
||||
.byte \type
|
||||
.byte \base_midi_key
|
||||
.if \pan != 0
|
||||
.byte (0x80 | \pan)
|
||||
.else
|
||||
.byte 0
|
||||
.endif
|
||||
.byte 0
|
||||
.byte (\duty_cycle & 0x3)
|
||||
.byte 0, 0, 0
|
||||
.byte (\attack & 0x7)
|
||||
.byte (\decay & 0x7)
|
||||
.byte (\sustain & 0xF)
|
||||
.byte (\release & 0x7)
|
||||
.endm
|
||||
|
||||
.macro voice_programmable_wave base_midi_key:req, pan:req, wave_samples_pointer:req, attack:req, decay:req, sustain:req, release:req
|
||||
_voice_programmable_wave 3, \base_midi_key, \pan, \wave_samples_pointer, \attack, \decay, \sustain, \release
|
||||
.endm
|
||||
|
||||
.macro voice_programmable_wave_alt base_midi_key:req, pan:req, wave_samples_pointer:req, attack:req, decay:req, sustain:req, release:req
|
||||
_voice_programmable_wave 11, \base_midi_key, \pan, \wave_samples_pointer, \attack, \decay, \sustain, \release
|
||||
.endm
|
||||
|
||||
.macro _voice_programmable_wave type:req, base_midi_key:req, pan:req, wave_samples_pointer:req, attack:req, decay:req, sustain:req, release:req
|
||||
.byte \type
|
||||
.byte \base_midi_key
|
||||
.if \pan != 0
|
||||
.byte (0x80 | \pan)
|
||||
.else
|
||||
.byte 0
|
||||
.endif
|
||||
.byte 0
|
||||
.4byte \wave_samples_pointer
|
||||
.byte (\attack & 0x7)
|
||||
.byte (\decay & 0x7)
|
||||
.byte (\sustain & 0xF)
|
||||
.byte (\release & 0x7)
|
||||
.endm
|
||||
|
||||
.macro voice_noise base_midi_key:req, pan:req, period:req, attack:req, decay:req, sustain:req, release:req
|
||||
_voice_noise 4, \base_midi_key, \pan, \period, \attack, \decay, \sustain, \release
|
||||
.endm
|
||||
|
||||
.macro voice_noise_alt base_midi_key:req, pan:req, period:req, attack:req, decay:req, sustain:req, release:req
|
||||
_voice_noise 12, \base_midi_key, \pan, \period, \attack, \decay, \sustain, \release
|
||||
.endm
|
||||
|
||||
.macro _voice_noise type:req, base_midi_key:req, pan:req, period:req, attack:req, decay:req, sustain:req, release:req
|
||||
.byte \type
|
||||
.byte \base_midi_key
|
||||
.if \pan != 0
|
||||
.byte (0x80 | \pan)
|
||||
.else
|
||||
.byte 0
|
||||
.endif
|
||||
.byte 0
|
||||
.byte (\period & 0x1)
|
||||
.byte 0, 0, 0
|
||||
.byte (\attack & 0x7)
|
||||
.byte (\decay & 0x7)
|
||||
.byte (\sustain & 0xF)
|
||||
.byte (\release & 0x7)
|
||||
.endm
|
||||
|
||||
.macro voice_keysplit voice_group_pointer:req, keysplit_table_pointer:req
|
||||
.byte 0x40, 0, 0, 0
|
||||
.4byte \voice_group_pointer
|
||||
.4byte \keysplit_table_pointer
|
||||
.endm
|
||||
|
||||
.macro voice_keysplit_all voice_group_pointer:req
|
||||
.byte 0x80, 0, 0, 0
|
||||
.4byte \voice_group_pointer
|
||||
.4byte 0
|
||||
.endm
|
||||
|
||||
.macro cry sample:req
|
||||
.byte 0x20, 60, 0, 0
|
||||
.4byte \sample
|
||||
.byte 0xff, 0, 0xff, 0
|
||||
.endm
|
||||
|
||||
.macro cry_reverse sample:req
|
||||
.byte 0x30, 60, 0, 0
|
||||
.4byte \sample
|
||||
.byte 0xff, 0, 0xff, 0
|
||||
.endm
|
56
asm/macros/pokemon_data.inc
Normal file
56
asm/macros/pokemon_data.inc
Normal file
@ -0,0 +1,56 @@
|
||||
.macro pokedex_entry height, width, text_pointer, pokemon_scale, pokemon_offset, trainer_scale, trainer_offset
|
||||
.2byte \height @ in decimeters
|
||||
.2byte \width @ in hectograms
|
||||
.4byte \text_pointer
|
||||
.2byte 0 @ unused
|
||||
.2byte \pokemon_scale
|
||||
.2byte \pokemon_offset
|
||||
.2byte \trainer_scale
|
||||
.2byte \trainer_offset
|
||||
.2byte 0 @ padding
|
||||
.endm
|
||||
|
||||
.macro base_stats hp, attack, defense, speed, sp_attack, sp_defense
|
||||
.byte \hp
|
||||
.byte \attack
|
||||
.byte \defense
|
||||
.byte \speed
|
||||
.byte \sp_attack
|
||||
.byte \sp_defense
|
||||
.endm
|
||||
|
||||
.macro ev_yield hp, attack, defense, speed, sp_attack, sp_defense
|
||||
.2byte (\sp_defense << 10) | (\sp_attack << 8) | (\speed << 6) | (\defense << 4) | (\attack << 2) | \hp
|
||||
.endm
|
||||
|
||||
.macro level_up_move level, move
|
||||
.2byte (\level << 9) | \move
|
||||
.endm
|
||||
|
||||
.macro evo_entry method, parameter, target_species
|
||||
.2byte \method
|
||||
.2byte \parameter
|
||||
.2byte \target_species
|
||||
.2byte 0 @ padding
|
||||
.endm
|
||||
|
||||
.macro empty_evo_entries count
|
||||
.fill 8 * \count, 1, 0
|
||||
.endm
|
||||
|
||||
.macro egg_moves_begin species
|
||||
.2byte 20000 + \species
|
||||
.endm
|
||||
|
||||
@ If the min level equals the max level, only one level argument is needed.
|
||||
.macro wild_mon species, min_level, max_level
|
||||
.byte \min_level
|
||||
|
||||
.ifb \max_level
|
||||
.byte \min_level
|
||||
.else
|
||||
.byte \max_level
|
||||
.endif
|
||||
|
||||
.2byte \species
|
||||
.endm
|
108
asm/macros/trainer_hill.inc
Normal file
108
asm/macros/trainer_hill.inc
Normal file
@ -0,0 +1,108 @@
|
||||
@ Initialize the Trainer Hill challenge and start the timer
|
||||
.macro trainerhill_start
|
||||
setvar VAR_0x8004, TRAINER_HILL_FUNC_START
|
||||
special CallTrainerHillFunction
|
||||
.endm
|
||||
|
||||
@ 0 if not spoken to yet, 1 if spoken to but not received prize, 2 if received prize
|
||||
.macro trainerhill_getownerstate
|
||||
setvar VAR_0x8004, TRAINER_HILL_FUNC_GET_OWNER_STATE
|
||||
special CallTrainerHillFunction
|
||||
.endm
|
||||
|
||||
@ Try to give prize. 0 if given successfully, 1 if no room for prize, 2 if giving prize should be skipped
|
||||
.macro trainerhill_giveprize
|
||||
setvar VAR_0x8004, TRAINER_HILL_FUNC_GIVE_PRIZE
|
||||
special CallTrainerHillFunction
|
||||
.endm
|
||||
|
||||
@ Check the final challenge time. 0 if new record, 1 if not, 2 if time has already been checked
|
||||
.macro trainerhill_finaltime
|
||||
setvar VAR_0x8004, TRAINER_HILL_FUNC_CHECK_FINAL_TIME
|
||||
special CallTrainerHillFunction
|
||||
.endm
|
||||
|
||||
@ Resume the timer. Wont resume if owner has been spoken to or max time has been reached
|
||||
.macro trainerhill_resumetimer
|
||||
setvar VAR_0x8004, TRAINER_HILL_FUNC_RESUME_TIMER
|
||||
special CallTrainerHillFunction
|
||||
.endm
|
||||
|
||||
@ Set player lost the challenge (trainerHill.hasLost) to TRUE
|
||||
.macro trainerhill_lost
|
||||
setvar VAR_0x8004, TRAINER_HILL_FUNC_SET_LOST
|
||||
special CallTrainerHillFunction
|
||||
.endm
|
||||
|
||||
@ Get the current challenge status (TRAINER_HILL_PLAYER_STATUS_*)
|
||||
.macro trainerhill_getstatus
|
||||
setvar VAR_0x8004, TRAINER_HILL_FUNC_GET_CHALLENGE_STATUS
|
||||
special CallTrainerHillFunction
|
||||
.endm
|
||||
|
||||
@ Buffer the current timer to string vars (mins to STR_VAR_1, secs to STR_VAR_2, fraction of sec to STR_VAR_3)
|
||||
.macro trainerhill_gettime
|
||||
setvar VAR_0x8004, TRAINER_HILL_FUNC_GET_CHALLENGE_TIME
|
||||
special CallTrainerHillFunction
|
||||
.endm
|
||||
|
||||
@ FALSE if fewer than all 4 floors used, TRUE otherwise. Only FALSE in JP-exclusive modes
|
||||
.macro trainerhill_allfloorsused
|
||||
setvar VAR_0x8004, TRAINER_HILL_FUNC_GET_ALL_FLOORS_USED
|
||||
special CallTrainerHillFunction
|
||||
.endm
|
||||
|
||||
@ Unknown, dummied. E-Reader association is assumed. Only side effect is setting VAR_RESULT to 0.
|
||||
.macro trainerhill_getusingereader
|
||||
setvar VAR_0x8004, TRAINER_HILL_FUNC_GET_IN_EREADER_MODE
|
||||
special CallTrainerHillFunction
|
||||
.endm
|
||||
|
||||
@ TRUE if currently in a Trainer Hill challenge
|
||||
.macro trainerhill_inchallenge
|
||||
setvar VAR_0x8004, TRAINER_HILL_FUNC_IN_CHALLENGE
|
||||
special CallTrainerHillFunction
|
||||
.endm
|
||||
|
||||
@ Show the post battle text for the spoken to Trainer Hill trainer
|
||||
.macro trainerhill_postbattletext
|
||||
setvar VAR_0x8004, TRAINER_HILL_FUNC_POST_BATTLE_TEXT
|
||||
special CallTrainerHillFunction
|
||||
.endm
|
||||
|
||||
@ Set all Trainer Hill trainers defeated
|
||||
.macro trainerhill_settrainerflags
|
||||
setvar VAR_0x8004, TRAINER_HILL_FUNC_SET_ALL_TRAINER_FLAGS
|
||||
special CallTrainerHillFunction
|
||||
.endm
|
||||
|
||||
@ TRUE if the game has been saved for the challenge, FALSE otherwise
|
||||
.macro trainerhill_getsaved
|
||||
setvar VAR_0x8004, TRAINER_HILL_FUNC_GET_GAME_SAVED
|
||||
special CallTrainerHillFunction
|
||||
.endm
|
||||
|
||||
@ Set that the game has been saved for the challenge
|
||||
.macro trainerhill_setsaved
|
||||
setvar VAR_0x8004, TRAINER_HILL_FUNC_SET_GAME_SAVED
|
||||
special CallTrainerHillFunction
|
||||
.endm
|
||||
|
||||
@ Clear that the game has been saved for the challenge
|
||||
.macro trainerhill_clearsaved
|
||||
setvar VAR_0x8004, TRAINER_HILL_FUNC_CLEAR_GAME_SAVED
|
||||
special CallTrainerHillFunction
|
||||
.endm
|
||||
|
||||
@ FALSE if the Trainer Hill challenge was lost, TRUE otherwise
|
||||
.macro trainerhill_getwon
|
||||
setvar VAR_0x8004, TRAINER_HILL_FUNC_GET_WON
|
||||
special CallTrainerHillFunction
|
||||
.endm
|
||||
|
||||
@ Set the challenge mode to HILL_TAG_* (Normal, Variety, Unique, or Expert)
|
||||
.macro trainerhill_settag tag:req
|
||||
setvar VAR_0x8004, TRAINER_HILL_FUNC_SET_TAG
|
||||
copyvar VAR_0x8005, \tag
|
||||
special CallTrainerHillFunction
|
||||
.endm
|
35
asm/macros/window.inc
Normal file
35
asm/macros/window.inc
Normal file
@ -0,0 +1,35 @@
|
||||
.macro window_template bg_id, x, y, width, height, palette, vram_tile_offset
|
||||
.byte \bg_id
|
||||
.byte \x
|
||||
.byte \y
|
||||
.byte \width
|
||||
.byte \height
|
||||
.byte \palette
|
||||
.2byte \vram_tile_offset
|
||||
.endm
|
||||
|
||||
.macro null_window_template
|
||||
window_template 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0000
|
||||
.endm
|
||||
|
||||
.macro glyph_width_func font_id, func
|
||||
.4byte \font_id
|
||||
.4byte \func
|
||||
.endm
|
||||
|
||||
.macro keypad_icon tile_offset, width, height
|
||||
.2byte \tile_offset
|
||||
.byte \width
|
||||
.byte \height
|
||||
.endm
|
||||
|
||||
.macro font_info func, max_glyph_width, glyph_height, glyph_spacing, line_spacing, text_color, shadow_color, bg_color
|
||||
.4byte \func
|
||||
.byte \max_glyph_width
|
||||
.byte \glyph_height
|
||||
.byte \glyph_spacing
|
||||
.byte \line_spacing
|
||||
.byte \text_color << 4 @ low nybble seems unused
|
||||
.byte (\shadow_color << 4) | \bg_color
|
||||
.2byte 0 @ padding
|
||||
.endm
|
Reference in New Issue
Block a user