2018-12-02 19:24:06 +01:00
|
|
|
.macro if_random_less_than param0:req, param1:req
|
2017-12-30 16:04:31 +01:00
|
|
|
.byte 0x0
|
|
|
|
.byte \param0
|
|
|
|
.4byte \param1
|
|
|
|
.endm
|
|
|
|
|
2018-12-02 19:24:06 +01:00
|
|
|
.macro if_random_greater_than param0:req, param1:req
|
2017-12-30 16:04:31 +01:00
|
|
|
.byte 0x1
|
|
|
|
.byte \param0
|
|
|
|
.4byte \param1
|
|
|
|
.endm
|
|
|
|
|
2018-12-02 19:24:06 +01:00
|
|
|
.macro if_random_equal param0:req, param1:req
|
2017-12-30 16:04:31 +01:00
|
|
|
.byte 0x2
|
|
|
|
.byte \param0
|
|
|
|
.4byte \param1
|
|
|
|
.endm
|
|
|
|
|
2018-12-02 19:24:06 +01:00
|
|
|
.macro if_random_not_equal param0:req, param1:req
|
2017-12-30 16:04:31 +01:00
|
|
|
.byte 0x3
|
|
|
|
.byte \param0
|
|
|
|
.4byte \param1
|
|
|
|
.endm
|
|
|
|
|
2018-12-02 19:24:06 +01:00
|
|
|
.macro score param0:req
|
2017-12-30 16:04:31 +01:00
|
|
|
.byte 0x4
|
|
|
|
.byte \param0
|
|
|
|
.endm
|
|
|
|
|
2018-12-02 19:24:06 +01:00
|
|
|
.macro if_hp_less_than battler:req, param1:req, param2:req
|
2017-12-30 16:04:31 +01:00
|
|
|
.byte 0x5
|
2018-09-01 18:36:08 +02:00
|
|
|
.byte \battler
|
2017-12-30 16:04:31 +01:00
|
|
|
.byte \param1
|
|
|
|
.4byte \param2
|
|
|
|
.endm
|
|
|
|
|
2018-12-02 19:24:06 +01:00
|
|
|
.macro if_hp_more_than battler:req, param1:req, param2:req
|
2017-12-30 16:04:31 +01:00
|
|
|
.byte 0x6
|
2018-09-01 18:36:08 +02:00
|
|
|
.byte \battler
|
2017-12-30 16:04:31 +01:00
|
|
|
.byte \param1
|
|
|
|
.4byte \param2
|
|
|
|
.endm
|
|
|
|
|
2018-12-02 19:24:06 +01:00
|
|
|
.macro if_hp_equal battler:req, param1:req, param2:req
|
2017-12-30 16:04:31 +01:00
|
|
|
.byte 0x7
|
2018-09-01 18:36:08 +02:00
|
|
|
.byte \battler
|
2017-12-30 16:04:31 +01:00
|
|
|
.byte \param1
|
|
|
|
.4byte \param2
|
|
|
|
.endm
|
|
|
|
|
2018-12-02 19:24:06 +01:00
|
|
|
.macro if_hp_not_equal battler:req, param1:req, param2:req
|
2017-12-30 16:04:31 +01:00
|
|
|
.byte 0x8
|
2018-09-01 18:36:08 +02:00
|
|
|
.byte \battler
|
2017-12-30 16:04:31 +01:00
|
|
|
.byte \param1
|
|
|
|
.4byte \param2
|
|
|
|
.endm
|
|
|
|
|
2018-12-02 19:24:06 +01:00
|
|
|
.macro if_status battler:req, status1:req, param2:req
|
2017-12-30 16:04:31 +01:00
|
|
|
.byte 0x9
|
2018-09-01 18:36:08 +02:00
|
|
|
.byte \battler
|
2017-12-30 16:04:31 +01:00
|
|
|
.4byte \status1
|
|
|
|
.4byte \param2
|
|
|
|
.endm
|
|
|
|
|
2018-12-02 19:24:06 +01:00
|
|
|
.macro if_not_status battler:req, status1:req, param2:req
|
2017-12-30 16:04:31 +01:00
|
|
|
.byte 0xa
|
2018-09-01 18:36:08 +02:00
|
|
|
.byte \battler
|
2017-12-30 16:04:31 +01:00
|
|
|
.4byte \status1
|
|
|
|
.4byte \param2
|
|
|
|
.endm
|
|
|
|
|
2018-12-02 19:24:06 +01:00
|
|
|
.macro if_status2 battler:req, status2:req, param2:req
|
2017-12-30 16:04:31 +01:00
|
|
|
.byte 0xb
|
2018-09-01 18:36:08 +02:00
|
|
|
.byte \battler
|
2017-12-30 16:04:31 +01:00
|
|
|
.4byte \status2
|
|
|
|
.4byte \param2
|
|
|
|
.endm
|
|
|
|
|
2018-12-02 19:24:06 +01:00
|
|
|
.macro if_not_status2 battler:req, status2:req, param2:req
|
2017-12-30 16:04:31 +01:00
|
|
|
.byte 0xc
|
2018-09-01 18:36:08 +02:00
|
|
|
.byte \battler
|
2017-12-30 16:04:31 +01:00
|
|
|
.4byte \status2
|
|
|
|
.4byte \param2
|
|
|
|
.endm
|
|
|
|
|
2018-12-02 19:24:06 +01:00
|
|
|
.macro if_status3 battler:req, status3:req, param2:req
|
2017-12-30 16:04:31 +01:00
|
|
|
.byte 0xd
|
2018-09-01 18:36:08 +02:00
|
|
|
.byte \battler
|
2017-12-30 16:04:31 +01:00
|
|
|
.4byte \status3
|
|
|
|
.4byte \param2
|
|
|
|
.endm
|
|
|
|
|
2018-12-02 19:24:06 +01:00
|
|
|
.macro if_not_status3 battler:req, status3:req, param2:req
|
2017-12-30 16:04:31 +01:00
|
|
|
.byte 0xe
|
2018-09-01 18:36:08 +02:00
|
|
|
.byte \battler
|
2017-12-30 16:04:31 +01:00
|
|
|
.4byte \status3
|
|
|
|
.4byte \param2
|
|
|
|
.endm
|
|
|
|
|
2018-12-02 19:24:06 +01:00
|
|
|
.macro if_side_affecting battler:req, sidestatus:req, param2:req
|
2017-12-30 16:04:31 +01:00
|
|
|
.byte 0xf
|
2018-09-01 18:36:08 +02:00
|
|
|
.byte \battler
|
2017-12-30 16:04:31 +01:00
|
|
|
.4byte \sidestatus
|
|
|
|
.4byte \param2
|
|
|
|
.endm
|
|
|
|
|
2018-12-02 19:24:06 +01:00
|
|
|
.macro if_not_side_affecting battler:req, sidestatus:req, param2:req
|
2017-12-30 16:04:31 +01:00
|
|
|
.byte 0x10
|
2018-09-01 18:36:08 +02:00
|
|
|
.byte \battler
|
2017-12-30 16:04:31 +01:00
|
|
|
.4byte \sidestatus
|
|
|
|
.4byte \param2
|
|
|
|
.endm
|
|
|
|
|
2018-12-02 19:24:06 +01:00
|
|
|
.macro if_less_than param0:req, param1:req
|
2017-12-30 16:04:31 +01:00
|
|
|
.byte 0x11
|
|
|
|
.byte \param0
|
|
|
|
.4byte \param1
|
|
|
|
.endm
|
|
|
|
|
2018-12-02 19:24:06 +01:00
|
|
|
.macro if_more_than param0:req, param1:req
|
2017-12-30 16:04:31 +01:00
|
|
|
.byte 0x12
|
|
|
|
.byte \param0
|
|
|
|
.4byte \param1
|
|
|
|
.endm
|
|
|
|
|
2018-12-02 19:24:06 +01:00
|
|
|
.macro if_equal param0:req, param1:req
|
2017-12-30 16:04:31 +01:00
|
|
|
.byte 0x13
|
|
|
|
.byte \param0
|
|
|
|
.4byte \param1
|
|
|
|
.endm
|
|
|
|
|
2018-12-02 19:24:06 +01:00
|
|
|
.macro if_not_equal param0:req, param1:req
|
2017-12-30 16:04:31 +01:00
|
|
|
.byte 0x14
|
|
|
|
.byte \param0
|
|
|
|
.4byte \param1
|
|
|
|
.endm
|
|
|
|
|
2018-12-02 19:24:06 +01:00
|
|
|
.macro if_less_than_ptr param0:req, param1:req
|
2017-12-30 16:04:31 +01:00
|
|
|
.byte 0x15
|
|
|
|
.4byte \param0
|
|
|
|
.4byte \param1
|
|
|
|
.endm
|
|
|
|
|
2018-12-02 19:24:06 +01:00
|
|
|
.macro if_more_than_ptr param0:req, param1:req
|
2017-12-30 16:04:31 +01:00
|
|
|
.byte 0x16
|
|
|
|
.4byte \param0
|
|
|
|
.4byte \param1
|
|
|
|
.endm
|
|
|
|
|
2018-12-02 19:24:06 +01:00
|
|
|
.macro if_equal_ptr param0:req, param1:req
|
2017-12-30 16:04:31 +01:00
|
|
|
.byte 0x17
|
|
|
|
.4byte \param0
|
|
|
|
.4byte \param1
|
|
|
|
.endm
|
|
|
|
|
2018-12-02 19:24:06 +01:00
|
|
|
.macro if_not_equal_ptr param0:req, param1:req
|
2017-12-30 16:04:31 +01:00
|
|
|
.byte 0x18
|
|
|
|
.4byte \param0
|
|
|
|
.4byte \param1
|
|
|
|
.endm
|
|
|
|
|
2018-12-02 19:24:06 +01:00
|
|
|
.macro if_move param0:req, param1:req
|
2017-12-30 16:04:31 +01:00
|
|
|
.byte 0x19
|
|
|
|
.2byte \param0
|
|
|
|
.4byte \param1
|
|
|
|
.endm
|
|
|
|
|
2018-12-02 19:24:06 +01:00
|
|
|
.macro if_not_move param0:req, param1:req
|
2017-12-30 16:04:31 +01:00
|
|
|
.byte 0x1a
|
|
|
|
.2byte \param0
|
|
|
|
.4byte \param1
|
|
|
|
.endm
|
|
|
|
|
2018-12-02 19:24:06 +01:00
|
|
|
.macro if_in_bytes param0:req, param1:req
|
2017-12-30 16:04:31 +01:00
|
|
|
.byte 0x1b
|
|
|
|
.4byte \param0
|
|
|
|
.4byte \param1
|
|
|
|
.endm
|
|
|
|
|
2018-12-02 19:24:06 +01:00
|
|
|
.macro if_not_in_bytes param0:req, param1:req
|
2017-12-30 16:04:31 +01:00
|
|
|
.byte 0x1c
|
|
|
|
.4byte \param0
|
|
|
|
.4byte \param1
|
|
|
|
.endm
|
|
|
|
|
2018-12-02 19:24:06 +01:00
|
|
|
.macro if_in_hwords param0:req, param1:req
|
2017-12-30 16:04:31 +01:00
|
|
|
.byte 0x1d
|
|
|
|
.4byte \param0
|
|
|
|
.4byte \param1
|
|
|
|
.endm
|
|
|
|
|
2018-12-02 19:24:06 +01:00
|
|
|
.macro if_not_in_hwords param0:req, param1:req
|
2017-12-30 16:04:31 +01:00
|
|
|
.byte 0x1e
|
|
|
|
.4byte \param0
|
|
|
|
.4byte \param1
|
|
|
|
.endm
|
|
|
|
|
2018-12-02 19:24:06 +01:00
|
|
|
.macro if_user_has_attacking_move param0:req
|
2017-12-30 16:04:31 +01:00
|
|
|
.byte 0x1f
|
|
|
|
.4byte \param0
|
|
|
|
.endm
|
|
|
|
|
2018-12-02 19:24:06 +01:00
|
|
|
.macro if_user_has_no_attacking_moves param0:req
|
2017-12-30 16:04:31 +01:00
|
|
|
.byte 0x20
|
|
|
|
.4byte \param0
|
|
|
|
.endm
|
|
|
|
|
|
|
|
.macro get_turn_count
|
|
|
|
.byte 0x21
|
|
|
|
.endm
|
|
|
|
|
2018-12-02 19:24:06 +01:00
|
|
|
.macro get_type param0:req
|
2017-12-30 16:04:31 +01:00
|
|
|
.byte 0x22
|
|
|
|
.byte \param0
|
|
|
|
.endm
|
|
|
|
|
|
|
|
.macro get_considered_move_power
|
|
|
|
.byte 0x23
|
|
|
|
.endm
|
|
|
|
|
|
|
|
.macro get_how_powerful_move_is
|
|
|
|
.byte 0x24
|
|
|
|
.endm
|
|
|
|
|
2018-12-02 19:24:06 +01:00
|
|
|
.macro get_last_used_bank_move battler:req
|
2017-12-30 16:04:31 +01:00
|
|
|
.byte 0x25
|
2018-09-01 18:36:08 +02:00
|
|
|
.byte \battler
|
2017-12-30 16:04:31 +01:00
|
|
|
.endm
|
|
|
|
|
2019-05-20 10:10:00 +02:00
|
|
|
.macro if_equal_u32 param0:req, param1:req
|
2017-12-30 16:04:31 +01:00
|
|
|
.byte 0x26
|
2019-05-20 10:10:00 +02:00
|
|
|
.4byte \param0
|
2017-12-30 16:04:31 +01:00
|
|
|
.4byte \param1
|
|
|
|
.endm
|
|
|
|
|
2019-05-20 10:10:00 +02:00
|
|
|
.macro if_not_equal_u32 param0:req, param1:req
|
2017-12-30 16:04:31 +01:00
|
|
|
.byte 0x27
|
2019-05-20 10:10:00 +02:00
|
|
|
.4byte \param0
|
2017-12-30 16:04:31 +01:00
|
|
|
.4byte \param1
|
|
|
|
.endm
|
|
|
|
|
2018-12-02 19:24:06 +01:00
|
|
|
.macro if_user_goes param0:req, param1:req
|
2017-12-30 16:04:31 +01:00
|
|
|
.byte 0x28
|
|
|
|
.byte \param0
|
|
|
|
.4byte \param1
|
|
|
|
.endm
|
|
|
|
|
2019-02-16 18:23:56 +01:00
|
|
|
.macro if_cant_use_belch battler:req, ptr:req
|
2017-12-30 16:04:31 +01:00
|
|
|
.byte 0x29
|
2019-02-16 18:23:56 +01:00
|
|
|
.byte \battler
|
|
|
|
.4byte \ptr
|
2017-12-30 16:04:31 +01:00
|
|
|
.endm
|
|
|
|
|
2021-11-17 21:47:47 +01:00
|
|
|
.macro nop_2A
|
2017-12-30 16:04:31 +01:00
|
|
|
.byte 0x2a
|
|
|
|
.endm
|
|
|
|
|
2021-11-17 21:47:47 +01:00
|
|
|
.macro nop_2B
|
2017-12-30 16:04:31 +01:00
|
|
|
.byte 0x2b
|
|
|
|
.endm
|
|
|
|
|
2018-12-02 19:24:06 +01:00
|
|
|
.macro count_usable_party_mons battler:req
|
2017-12-30 16:04:31 +01:00
|
|
|
.byte 0x2c
|
2018-09-01 18:36:08 +02:00
|
|
|
.byte \battler
|
2017-12-30 16:04:31 +01:00
|
|
|
.endm
|
|
|
|
|
|
|
|
.macro get_considered_move
|
|
|
|
.byte 0x2d
|
|
|
|
.endm
|
|
|
|
|
|
|
|
.macro get_considered_move_effect
|
|
|
|
.byte 0x2e
|
|
|
|
.endm
|
|
|
|
|
2018-12-02 19:24:06 +01:00
|
|
|
.macro get_ability battler:req
|
2017-12-30 16:04:31 +01:00
|
|
|
.byte 0x2f
|
2018-09-01 18:36:08 +02:00
|
|
|
.byte \battler
|
2017-12-30 16:04:31 +01:00
|
|
|
.endm
|
|
|
|
|
|
|
|
.macro get_highest_type_effectiveness
|
|
|
|
.byte 0x30
|
|
|
|
.endm
|
|
|
|
|
2018-12-02 19:24:06 +01:00
|
|
|
.macro if_type_effectiveness param0:req, param1:req
|
2017-12-30 16:04:31 +01:00
|
|
|
.byte 0x31
|
|
|
|
.byte \param0
|
|
|
|
.4byte \param1
|
|
|
|
.endm
|
|
|
|
|
2021-11-17 21:47:47 +01:00
|
|
|
.macro nop_32
|
2017-12-30 16:04:31 +01:00
|
|
|
.byte 0x32
|
|
|
|
.endm
|
|
|
|
|
2021-11-17 21:47:47 +01:00
|
|
|
.macro nop_33
|
2017-12-30 16:04:31 +01:00
|
|
|
.byte 0x33
|
|
|
|
.endm
|
|
|
|
|
2018-12-02 19:24:06 +01:00
|
|
|
.macro if_status_in_party battler:req, status1:req, param2:req
|
2017-12-30 16:04:31 +01:00
|
|
|
.byte 0x34
|
2018-09-01 18:36:08 +02:00
|
|
|
.byte \battler
|
2017-12-30 16:04:31 +01:00
|
|
|
.4byte \status1
|
|
|
|
.4byte \param2
|
|
|
|
.endm
|
|
|
|
|
2018-12-02 19:24:06 +01:00
|
|
|
.macro if_status_not_in_party battler:req, status1:req, param2:req
|
2017-12-30 16:04:31 +01:00
|
|
|
.byte 0x35
|
2018-09-01 18:36:08 +02:00
|
|
|
.byte \battler
|
2017-12-30 16:04:31 +01:00
|
|
|
.4byte \status1
|
|
|
|
.4byte \param2
|
|
|
|
.endm
|
|
|
|
|
|
|
|
.macro get_weather
|
|
|
|
.byte 0x36
|
|
|
|
.endm
|
|
|
|
|
2018-12-02 19:24:06 +01:00
|
|
|
.macro if_effect param0:req, param1:req
|
2017-12-30 16:04:31 +01:00
|
|
|
.byte 0x37
|
2018-09-02 15:50:18 +02:00
|
|
|
.2byte \param0
|
2017-12-30 16:04:31 +01:00
|
|
|
.4byte \param1
|
|
|
|
.endm
|
|
|
|
|
2018-12-02 19:24:06 +01:00
|
|
|
.macro if_not_effect param0:req, param1:req
|
2017-12-30 16:04:31 +01:00
|
|
|
.byte 0x38
|
2018-09-02 15:50:18 +02:00
|
|
|
.2byte \param0
|
2017-12-30 16:04:31 +01:00
|
|
|
.4byte \param1
|
|
|
|
.endm
|
|
|
|
|
2018-12-02 19:24:06 +01:00
|
|
|
.macro if_stat_level_less_than battler:req, stat:req, param2:req, param3:req
|
2017-12-30 16:04:31 +01:00
|
|
|
.byte 0x39
|
2018-09-01 18:36:08 +02:00
|
|
|
.byte \battler
|
2017-12-30 16:04:31 +01:00
|
|
|
.byte \stat
|
|
|
|
.byte \param2
|
|
|
|
.4byte \param3
|
|
|
|
.endm
|
|
|
|
|
2018-12-02 19:24:06 +01:00
|
|
|
.macro if_stat_level_more_than battler:req, stat:req, param2:req, param3:req
|
2017-12-30 16:04:31 +01:00
|
|
|
.byte 0x3a
|
2018-09-01 18:36:08 +02:00
|
|
|
.byte \battler
|
2017-12-30 16:04:31 +01:00
|
|
|
.byte \stat
|
|
|
|
.byte \param2
|
|
|
|
.4byte \param3
|
|
|
|
.endm
|
|
|
|
|
2018-12-02 19:24:06 +01:00
|
|
|
.macro if_stat_level_equal battler:req, stat:req, param2:req, param3:req
|
2017-12-30 16:04:31 +01:00
|
|
|
.byte 0x3b
|
2018-09-01 18:36:08 +02:00
|
|
|
.byte \battler
|
2017-12-30 16:04:31 +01:00
|
|
|
.byte \stat
|
|
|
|
.byte \param2
|
|
|
|
.4byte \param3
|
|
|
|
.endm
|
|
|
|
|
2018-12-02 19:24:06 +01:00
|
|
|
.macro if_stat_level_not_equal battler:req, stat:req, param2:req, param3:req
|
2017-12-30 16:04:31 +01:00
|
|
|
.byte 0x3c
|
2018-09-01 18:36:08 +02:00
|
|
|
.byte \battler
|
2017-12-30 16:04:31 +01:00
|
|
|
.byte \stat
|
|
|
|
.byte \param2
|
|
|
|
.4byte \param3
|
|
|
|
.endm
|
|
|
|
|
2018-12-02 19:24:06 +01:00
|
|
|
.macro if_can_faint param0:req
|
2017-12-30 16:04:31 +01:00
|
|
|
.byte 0x3d
|
|
|
|
.4byte \param0
|
|
|
|
.endm
|
|
|
|
|
2018-12-02 19:24:06 +01:00
|
|
|
.macro if_cant_faint param0:req
|
2017-12-30 16:04:31 +01:00
|
|
|
.byte 0x3e
|
|
|
|
.4byte \param0
|
|
|
|
.endm
|
|
|
|
|
2018-12-02 19:24:06 +01:00
|
|
|
.macro if_has_move battler:req, param1:req, param2:req
|
2017-12-30 16:04:31 +01:00
|
|
|
.byte 0x3f
|
2018-09-01 18:36:08 +02:00
|
|
|
.byte \battler
|
2017-12-30 16:04:31 +01:00
|
|
|
.2byte \param1
|
|
|
|
.4byte \param2
|
|
|
|
.endm
|
|
|
|
|
2018-12-02 19:24:06 +01:00
|
|
|
.macro if_doesnt_have_move battler:req, param1:req, param2:req
|
2017-12-30 16:04:31 +01:00
|
|
|
.byte 0x40
|
2018-09-01 18:36:08 +02:00
|
|
|
.byte \battler
|
2017-12-30 16:04:31 +01:00
|
|
|
.2byte \param1
|
|
|
|
.4byte \param2
|
|
|
|
.endm
|
|
|
|
|
2018-12-02 19:24:06 +01:00
|
|
|
.macro if_has_move_with_effect battler:req, param1:req, param2:req
|
2017-12-30 16:04:31 +01:00
|
|
|
.byte 0x41
|
2018-09-01 18:36:08 +02:00
|
|
|
.byte \battler
|
2017-12-30 16:04:31 +01:00
|
|
|
.byte \param1
|
|
|
|
.4byte \param2
|
|
|
|
.endm
|
|
|
|
|
2018-12-02 19:24:06 +01:00
|
|
|
.macro if_doesnt_have_move_with_effect battler:req, param1:req, param2:req
|
2017-12-30 16:04:31 +01:00
|
|
|
.byte 0x42
|
2018-09-01 18:36:08 +02:00
|
|
|
.byte \battler
|
2017-12-30 16:04:31 +01:00
|
|
|
.byte \param1
|
|
|
|
.4byte \param2
|
|
|
|
.endm
|
|
|
|
|
2018-12-02 19:24:06 +01:00
|
|
|
.macro if_any_move_disabled_or_encored battler:req, param1:req, param2:req
|
2017-12-30 16:04:31 +01:00
|
|
|
.byte 0x43
|
2018-09-01 18:36:08 +02:00
|
|
|
.byte \battler
|
2017-12-30 16:04:31 +01:00
|
|
|
.byte \param1
|
|
|
|
.4byte \param2
|
|
|
|
.endm
|
|
|
|
|
2018-12-02 19:24:06 +01:00
|
|
|
.macro if_curr_move_disabled_or_encored param0:req, param1:req
|
2017-12-30 16:04:31 +01:00
|
|
|
.byte 0x44
|
|
|
|
.byte \param0
|
|
|
|
.4byte \param1
|
|
|
|
.endm
|
|
|
|
|
|
|
|
.macro flee
|
|
|
|
.byte 0x45
|
|
|
|
.endm
|
|
|
|
|
2018-12-02 19:24:06 +01:00
|
|
|
.macro if_random_safari_flee param0:req
|
2017-12-30 16:04:31 +01:00
|
|
|
.byte 0x46
|
|
|
|
.4byte \param0
|
|
|
|
.endm
|
|
|
|
|
|
|
|
.macro watch
|
|
|
|
.byte 0x47
|
|
|
|
.endm
|
|
|
|
|
2018-12-02 19:24:06 +01:00
|
|
|
.macro get_hold_effect battler:req
|
2017-12-30 16:04:31 +01:00
|
|
|
.byte 0x48
|
2018-09-01 18:36:08 +02:00
|
|
|
.byte \battler
|
2017-12-30 16:04:31 +01:00
|
|
|
.endm
|
|
|
|
|
2018-12-02 19:24:06 +01:00
|
|
|
.macro get_gender battler:req
|
2017-12-30 16:04:31 +01:00
|
|
|
.byte 0x49
|
2018-09-01 18:36:08 +02:00
|
|
|
.byte \battler
|
2017-12-30 16:04:31 +01:00
|
|
|
.endm
|
|
|
|
|
2018-12-02 19:24:06 +01:00
|
|
|
.macro is_first_turn_for battler:req
|
2017-12-30 16:04:31 +01:00
|
|
|
.byte 0x4a
|
2018-09-01 18:36:08 +02:00
|
|
|
.byte \battler
|
2017-12-30 16:04:31 +01:00
|
|
|
.endm
|
|
|
|
|
2018-12-02 19:24:06 +01:00
|
|
|
.macro get_stockpile_count battler:req
|
2017-12-30 16:04:31 +01:00
|
|
|
.byte 0x4b
|
2018-09-01 18:36:08 +02:00
|
|
|
.byte \battler
|
2017-12-30 16:04:31 +01:00
|
|
|
.endm
|
|
|
|
|
|
|
|
.macro is_double_battle
|
|
|
|
.byte 0x4c
|
|
|
|
.endm
|
|
|
|
|
2018-12-02 19:24:06 +01:00
|
|
|
.macro get_used_held_item battler:req
|
2017-12-30 16:04:31 +01:00
|
|
|
.byte 0x4d
|
2018-09-01 18:36:08 +02:00
|
|
|
.byte \battler
|
2017-12-30 16:04:31 +01:00
|
|
|
.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
|
|
|
|
|
2018-12-02 19:24:06 +01:00
|
|
|
.macro get_protect_count battler:req
|
2017-12-30 16:04:31 +01:00
|
|
|
.byte 0x51
|
2018-09-01 18:36:08 +02:00
|
|
|
.byte \battler
|
2017-12-30 16:04:31 +01:00
|
|
|
.endm
|
|
|
|
|
2018-07-14 12:54:12 +02:00
|
|
|
.macro if_move_flag flag jumpptr
|
2017-12-30 16:04:31 +01:00
|
|
|
.byte 0x52
|
2018-09-02 15:50:18 +02:00
|
|
|
.4byte \flag
|
2018-08-11 12:16:00 +02:00
|
|
|
.4byte \jumpptr
|
2017-12-30 16:04:31 +01:00
|
|
|
.endm
|
|
|
|
|
2018-07-14 16:41:14 +02:00
|
|
|
.macro if_field_status flag jumpptr
|
2017-12-30 16:04:31 +01:00
|
|
|
.byte 0x53
|
2018-09-02 15:50:18 +02:00
|
|
|
.4byte \flag
|
|
|
|
.4byte \jumpptr
|
2017-12-30 16:04:31 +01:00
|
|
|
.endm
|
|
|
|
|
2018-08-11 12:16:00 +02:00
|
|
|
.macro get_move_accuracy
|
2017-12-30 16:04:31 +01:00
|
|
|
.byte 0x54
|
|
|
|
.endm
|
|
|
|
|
2018-08-11 12:16:00 +02:00
|
|
|
.macro call_if_eq value, ptr
|
2017-12-30 16:04:31 +01:00
|
|
|
.byte 0x55
|
2018-08-11 12:16:00 +02:00
|
|
|
.2byte \value
|
|
|
|
.4byte \ptr
|
2017-12-30 16:04:31 +01:00
|
|
|
.endm
|
|
|
|
|
2018-08-11 12:16:00 +02:00
|
|
|
.macro call_if_move_flag flag ptr
|
2017-12-30 16:04:31 +01:00
|
|
|
.byte 0x56
|
2018-09-02 15:50:18 +02:00
|
|
|
.4byte \flag
|
2018-08-11 12:16:00 +02:00
|
|
|
.4byte \ptr
|
2017-12-30 16:04:31 +01:00
|
|
|
.endm
|
|
|
|
|
2021-11-17 21:47:47 +01:00
|
|
|
.macro nop_57
|
2017-12-30 16:04:31 +01:00
|
|
|
.byte 0x57
|
|
|
|
.endm
|
|
|
|
|
2018-12-02 19:24:06 +01:00
|
|
|
.macro call param0:req
|
2017-12-30 16:04:31 +01:00
|
|
|
.byte 0x58
|
|
|
|
.4byte \param0
|
|
|
|
.endm
|
|
|
|
|
2018-12-02 19:24:06 +01:00
|
|
|
.macro goto param0:req
|
2017-12-30 16:04:31 +01:00
|
|
|
.byte 0x59
|
|
|
|
.4byte \param0
|
|
|
|
.endm
|
|
|
|
|
|
|
|
.macro end
|
|
|
|
.byte 0x5a
|
|
|
|
.endm
|
|
|
|
|
2018-12-02 19:24:06 +01:00
|
|
|
.macro if_level_cond param0:req, param1:req
|
2017-12-30 16:04:31 +01:00
|
|
|
.byte 0x5b
|
|
|
|
.byte \param0
|
|
|
|
.4byte \param1
|
|
|
|
.endm
|
|
|
|
|
2018-12-02 19:24:06 +01:00
|
|
|
.macro if_target_taunted param0:req
|
2017-12-30 16:04:31 +01:00
|
|
|
.byte 0x5c
|
|
|
|
.4byte \param0
|
|
|
|
.endm
|
|
|
|
|
2018-12-02 19:24:06 +01:00
|
|
|
.macro if_target_not_taunted param0:req
|
2017-12-30 16:04:31 +01:00
|
|
|
.byte 0x5d
|
|
|
|
.4byte \param0
|
|
|
|
.endm
|
|
|
|
|
2018-12-02 19:24:06 +01:00
|
|
|
.macro if_target_is_ally param0:req
|
2017-12-30 16:04:31 +01:00
|
|
|
.byte 0x5e
|
|
|
|
.4byte \param0
|
|
|
|
.endm
|
|
|
|
|
2018-12-02 19:24:06 +01:00
|
|
|
.macro is_of_type battler:req, type:req
|
2017-12-30 16:04:31 +01:00
|
|
|
.byte 0x5f
|
2018-09-01 18:36:08 +02:00
|
|
|
.byte \battler
|
2017-12-30 16:04:31 +01:00
|
|
|
.byte \type
|
|
|
|
.endm
|
|
|
|
|
2018-12-02 19:24:06 +01:00
|
|
|
.macro check_ability battler:req, ability:req
|
2017-12-30 16:04:31 +01:00
|
|
|
.byte 0x60
|
2018-09-01 18:36:08 +02:00
|
|
|
.byte \battler
|
2017-12-30 16:04:31 +01:00
|
|
|
.byte \ability
|
|
|
|
.endm
|
|
|
|
|
2018-12-02 19:24:06 +01:00
|
|
|
.macro if_flash_fired battler:req, param1:req
|
2017-12-30 16:04:31 +01:00
|
|
|
.byte 0x61
|
2018-09-01 18:36:08 +02:00
|
|
|
.byte \battler
|
2017-12-30 16:04:31 +01:00
|
|
|
.4byte \param1
|
|
|
|
.endm
|
|
|
|
|
2018-12-02 19:24:06 +01:00
|
|
|
.macro if_holds_item battler:req, param1:req, param2:req
|
2017-12-30 16:04:31 +01:00
|
|
|
.byte 0x62
|
2018-09-01 18:36:08 +02:00
|
|
|
.byte \battler
|
2017-12-30 16:04:31 +01:00
|
|
|
.2byte \param1
|
|
|
|
.4byte \param2
|
|
|
|
.endm
|
2022-09-11 20:14:49 +02:00
|
|
|
|
2018-09-02 15:50:18 +02:00
|
|
|
.macro get_ally_chosen_move
|
2018-09-01 17:36:09 +02:00
|
|
|
.byte 0x63
|
|
|
|
.endm
|
2022-09-13 21:22:42 +02:00
|
|
|
|
2018-12-02 22:05:23 +01:00
|
|
|
.macro if_has_no_attacking_moves battler:req, param1:req
|
2018-09-01 17:36:09 +02:00
|
|
|
.byte 0x64
|
2018-09-02 15:50:18 +02:00
|
|
|
.byte \battler
|
2018-09-01 17:36:09 +02:00
|
|
|
.4byte \param1
|
|
|
|
.endm
|
2022-09-13 21:22:42 +02:00
|
|
|
|
2018-12-02 22:05:23 +01:00
|
|
|
.macro get_hazards_count battler:req, effect:req
|
2018-09-02 15:50:18 +02:00
|
|
|
.byte 0x65
|
|
|
|
.byte \battler
|
|
|
|
.2byte \effect
|
|
|
|
.endm
|
2022-09-13 21:22:42 +02:00
|
|
|
|
2018-12-02 22:05:23 +01:00
|
|
|
.macro if_doesnt_hold_berry battler:req, ptr:req
|
2018-09-02 15:50:18 +02:00
|
|
|
.byte 0x66
|
|
|
|
.byte \battler
|
|
|
|
.4byte \ptr
|
|
|
|
.endm
|
2022-09-13 21:22:42 +02:00
|
|
|
|
2018-12-02 23:50:51 +01:00
|
|
|
.macro if_share_type battler1:req, battler2:req, ptr:req
|
|
|
|
.byte 0x67
|
|
|
|
.byte \battler1
|
|
|
|
.byte \battler2
|
|
|
|
.4byte \ptr
|
|
|
|
.endm
|
2022-09-13 21:22:42 +02:00
|
|
|
|
2018-12-02 23:50:51 +01:00
|
|
|
.macro if_cant_use_last_resort battler:req, ptr:req
|
|
|
|
.byte 0x68
|
|
|
|
.byte \battler
|
|
|
|
.4byte \ptr
|
|
|
|
.endm
|
2022-09-13 21:22:42 +02:00
|
|
|
|
2019-02-09 13:21:32 +01:00
|
|
|
.macro if_has_move_with_split battler:req, split:req, ptr:req
|
|
|
|
.byte 0x69
|
|
|
|
.byte \battler
|
|
|
|
.byte \split
|
|
|
|
.4byte \ptr
|
|
|
|
.endm
|
2022-09-13 21:22:42 +02:00
|
|
|
|
2019-02-09 13:21:32 +01:00
|
|
|
.macro if_has_no_move_with_split battler:req, split:req, ptr:req
|
|
|
|
.byte 0x6A
|
|
|
|
.byte \battler
|
|
|
|
.byte \split
|
|
|
|
.4byte \ptr
|
|
|
|
.endm
|
2022-09-13 21:22:42 +02:00
|
|
|
|
2019-02-09 16:45:02 +01:00
|
|
|
.macro if_physical_moves_unusable attacker:req, target:req, ptr:req
|
|
|
|
.byte 0x6B
|
|
|
|
.byte \attacker
|
|
|
|
.byte \target
|
|
|
|
.4byte \ptr
|
|
|
|
.endm
|
2022-09-13 21:22:42 +02:00
|
|
|
|
2019-02-16 14:54:17 +01:00
|
|
|
.macro if_ai_can_go_down ptr:req
|
|
|
|
.byte 0x6C
|
|
|
|
.4byte \ptr
|
|
|
|
.endm
|
2022-09-13 21:22:42 +02:00
|
|
|
|
2019-05-20 10:10:00 +02:00
|
|
|
.macro if_has_move_with_type battler:req, type:req, ptr:req
|
|
|
|
.byte 0x6D
|
|
|
|
.byte \battler
|
|
|
|
.byte \type
|
|
|
|
.4byte \ptr
|
|
|
|
.endm
|
2022-09-13 21:22:42 +02:00
|
|
|
|
2019-05-20 12:03:00 +02:00
|
|
|
.macro if_no_move_used battler:req, ptr:req
|
|
|
|
.byte 0x6E
|
|
|
|
.byte \battler
|
|
|
|
.4byte \ptr
|
|
|
|
.endm
|
2022-09-13 21:22:42 +02:00
|
|
|
|
2019-05-23 11:41:35 +02:00
|
|
|
.macro if_has_move_with_flag battler:req, flag:req, ptr:req
|
2019-06-25 12:26:27 +02:00
|
|
|
.byte 0x6F
|
2019-05-23 11:41:35 +02:00
|
|
|
.byte \battler
|
|
|
|
.4byte \flag
|
|
|
|
.4byte \ptr
|
|
|
|
.endm
|
2022-09-13 21:22:42 +02:00
|
|
|
|
2019-08-30 17:57:19 +02:00
|
|
|
.macro if_battler_absent battler:req, ptr:req
|
|
|
|
.byte 0x70
|
|
|
|
.byte \battler
|
|
|
|
.4byte \ptr
|
|
|
|
.endm
|
2022-09-13 21:22:42 +02:00
|
|
|
|
2019-08-30 17:57:19 +02:00
|
|
|
.macro if_grounded battler:req, ptr:req
|
|
|
|
.byte 0x71
|
|
|
|
.byte \battler
|
|
|
|
.4byte \ptr
|
|
|
|
.endm
|
2022-09-13 21:22:42 +02:00
|
|
|
|
2019-08-30 17:57:19 +02:00
|
|
|
.macro get_best_dmg_hp_percent
|
|
|
|
.byte 0x72
|
|
|
|
.endm
|
2022-09-13 21:22:42 +02:00
|
|
|
|
2019-08-30 17:57:19 +02:00
|
|
|
.macro get_curr_dmg_hp_percent
|
|
|
|
.byte 0x73
|
|
|
|
.endm
|
2022-09-13 21:22:42 +02:00
|
|
|
|
2019-08-30 17:57:19 +02:00
|
|
|
.macro get_move_split_from_result
|
|
|
|
.byte 0x74
|
|
|
|
.endm
|
2022-09-13 21:22:42 +02:00
|
|
|
|
2020-04-20 14:47:00 +02:00
|
|
|
.macro get_considered_move_split
|
|
|
|
.byte 0x75
|
|
|
|
.endm
|
2022-09-13 21:22:42 +02:00
|
|
|
|
2020-07-15 17:21:12 +02:00
|
|
|
.macro get_considered_move_target
|
|
|
|
.byte 0x76
|
|
|
|
.endm
|
2022-09-13 21:22:42 +02:00
|
|
|
|
2020-07-15 17:21:12 +02:00
|
|
|
.macro compare_speeds battler1:req, battler2:req
|
|
|
|
.byte 0x77
|
|
|
|
.byte \battler1
|
|
|
|
.byte \battler2
|
|
|
|
.endm
|
2022-09-13 21:22:42 +02:00
|
|
|
|
2020-07-15 21:30:24 +02:00
|
|
|
.macro is_wakeup_turn battler:req
|
|
|
|
.byte 0x78
|
|
|
|
.byte \battler
|
|
|
|
.endm
|
2022-09-13 21:22:42 +02:00
|
|
|
|
2020-07-26 13:48:25 +02:00
|
|
|
.macro if_has_move_with_accuracy_lt battler:req, value:req, ptr:req
|
|
|
|
.byte 0x79
|
|
|
|
.byte \battler
|
|
|
|
.byte \value
|
|
|
|
.4byte \ptr
|
|
|
|
.endm
|
2022-09-13 21:22:42 +02:00
|
|
|
|
2017-12-30 16:04:31 +01:00
|
|
|
@ useful script macros
|
2019-02-09 13:21:32 +01:00
|
|
|
.macro if_has_physical_move battler:req, ptr:req
|
|
|
|
if_has_move_with_split \battler, SPLIT_PHYSICAL, \ptr
|
|
|
|
.endm
|
2022-09-13 21:22:42 +02:00
|
|
|
|
2019-02-09 13:21:32 +01:00
|
|
|
.macro if_has_no_physical_move battler:req, ptr:req
|
|
|
|
if_has_no_move_with_split \battler, SPLIT_PHYSICAL, \ptr
|
|
|
|
.endm
|
2022-09-13 21:22:42 +02:00
|
|
|
|
2019-02-09 13:21:32 +01:00
|
|
|
.macro if_has_special_move battler:req, ptr:req
|
|
|
|
if_has_move_with_split \battler, SPLIT_SPECIAL, \ptr
|
|
|
|
.endm
|
2022-09-13 21:22:42 +02:00
|
|
|
|
2019-02-09 13:21:32 +01:00
|
|
|
.macro if_has_no_special_move battler:req, ptr:req
|
|
|
|
if_has_no_move_with_split \battler, SPLIT_SPECIAL, \ptr
|
|
|
|
.endm
|
|
|
|
|
2018-12-02 22:05:23 +01:00
|
|
|
.macro if_holds_no_item battler, ptr:req
|
2018-09-02 15:50:18 +02:00
|
|
|
if_holds_item \battler, 0, \ptr
|
|
|
|
.endm
|
|
|
|
|
2017-12-30 16:04:31 +01:00
|
|
|
.macro get_curr_move_type
|
|
|
|
get_type AI_TYPE_MOVE
|
|
|
|
.endm
|
2022-09-11 20:14:49 +02:00
|
|
|
|
2017-12-30 16:04:31 +01:00
|
|
|
.macro get_user_type1
|
|
|
|
get_type AI_TYPE1_USER
|
|
|
|
.endm
|
2022-09-11 20:14:49 +02:00
|
|
|
|
2017-12-30 16:04:31 +01:00
|
|
|
.macro get_user_type2
|
|
|
|
get_type AI_TYPE2_USER
|
|
|
|
.endm
|
2022-09-11 20:14:49 +02:00
|
|
|
|
2017-12-30 16:04:31 +01:00
|
|
|
.macro get_target_type1
|
|
|
|
get_type AI_TYPE1_TARGET
|
|
|
|
.endm
|
2022-09-11 20:14:49 +02:00
|
|
|
|
2017-12-30 16:04:31 +01:00
|
|
|
.macro get_target_type2
|
|
|
|
get_type AI_TYPE2_TARGET
|
|
|
|
.endm
|
2022-09-11 20:14:49 +02:00
|
|
|
|
2018-12-02 19:24:06 +01:00
|
|
|
.macro if_ability battler:req, ability:req, ptr:req
|
2018-09-01 18:36:08 +02:00
|
|
|
check_ability \battler, \ability
|
2017-12-30 16:04:31 +01:00
|
|
|
if_equal 1, \ptr
|
|
|
|
.endm
|
2022-09-11 20:14:49 +02:00
|
|
|
|
2018-12-02 19:24:06 +01:00
|
|
|
.macro if_no_ability battler:req, ability:req, ptr:req
|
2018-09-01 18:36:08 +02:00
|
|
|
check_ability \battler, \ability
|
2017-12-30 16:04:31 +01:00
|
|
|
if_equal 0, \ptr
|
|
|
|
.endm
|
2022-09-11 20:14:49 +02:00
|
|
|
|
2018-12-02 19:24:06 +01:00
|
|
|
.macro if_type battler:req, type:req, ptr:req
|
2018-09-01 18:36:08 +02:00
|
|
|
is_of_type \battler, \type
|
2017-12-30 16:04:31 +01:00
|
|
|
if_equal 1, \ptr
|
|
|
|
.endm
|
|
|
|
|
2018-12-02 19:24:06 +01:00
|
|
|
.macro if_no_type battler:req, type:req, ptr:req
|
2018-09-01 18:36:08 +02:00
|
|
|
is_of_type \battler, \type
|
2017-12-30 16:04:31 +01:00
|
|
|
if_equal 0, \ptr
|
|
|
|
.endm
|
2022-09-11 20:14:49 +02:00
|
|
|
|
2018-12-02 19:24:06 +01:00
|
|
|
.macro if_target_faster ptr:req
|
2017-12-30 16:04:31 +01:00
|
|
|
if_user_goes 1, \ptr
|
|
|
|
.endm
|
2022-09-11 20:14:49 +02:00
|
|
|
|
2018-12-02 19:24:06 +01:00
|
|
|
.macro if_user_faster ptr:req
|
2017-12-30 16:04:31 +01:00
|
|
|
if_user_goes 0, \ptr
|
|
|
|
.endm
|
2022-09-11 20:14:49 +02:00
|
|
|
|
2018-12-02 19:24:06 +01:00
|
|
|
.macro if_double_battle ptr:req
|
2017-12-30 16:04:31 +01:00
|
|
|
is_double_battle
|
|
|
|
if_equal 1, \ptr
|
|
|
|
.endm
|
2022-09-11 20:14:49 +02:00
|
|
|
|
2018-12-02 19:24:06 +01:00
|
|
|
.macro if_not_double_battle ptr:req
|
2017-12-30 16:04:31 +01:00
|
|
|
is_double_battle
|
|
|
|
if_equal 0, \ptr
|
|
|
|
.endm
|
|
|
|
|
2018-12-02 19:24:06 +01:00
|
|
|
.macro if_any_move_disabled battler:req, ptr:req
|
2018-09-01 18:36:08 +02:00
|
|
|
if_any_move_disabled_or_encored \battler, 0, \ptr
|
2017-12-30 16:04:31 +01:00
|
|
|
.endm
|
2022-09-11 20:14:49 +02:00
|
|
|
|
2018-12-02 19:24:06 +01:00
|
|
|
.macro if_any_move_encored battler:req, ptr:req
|
2018-09-01 18:36:08 +02:00
|
|
|
if_any_move_disabled_or_encored \battler, 1, \ptr
|
2017-12-30 16:04:31 +01:00
|
|
|
.endm
|
2022-09-13 21:22:42 +02:00
|
|
|
|
2018-12-02 22:05:23 +01:00
|
|
|
.macro call_if_always_hit ptr:req
|
2018-08-11 12:16:00 +02:00
|
|
|
get_move_accuracy
|
|
|
|
call_if_eq 0, \ptr
|
|
|
|
.endm
|