diff options
Diffstat (limited to 'asm/macros')
-rw-r--r-- | asm/macros/battle_ai_script.s | 524 | ||||
-rw-r--r-- | asm/macros/battle_script.s | 3 | ||||
-rwxr-xr-x | asm/macros/contest_ai_script.s | 506 | ||||
-rw-r--r-- | asm/macros/field_effect_script.s | 16 | ||||
-rw-r--r-- | asm/macros/m4a.s | 13 | ||||
-rw-r--r-- | asm/macros/pokemon_data.s | 4 |
6 files changed, 1053 insertions, 13 deletions
diff --git a/asm/macros/battle_ai_script.s b/asm/macros/battle_ai_script.s new file mode 100644 index 000000000..3405e7e44 --- /dev/null +++ b/asm/macros/battle_ai_script.s @@ -0,0 +1,524 @@ + .macro if_random percent, address + .byte 0x00 + .byte \percent + .4byte \address + .endm + + .macro if_not_random percent, address + .byte 0x01 + .byte \percent + .4byte \address + .endm + + .macro if_random_1 address + .byte 0x02 + .4byte \address + .endm + + .macro if_not_random_1 address + .byte 0x03 + .4byte \address + .endm + + .macro score score + .byte 0x04 + .byte \score + .endm + + .macro if_hp_less_than target, percent, address + .byte 0x05 + .byte \target + .byte \percent + .4byte \address + .endm + + .macro if_hp_more_than target, percent, address + .byte 0x06 + .byte \target + .byte \percent + .4byte \address + .endm + + .macro if_hp_equal target, percent, address + .byte 0x07 + .byte \target + .byte \percent + .4byte \address + .endm + + .macro if_hp_not_equal target, percent, address + .byte 0x08 + .byte \target + .byte \percent + .4byte \address + .endm + + .macro if_status target, status, address + .byte 0x09 + .byte \target + .4byte \status + .4byte \address + .endm + + .macro if_not_status target, status, address + .byte 0x0a + .byte \target + .4byte \status + .4byte \address + .endm + + .macro if_status2 target, status, address + .byte 0x0b + .byte \target + .4byte \status + .4byte \address + .endm + + .macro if_not_status2 target, status, address + .byte 0x0c + .byte \target + .4byte \status + .4byte \address + .endm + + .macro if_status3 target, status, address + .byte 0x0d + .byte \target + .4byte \status + .4byte \address + .endm + + .macro if_not_status3 target, status, address + .byte 0x0e + .byte \target + .4byte \status + .4byte \address + .endm + + .macro if_status4 target, status, address + .byte 0x0f + .byte \target + .4byte \status + .4byte \address + .endm + + .macro if_not_status4 target, status, address + .byte 0x10 + .byte \target + .4byte \status + .4byte \address + .endm + + .macro if_less_than value, address + .byte 0x11 + .byte \value + .4byte \address + .endm + + .macro if_more_than value, address + .byte 0x12 + .byte \value + .4byte \address + .endm + + .macro if_equal value, address + .byte 0x13 + .byte \value + .4byte \address + .endm + + .macro if_not_equal value, address + .byte 0x14 + .byte \value + .4byte \address + .endm + + .macro if_less_than_32 value, address + .byte 0x15 + .4byte \value + .4byte \address + .endm + + .macro if_more_than_32 value, address + .byte 0x16 + .4byte \value + .4byte \address + .endm + + .macro if_equal_32 value, address + .byte 0x17 + .4byte \value + .4byte \address + .endm + + .macro if_not_equal_32 value, address + .byte 0x18 + .4byte \value + .4byte \address + .endm + + .macro if_move move, address + .byte 0x19 + .2byte \move + .4byte \address + .endm + + .macro if_not_move move, address + .byte 0x1a + .2byte \move + .4byte \address + .endm + + .macro if_in_bytes list, address + .byte 0x1b + .4byte \list + .4byte \address + .endm + + .macro if_not_in_bytes list, address + .byte 0x1c + .4byte \list + .4byte \address + .endm + + .macro if_in_words list, address + .byte 0x1d + .4byte \list + .4byte \address + .endm + + .macro if_not_in_words list, address + .byte 0x1e + .4byte \list + .4byte \address + .endm + + .macro if_user_can_damage address + .byte 0x1f + .4byte \address + .endm + + .macro if_user_cant_damage address + .byte 0x20 + .4byte \address + .endm + + .macro get_turn_count + .byte 0x21 + .endm + + .macro get_type byte + .byte 0x22 + .byte \byte + .endm + + .macro ai_23 + .byte 0x23 + .endm + + .macro is_most_powerful_move + .byte 0x24 + .endm + + .macro get_move target + .byte 0x25 + .byte \target + .endm + + .macro if_type type, address + .byte 0x26 + .byte \type + .4byte \address + .endm + + .macro ai_27 + .byte 0x27 + .endm + + .macro if_would_go_first target, address + .byte 0x28 + .byte \target + .4byte \address + .endm + + .macro if_would_not_go_first target, address + .byte 0x29 + .byte \target + .4byte \address + .endm + + .macro ai_2a + .byte 0x2a + .endm + + .macro ai_2b + .byte 0x2b + .endm + + .macro count_alive_pokemon target + .byte 0x2c + .byte \target + .endm + + .macro ai_2d + .byte 0x2d + .endm + + .macro get_effect + .byte 0x2e + .endm + + .macro get_ability target + .byte 0x2f + .byte \target + .endm + + .macro ai_30 + .byte 0x30 + .endm + + .macro if_damage_bonus value, address + .byte 0x31 + .byte \value + .4byte \address + .endm + + .macro ai_32 + .byte 0x32 + .endm + + .macro ai_33 + .byte 0x33 + .endm + + .macro if_status_in_party target, status, address + .byte 0x34 + .byte \target + .4byte \status + .4byte \address + .endm + + @ bugged + .macro if_status_not_in_party target, status, address + .byte 0x35 + .byte \target + .4byte \status + .4byte \address + .endm + + .macro get_weather + .byte 0x36 + .endm + + .macro if_effect byte, address + .byte 0x37 + .byte \byte + .4byte \address + .endm + + .macro if_not_effect byte, address + .byte 0x38 + .byte \byte + .4byte \address + .endm + + .macro if_stat_level_less_than target, stat, level, address + .byte 0x39 + .byte \target + .byte \stat + .byte \level + .4byte \address + .endm + + .macro if_stat_level_more_than target, stat, level, address + .byte 0x3a + .byte \target + .byte \stat + .byte \level + .4byte \address + .endm + + .macro if_stat_level_equal target, stat, level, address + .byte 0x3b + .byte \target + .byte \stat + .byte \level + .4byte \address + .endm + + .macro if_stat_level_not_equal target, stat, level, address + .byte 0x3c + .byte \target + .byte \stat + .byte \level + .4byte \address + .endm + + .macro if_can_faint address + .byte 0x3d + .4byte \address + .endm + + .macro if_cant_faint address + .byte 0x3e + .4byte \address + .endm + + .macro if_has_move + .byte 0x3f + .endm + + .macro if_dont_have_move + .byte 0x40 + .endm + + .macro if_move_effect target, effect, address + .byte 0x41 + .byte \target + .byte \effect + .4byte \address + .endm + + .macro if_not_move_effect target, effect, address + .byte 0x42 + .byte \target + .byte \effect + .4byte \address + .endm + + .macro if_last_move_did_damage target, byte, address + .byte 0x43 + .byte \target + .byte \byte + .4byte \address + .endm + + .macro if_encored address + .byte 0x44 + .4byte \address + .endm + + .macro flee + .byte 0x45 + .endm + + .macro if_random_2 address + .byte 0x46 + .4byte \address + .endm + + .macro flee2 + .byte 0x47 + .endm + + .macro get_hold_effect target + .byte 0x48 + .byte \target + .endm + + .macro get_gender target + .byte 0x49 + .byte \target + .endm + + .macro is_first_turn target + .byte 0x4a + .byte \target + .endm + + .macro get_stockpile_count target + .byte 0x4b + .byte \target + .endm + + .macro is_double_battle + .byte 0x4c + .endm + + .macro get_item target + .byte 0x4d + .byte \target + .endm + + .macro get_move_type + .byte 0x4e + .endm + + .macro get_move_power + .byte 0x4f + .endm + + .macro get_move_effect + .byte 0x50 + .endm + + .macro get_protect_count target + .byte 0x51 + .byte \target + .endm + + .macro ai_52 + .byte 0x52 + .endm + + .macro ai_53 + .byte 0x53 + .endm + + .macro ai_54 + .byte 0x54 + .endm + + .macro ai_55 + .byte 0x55 + .endm + + .macro ai_56 + .byte 0x56 + .endm + + .macro ai_57 + .byte 0x57 + .endm + + .macro call address + .byte 0x58 + .4byte \address + .endm + + .macro jump address + .byte 0x59 + .4byte \address + .endm + + .macro end + .byte 0x5a + .endm + + .macro if_level_cond cond, address + .byte 0x5b + .byte \cond + .4byte \address + .endm + + .macro if_user_higher_level address + if_level_cond 0, \address + .endm + + .macro if_target_higher_level address + if_level_cond 1, \address + .endm + + .macro if_equal_levels address + if_level_cond 2, \address + .endm + + .macro if_taunted address + .byte 0x5c + .4byte \address + .endm + + .macro if_not_taunted address + .byte 0x5d + .4byte \address + .endm diff --git a/asm/macros/battle_script.s b/asm/macros/battle_script.s index 261efd8eb..5dd1d5a1a 100644 --- a/asm/macros/battle_script.s +++ b/asm/macros/battle_script.s @@ -4,9 +4,6 @@ @ 3 > @ 4 &= -.equiv TARGET, 0 -.equiv USER, 1 - .macro calculatedamage critical atk5 diff --git a/asm/macros/contest_ai_script.s b/asm/macros/contest_ai_script.s new file mode 100755 index 000000000..05d70e351 --- /dev/null +++ b/asm/macros/contest_ai_script.s @@ -0,0 +1,506 @@ +@ Add a positive/negative value to the score of the move being evaluated. + + .macro score score + .byte 0x00 + .byte \score + .endm + +@ turn (AKA "Appeal No.") + + .macro get_turn + .byte 0x01 + .endm + + .macro if_turn_less_than param, addr + .byte 0x02 + .byte \param + .4byte \addr + .endm + + .macro if_turn_more_than param, addr + .byte 0x03 + .byte \param + .4byte \addr + .endm + + .macro if_turn_eq param, addr + .byte 0x04 + .byte \param + .4byte \addr + .endm + + .macro if_turn_not_eq param, addr + .byte 0x05 + .byte \param + .4byte \addr + .endm + +@ audience excitement + + .macro get_excitement + .byte 0x06 + .endm + + .macro if_excitement_less_than param, addr + .byte 0x07 + .byte \param + .4byte \addr + .endm + + .macro if_excitement_more_than param, addr + .byte 0x08 + .byte \param + .4byte \addr + .endm + + .macro if_excitement_eq param, addr + .byte 0x09 + .byte \param + .4byte \addr + .endm + + .macro if_excitement_not_eq param, addr + .byte 0x0A + .byte \param + .4byte \addr + .endm + +@ the order that the user goes in the current turn + + .macro get_user_order + .byte 0x0B + .endm + + .macro if_user_order_less_than param addr + .byte 0x0C + .byte \param + .4byte \addr + .endm + + .macro if_user_order_more_than param addr + .byte 0x0D + .byte \param + .4byte \addr + .endm + + .macro if_user_order_eq param addr + .byte 0x0E + .byte \param + .4byte \addr + .endm + + .macro if_user_order_not_eq param addr + .byte 0x0F + .byte \param + .4byte \addr + .endm + +@ user condition + + .macro get_user_condition + .byte 0x10 + .endm + + .macro if_user_condition_less_than param, addr + .byte 0x11 + .byte \param + .4byte \addr + .endm + + .macro if_user_condition_more_than param, addr + .byte 0x12 + .byte \param + .4byte \addr + .endm + + .macro if_user_condition_eq param, addr + .byte 0x13 + .byte \param + .4byte \addr + .endm + + .macro if_user_condition_not_eq param, addr + .byte 0x14 + .byte \param + .4byte \addr + .endm + +@ 15 +@ 16 +@ 17 +@ 18 +@ 19 +@ 1A +@ 1B +@ 1C +@ 1D +@ 1E + +@ contest type + + .macro get_contest_type + .byte 0x1F + .endm + + .macro if_contest_type_eq param, addr + .byte 0x20 + .byte \param + .4byte \addr + .endm + + .macro if_contest_type_not_eq param, addr + .byte 0x21 + .byte \param + .4byte \addr + .endm + +@ move excitement (change in excitement due to move) + + .macro get_move_excitement + .byte 0x22 + .endm + + .macro if_move_excitement_less_than param, addr + .byte 0x23 + .byte \param + .4byte \addr + .endm + + .macro if_move_excitement_more_than param, addr + .byte 0x24 + .byte \param + .4byte \addr + .endm + + .macro if_move_excitement_eq param, addr + .byte 0x25 + .byte \param + .4byte \addr + .endm + + .macro if_move_excitement_not_eq param, addr + .byte 0x26 + .byte \param + .4byte \addr + .endm + +@ move effect + + .macro get_effect + .byte 0x27 + .endm + + .macro if_effect_eq param, addr + .byte 0x28 + .byte \param + .4byte \addr + .endm + + .macro if_effect_not_eq param, addr + .byte 0x29 + .byte \param + .4byte \addr + .endm + +@ move effect type + + .macro get_effect_type + .byte 0x2A + .endm + + .macro if_effect_type_eq param, addr + .byte 0x2B + .byte \param + .4byte \addr + .endm + + .macro if_effect_type_not_eq param, addr + .byte 0x2C + .byte \param + .4byte \addr + .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 addr + .byte 0x2E + .4byte \addr + .endm + +@ 2F +@ 30 +@ 31 +@ 32 +@ 33 +@ 34 +@ 35 +@ 36 +@ 37 +@ 38 +@ 39 +@ 3A + +@ number of times current move has been used + + .macro get_move_used_count + .byte 0x3B + .endm + + .macro if_move_used_count_less_than param, addr + .byte 0x3C + .byte \param + .4byte \addr + .endm + + .macro if_move_used_count_more_than param, addr + .byte 0x3D + .byte \param + .4byte \addr + .endm + + .macro if_move_used_count_eq param, addr + .byte 0x3E + .byte \param + .4byte \addr + .endm + + .macro if_move_used_count_not_eq param, addr + .byte 0x3F + .byte \param + .4byte \addr + .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 addr + .byte 0x41 + .4byte \addr + .endm + + .macro if_not_combo_starter addr + .byte 0x42 + .4byte \addr + .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 addr + .byte 0x44 + .4byte \addr + .endm + + .macro if_not_combo_finisher addr + .byte 0x45 + .4byte \addr + .endm + +@ whether the current move would finish a combo + + .macro check_would_finish_combo + .byte 0x46 + .endm + + .macro if_would_finish_combo addr + .byte 0x47 + .4byte \addr + .endm + + .macro if_would_not_finish_combo addr + .byte 0x48 + .4byte \addr + .endm + +@ condition of mon (indexed by order) + + .macro get_condition mon + .byte 0x49 + .byte \mon + .endm + + .macro if_condition_less_than mon, value, addr + .byte 0x4A + .byte \mon + .byte \value + .4byte \addr + .endm + + .macro if_condition_more_than mon, value, addr + .byte 0x4B + .byte \mon + .byte \value + .4byte \addr + .endm + + .macro if_condition_eq mon, value, addr + .byte 0x4C + .byte \mon + .byte \value + .4byte \addr + .endm + + .macro if_condition_not_eq mon, value, addr + .byte 0x4D + .byte \mon + .byte \value + .4byte \addr + .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 + .byte 0x4E + .byte \mon + .endm + + .macro if_used_combo_starter_less_than mon, value, addr + .byte 0x4F + .byte \mon + .byte \value + .4byte \addr + .endm + + .macro if_used_combo_starter_more_than mon, value, addr + .byte 0x50 + .byte \mon + .byte \value + .4byte \addr + .endm + + + .macro if_used_combo_starter_eq mon, value, addr + .byte 0x51 + .byte \mon + .byte \value + .4byte \addr + .endm + + .macro if_used_combo_starter_not_eq mon, value, addr + .byte 0x52 + .byte \mon + .byte \value + .4byte \addr + .endm + +@ whether the mon can make an appeal + + .macro check_can_participate mon + .byte 0x53 + .byte \mon + .endm + + .macro if_can_participate mon, addr + .byte 0x54 + .byte \mon + .4byte \addr + .endm + + .macro if_cannot_participate mon, addr + .byte 0x55 + .byte \mon + .4byte \addr + .endm + +@ 56 +@ 57 + + .macro contest_58 param addr + .byte 0x58 + .byte \param + .4byte \addr + .endm + +@ 59 +@ 5A +@ 5B +@ 5C +@ 5D +@ 5E +@ 5F +@ 60 +@ 61 +@ 62 +@ 63 +@ 64 +@ 65 +@ 66 +@ 67 +@ 68 +@ 69 +@ 6A +@ 6B +@ 6C +@ 6D +@ 6E +@ 6F +@ 70 +@ 71 +@ 72 +@ 73 +@ 74 +@ 75 +@ 76 +@ 77 +@ 78 +@ 79 +@ 7A +@ 7B +@ 7C + + .macro if_random param addr + .byte 0x7D + .byte \param + .4byte \addr + .endm + +@ 7E + + .macro jump addr + .byte 0x7F + .4byte \addr + .endm + + .macro call addr + .byte 0x80 + .4byte \addr + .endm + + .macro end + .byte 0x81 + .endm + + .macro check_user_has_exciting_move + .byte 0x82 + .endm + + .macro if_user_has_exciting_move addr + .byte 0x83 + .4byte \addr + .endm + + .macro if_user_doesnt_have_exciting_move addr + .byte 0x84 + .4byte \addr + .endm + +@ 85 +@ 86 + + .macro if_effect_in_user_moveset param addr + .byte 0x87 + .2byte \param + .4byte \addr + .endm diff --git a/asm/macros/field_effect_script.s b/asm/macros/field_effect_script.s index 597b89acb..d5895b0ef 100644 --- a/asm/macros/field_effect_script.s +++ b/asm/macros/field_effect_script.s @@ -1,41 +1,41 @@ - .macro field_eff_loadtiles address + .macro loadtiles address .byte 0 .4byte \address .endm - .macro field_eff_loadfadedpal address + .macro loadfadedpal address .byte 1 .4byte \address .endm - .macro field_eff_loadpal address + .macro loadpal address .byte 2 .4byte \address .endm - .macro field_eff_callnative address + .macro callnative address .byte 3 .4byte \address .endm - .macro field_eff_end + .macro end .byte 4 .endm - .macro field_eff_loadgfx_callnative tiles_address, palette_address, function_address + .macro 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 + .macro loadtiles_callnative tiles_address, function_address .byte 6 .4byte \tiles_address .4byte \function_address .endm - .macro field_eff_loadfadedpal_callnative palette_address, function_address + .macro loadfadedpal_callnative palette_address, function_address .byte 7 .4byte \palette_address .4byte \function_address diff --git a/asm/macros/m4a.s b/asm/macros/m4a.s new file mode 100644 index 000000000..6c5abc09b --- /dev/null +++ b/asm/macros/m4a.s @@ -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 diff --git a/asm/macros/pokemon_data.s b/asm/macros/pokemon_data.s index f18462d34..b0a5f22e3 100644 --- a/asm/macros/pokemon_data.s +++ b/asm/macros/pokemon_data.s @@ -1,6 +1,6 @@ - .macro pokedex_entry pokemon_name, height, width, pokemon_scale, pokemon_offset, trainer_scale, trainer_offset + .macro pokedex_entry pokemon_name, height, weight, pokemon_scale, pokemon_offset, trainer_scale, trainer_offset .2byte \height @ in decimeters - .2byte \width @ in hectograms + .2byte \weight @ in hectograms .4byte DexDescription_\pokemon_name\()_1 .4byte DexDescription_\pokemon_name\()_2 .2byte 0 @ unused |